Skip to content

Commit 54200aa

Browse files
committed
Put helper classes in the correct enclosing test
The generics methods used to live in ClassUtils, so there were generic helper classes in ClassUtilsTest to facilitate testing them. But the methods moved to a dedicated utility class, GenericUtils, and the unit tests moved along with them to a new GenericUtilsTest. However, somehow, the helper classes used by those tests did not move out of ClassUtilsTest and into GenericUtilsTest. Let's do that now.
1 parent 6766ecf commit 54200aa

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

src/test/java/org/scijava/util/ClassUtilsTest.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import java.io.IOException;
4343
import java.io.InputStream;
4444
import java.io.OutputStream;
45-
import java.io.Serializable;
4645
import java.net.URL;
4746
import java.net.URLClassLoader;
4847
import java.util.jar.JarOutputStream;
@@ -189,24 +188,4 @@ private void assertLoaded(final Class<?> c, final String name) {
189188
assertSame(c, ClassUtils.loadClass(name));
190189
}
191190

192-
// -- Helper classes --
193-
194-
public static class Thing<T> {
195-
public T thing;
196-
}
197-
198-
public static class NumberThing<N extends Number> extends Thing<N> {
199-
// NB: No implementation needed.
200-
}
201-
202-
public static class IntegerThing extends NumberThing<Integer> {
203-
// NB: No implementation needed.
204-
}
205-
206-
public static class ComplexThing<T extends Serializable & Cloneable> extends
207-
Thing<T>
208-
{
209-
// NB: No implementation needed.
210-
}
211-
212191
}

src/test/java/org/scijava/util/GenericUtilsTest.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242
import java.util.List;
4343

4444
import org.junit.Test;
45-
import org.scijava.util.ClassUtilsTest.ComplexThing;
46-
import org.scijava.util.ClassUtilsTest.IntegerThing;
47-
import org.scijava.util.ClassUtilsTest.NumberThing;
48-
import org.scijava.util.ClassUtilsTest.Thing;
4945

5046
/**
5147
* Tests {@link GenericUtils}.
@@ -139,6 +135,27 @@ public void testGetGenericType() {
139135
Serializable.class, Cloneable.class);
140136
}
141137

138+
// -- Helper classes --
139+
140+
private static class Thing<T> {
141+
@SuppressWarnings("unused")
142+
private T thing;
143+
}
144+
145+
private static class NumberThing<N extends Number> extends Thing<N> {
146+
// NB: No implementation needed.
147+
}
148+
149+
private static class IntegerThing extends NumberThing<Integer> {
150+
// NB: No implementation needed.
151+
}
152+
153+
private static class ComplexThing<T extends Serializable & Cloneable> extends
154+
Thing<T>
155+
{
156+
// NB: No implementation needed.
157+
}
158+
142159
// -- Helper methods --
143160

144161
/** Convenience method to get the {@link Type} of a field. */

0 commit comments

Comments
 (0)