Issue 13 in thread-weaver: Breakpoint put in not reachable point

12 views
Skip to first unread message

thread...@googlecode.com

unread,
Jan 9, 2015, 4:12:43 AM1/9/15
to thread...@googlegroups.com
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

Alasdair Mackintosh

unread,
Jan 9, 2015, 11:18:11 AM1/9/15
to thread...@googlegroups.com

I see you are running with debug set true. Can you append the debug output to the bug report? Thanks.

--

---You received this message because you are subscribed to the Google Groups "Thread Weaver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thread-weaver+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages