Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 13 by
martin.v...@gmail.com: Breakpoint put in not reachable point
https://code.google.com/p/thread-weaver/issues/detail?id=13
What steps will reproduce the problem?
1. run the following test:
@Test
public void testTest() {
AnnotatedTestRunner runner = new AnnotatedTestRunner();
HashSet<String> methods = new HashSet<String>();
runner.setMethodOption(MethodOption.ALL_METHODS, methods);
runner.setTimeout(10000);
runner.setDebug(true);
runner.runTests(TestTest.class, TestedObject.class);
}
public static class TestTest {
TestedObject to;
Map<Integer, Integer> valuesThread1;
Map<Integer, Integer> valuesThread2;
@ThreadedBefore
public void before() {
to = new TestedObject();
}
@ThreadedMain
public void mainThread() {
valuesThread1 = to.getValues(new HashSet<Integer>(Arrays.asList(1)));
}
@ThreadedSecondary
public void secondThread() {
valuesThread2 = to.getValues(new HashSet<Integer>(Arrays.asList(1)));
}
@ThreadedAfter
public void after() {
Assert.assertEquals(valuesThread1, valuesThread2);
}
}
private static class TestedObject {
public Map<Integer, Integer> getValues(Set<Integer> keys) {
Map<Integer, Integer> values = new HashMap<Integer, Integer>();
for (Integer key : keys) {
if (key.equals(1)) {
values.put(key, key);
}
else {
getOtherThanOneValue(values, keys);
}
}
return values;
}
private void getOtherThanOneValue(Map<Integer, Integer> values,
Set<Integer> loadKeys) {
for (Integer key : loadKeys) {
values.put(key, key);
}
}
}
What is the expected output? What do you see instead?
expected: test should be green
actual: test is red, end with "Did not reach Breakpoint"
What version of the product are you using? On what operating system?
revision 55 on Win7
Please provide any additional information below.
It would run fine without the line
runner.setMethodOption(MethodOption.ALL_METHODS, methods);
but I want to test all methods
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings