Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kcooney committed Mar 1, 2013
1 parent b11b5aa commit e1172af
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,14 @@
<run-local-tests />
</target>

<target name="dist" depends="populate-dist">
<target name="test-dist" depends="populate-dist">
<run-dist-tests>
<jvmarg value="-Dignore.this=ignored"/>
</run-dist-tests>
</target>

<target name="dist" depends="test-dist" />

<target name="profile" depends="populate-dist">
<run-dist-tests>
<jvmarg value="-agentlib:hprof=cpu=samples"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ public boolean equals(Object other) {

@Override
public String toString() {
return fListener.toString();
return fListener.toString() + " (with synchronization wrapper)";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void run() {
fNotifier.removeListener(listener1);
fNotifier.removeListener(listener2);

assertThat(listener1.fTestStarted.get(), is(4));
assertThat(listener2.fTestStarted.get(), is(4));
assertThat(listener1.fTestStarted.get(), is(numParallelTests));
assertThat(listener2.fTestStarted.get(), is(numParallelTests));
}

private static class ExaminedListener extends RunListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public NamedListener(String name) {
fName = name;
}

@Override
public String toString() {
return "NamedListener";
}

@Override
public int hashCode() {
return fName.hashCode();
Expand Down Expand Up @@ -124,7 +129,15 @@ public void namedListenerCorrectlyImplementsEqualsAndHashCode() {
assertEquals(listener1.hashCode(), listener2.hashCode());
assertNotEquals(listener1.hashCode(), listener3.hashCode());
}


@Test
public void toStringDelegates() {
NamedListener listener = new NamedListener("blue");

assertEquals("NamedListener", listener.toString());
assertEquals("NamedListener (with synchronization wrapper)", new SynchronizedRunListener(listener).toString());
}

@Test
public void equalsDelegates() {
NamedListener listener1 = new NamedListener("blue");
Expand Down

0 comments on commit e1172af

Please sign in to comment.