File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/test/java/org/scijava Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 4747import org .scijava .plugin .PluginInfo ;
4848import org .scijava .plugin .SciJavaPlugin ;
4949import org .scijava .service .AbstractService ;
50+ import org .scijava .service .SciJavaService ;
5051import org .scijava .service .Service ;
5152import org .scijava .thread .ThreadService ;
5253
@@ -107,6 +108,26 @@ public void testFull() {
107108 verifyServiceOrder (expected , context );
108109 }
109110
111+ /**
112+ * Tests that a new fully populated {@link Context} has exactly the same
113+ * {@link Service}s available as one created with only {@link SciJavaService}
114+ * implementations.
115+ * <p>
116+ * In other words: tests that all {@link Service}s implemented in SciJava
117+ * Common are tagged with the {@link SciJavaService} interface.
118+ * </p>
119+ */
120+ @ Test
121+ public void testSciJavaServices () {
122+ final Context full = new Context ();
123+ final Context sciJava = new Context (SciJavaService .class );
124+ for (final Service s : full .getServiceIndex ()) {
125+ final Class <? extends Service > c = s .getClass ();
126+ final Service sjs = sciJava .getService (c );
127+ if (sjs == null ) fail ("Not a SciJavaService? " + s .getClass ().getName ());
128+ }
129+ }
130+
110131 /**
111132 * Tests that dependent {@link Service}s are automatically created and
112133 * populated in downstream {@link Service} classes.
You can’t perform that action at this time.
0 commit comments