Skip to content

Commit 3d095b8

Browse files
committed
Move AbstractFeatureTest to ops2 base dir
The net.imagej.ops2.features package exists only in the test scope, thus it is not exported in the source module-info.java. This made tests using that package (any feature test) unusable in Eclipse, for example. This commit works around the issue by moving the AbstractFeatureTest to the base net.imagej.ops2 directory, which is already being exported.
1 parent a245ba7 commit 3d095b8

8 files changed

Lines changed: 12 additions & 15 deletions

File tree

imagej/imagej-ops2/src/test/java/net/imagej/ops2/features/AbstractFeatureTest.java renamed to imagej/imagej-ops2/src/test/java/net/imagej/ops2/AbstractFeatureTest.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* #L%
2828
*/
2929

30-
package net.imagej.ops2.features;
30+
package net.imagej.ops2;
3131

3232
import java.io.IOException;
3333
import java.net.URISyntaxException;
@@ -41,7 +41,6 @@
4141

4242
import net.imagej.mesh.Mesh;
4343
import net.imagej.mesh.naive.NaiveDoubleMesh;
44-
import net.imagej.ops2.AbstractOpTest;
4544
import net.imglib2.Cursor;
4645
import net.imglib2.IterableInterval;
4746
import net.imglib2.RandomAccess;
@@ -251,13 +250,13 @@ public Img<UnsignedByteType> getEllipsedBitImage(final long[] dim,
251250
}
252251

253252
protected static Img<FloatType> getTestImage2D() {
254-
return openFloatImg(AbstractFeatureTest.class, "2d_geometric_features_testlabel.tif");
253+
return openFloatImg(AbstractFeatureTest.class, "features/2d_geometric_features_testlabel.tif");
255254
}
256255

257256
protected static Polygon2D getPolygon() {
258257
final List<RealPoint> vertices = new ArrayList<>();
259258
try {
260-
Files.lines(Paths.get(AbstractFeatureTest.class.getResource("2d_geometric_features_polygon.txt").toURI()))
259+
Files.lines(Paths.get(AbstractFeatureTest.class.getResource("features/2d_geometric_features_polygon.txt").toURI()))
261260
.forEach(l -> {
262261
String[] coord = l.split(" ");
263262
RealPoint v = new RealPoint(new double[]{ Double.parseDouble(coord[0]),
@@ -271,7 +270,7 @@ protected static Polygon2D getPolygon() {
271270
}
272271

273272
protected static Img<FloatType> getTestImage3D() {
274-
return openFloatImg(AbstractFeatureTest.class, "3d_geometric_features_testlabel.tif");
273+
return openFloatImg(AbstractFeatureTest.class, "features/3d_geometric_features_testlabel.tif");
275274
}
276275

277276
protected static Mesh getMesh() {
@@ -280,7 +279,7 @@ protected static Mesh getMesh() {
280279
final Map<Vector3D, Long> indexMap = new HashMap<>();
281280
final LongArray indices = new LongArray();
282281
try {
283-
Files.lines(Paths.get(AbstractFeatureTest.class.getResource("3d_geometric_features_mesh.txt").toURI()))
282+
Files.lines(Paths.get(AbstractFeatureTest.class.getResource("features/3d_geometric_features_mesh.txt").toURI()))
284283
.forEach(l -> {
285284
String[] coord = l.split(" ");
286285
final double x = Double.parseDouble(coord[0]);

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/features/haralick/HaralickFeatureTest.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import static org.junit.jupiter.api.Assertions.assertEquals;
3232

3333
import net.imagej.ops2.AbstractOpTest;
34-
import net.imagej.ops2.features.AbstractFeatureTest;
3534
import net.imagej.ops2.image.cooccurrenceMatrix.MatrixOrientation2D;
3635
import net.imglib2.img.Img;
3736
import net.imglib2.type.numeric.integer.UnsignedByteType;
@@ -60,7 +59,7 @@ public class HaralickFeatureTest extends AbstractOpTest {
6059

6160
@BeforeEach
6261
public void loadImage() {
63-
img = openUnsignedByteType(AbstractFeatureTest.class, "haralick_test_img.tif");
62+
img = openUnsignedByteType(AbstractOpTest.class, "features/haralick_test_img.tif");
6463
}
6564

6665
@Test

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/features/lbp2d/LBP2dFeatureTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import java.util.ArrayList;
3434

35-
import net.imagej.ops2.features.AbstractFeatureTest;
35+
import net.imagej.ops2.AbstractFeatureTest;
3636
import net.imglib2.type.numeric.integer.LongType;
3737

3838
import org.junit.jupiter.api.Test;

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/features/tamura2d/Tamura2dFeatureTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import static org.junit.jupiter.api.Assertions.assertEquals;
3333

34-
import net.imagej.ops2.features.AbstractFeatureTest;
34+
import net.imagej.ops2.AbstractFeatureTest;
3535
import net.imglib2.img.Img;
3636
import net.imglib2.img.array.ArrayImgs;
3737
import net.imglib2.type.numeric.integer.ByteType;

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/features/zernike/ZernikeFeatureTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
import static org.junit.jupiter.api.Assertions.assertEquals;
3232

33-
import net.imagej.ops2.features.AbstractFeatureTest;
33+
import net.imagej.ops2.AbstractFeatureTest;
3434
import net.imglib2.type.numeric.real.DoubleType;
3535

3636
import org.junit.jupiter.api.Test;

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/geom/geom2d/PolygonFeatureTests.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
import java.util.List;
3434

35-
import net.imagej.ops2.features.AbstractFeatureTest;
35+
import net.imagej.ops2.AbstractFeatureTest;
3636
import net.imagej.ops2.geom.GeomUtils;
3737
import net.imglib2.RealLocalizable;
3838
import net.imglib2.RealPoint;

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/geom/geom3d/MeshFeatureTests.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
import net.imagej.mesh.Mesh;
3737
import net.imagej.mesh.Triangle;
38-
import net.imagej.ops2.features.AbstractFeatureTest;
38+
import net.imagej.ops2.AbstractFeatureTest;
3939
import net.imglib2.roi.labeling.LabelRegion;
4040
import net.imglib2.type.numeric.real.DoubleType;
4141

‎imagej/imagej-ops2/src/test/java/net/imagej/ops2/morphology/thin/ThinningTest.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package net.imagej.ops2.morphology.thin;
3131

3232
import net.imagej.ops2.AbstractOpTest;
33-
import net.imagej.ops2.features.AbstractFeatureTest;
3433
import net.imglib2.img.Img;
3534
import net.imglib2.test.ImgLib2Assert;
3635
import net.imglib2.type.logic.BitType;
@@ -52,7 +51,7 @@ public class ThinningTest extends AbstractOpTest {
5251

5352
@BeforeEach
5453
public void initialize() {
55-
Img<FloatType> testImg = openFloatImg(AbstractFeatureTest.class, "3d_geometric_features_testlabel.tif");
54+
Img<FloatType> testImg = openFloatImg(AbstractOpTest.class, "features/3d_geometric_features_testlabel.tif");
5655
in = ops.op("create.img").input(testImg, new BitType()).outType(new Nil<Img<BitType>>() {}).apply();
5756
target = ops.op("create.img").input(in, new BitType()).outType(new Nil<Img<BitType>>() {}).apply();
5857
ops.op("convert.bit").input(testImg).output(in).compute();

0 commit comments

Comments
 (0)