Skip to content

Commit 19c65fd

Browse files
gselzerhinerm
authored andcommitted
POM: Align scijava-persist with incubator model
This commit makes a few changes which are needed in combination, resulting in a incubator ready Maven module 1) Adds scijava-persist as a child module of the incubator 2) Denotes the incubator as the parent of scijava-persist 3) Removes the ImageJ dependency in favor of SciJava Common
1 parent b9d43d9 commit 19c65fd

3 files changed

Lines changed: 16 additions & 23 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<modules>
4848
<module>imagej/imagej-ops2</module>
4949
<module>imagej/imagej-testutil</module>
50+
<module>scijava/scijava-persist</module>
5051
<module>scijava/scijava-ops</module>
5152
<module>scijava/scijava-testutil</module>
5253
<module>scijava/scijava-types</module>

scijava/scijava-persist/pom.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,13 @@
55
http://maven.apache.org/xsd/maven-4.0.0.xsd">
66
<modelVersion>4.0.0</modelVersion>
77

8-
<!-- <parent>
8+
<parent>
99
<groupId>org.scijava</groupId>
1010
<artifactId>scijava-incubator</artifactId>
1111
<version>0-SNAPSHOT</version>
1212
<relativePath>../..</relativePath>
13-
</parent> -->
14-
15-
<parent>
16-
<groupId>org.scijava</groupId>
17-
<artifactId>pom-scijava</artifactId>
18-
<version>30.0.0</version>
19-
<relativePath />
2013
</parent>
21-
14+
2215
<artifactId>scijava-persist</artifactId>
2316

2417
<name>SciJava Persist</name>
@@ -103,8 +96,8 @@
10396

10497
<dependencies>
10598
<dependency>
106-
<groupId>net.imagej</groupId>
107-
<artifactId>imagej</artifactId>
99+
<groupId>org.scijava</groupId>
100+
<artifactId>scijava-common</artifactId>
108101
</dependency>
109102

110103
<dependency>

scijava/scijava-persist/src/test/java/org/scijava/persist/SerializationTests.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
package org.scijava.persist;
22

33
import com.google.gson.Gson;
4-
import net.imagej.ImageJ;
54
import org.junit.After;
65
import org.junit.Assert;
76
import org.junit.Before;
87
import org.junit.Test;
8+
import org.scijava.Context;
99
import org.scijava.persist.testobjects.Circle;
1010
import org.scijava.persist.testobjects.Shape;
1111
import org.scijava.persist.testobjects.Shapes;
1212

1313
public class SerializationTests {
14-
static ImageJ ij;
14+
static Context context;
1515
static Gson gson;
1616

1717
public static void main(String... args) {
18-
ij = new ImageJ();
19-
ij.ui().showUI();
20-
if (ij.context()==null) {
18+
context = new Context(IObjectScijavaAdapterService.class);
19+
if (context==null) {
2120
System.out.println("Null context");
2221
}
23-
gson = ScijavaGsonHelper.getGson(ij.context());
22+
gson = ScijavaGsonHelper.getGson(context);
2423
}
2524

2625
@Before
2726
public void openFiji() {
2827
// Initializes static SourceService and Display Service and plugins for serialization
29-
ij = new ImageJ();
30-
ij.ui().showUI();
31-
if (ij.context()==null) {
28+
context = new Context(IObjectScijavaAdapterService.class);
29+
if (context==null) {
3230
System.out.println("Null context");
3331
}
34-
gson = ScijavaGsonHelper.getGson(ij.context(), true);
32+
gson = ScijavaGsonHelper.getGson(context, true);
3533
}
3634

3735
@After
3836
public void closeFiji() throws Exception {
39-
// Closes ij context
40-
ij.context().close(); //TODO : understand why this is not working
37+
context.dispose();
38+
context = null;
39+
gson = null;
4140
}
4241

4342
/**

0 commit comments

Comments
 (0)