File tree Expand file tree Collapse file tree
src/test/java/org/scijava/persist Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 11package org .scijava .persist ;
22
33import com .google .gson .Gson ;
4- import net .imagej .ImageJ ;
54import org .junit .After ;
65import org .junit .Assert ;
76import org .junit .Before ;
87import org .junit .Test ;
8+ import org .scijava .Context ;
99import org .scijava .persist .testobjects .Circle ;
1010import org .scijava .persist .testobjects .Shape ;
1111import org .scijava .persist .testobjects .Shapes ;
1212
1313public 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 /**
You can’t perform that action at this time.
0 commit comments