2929
3030package org .scijava .ops .engine .impl ;
3131
32- import java .util .ArrayList ;
33- import java .util .Arrays ;
34- import java .util .Iterator ;
35- import java .util .List ;
36- import java .util .function .Function ;
37-
3832import org .junit .jupiter .api .Assertions ;
3933import org .junit .jupiter .api .BeforeAll ;
4034import org .junit .jupiter .api .Test ;
4135import org .scijava .collections .ObjectArray ;
4236import org .scijava .function .Computers ;
4337import org .scijava .function .Producer ;
44- import org .scijava .ops .api .Hints ;
45- import org .scijava .ops .api .InfoTree ;
46- import org .scijava .ops .api .OpEnvironment ;
47- import org .scijava .ops .api .OpInfo ;
48- import org .scijava .ops .api .RichOp ;
38+ import org .scijava .ops .api .*;
4939import org .scijava .ops .engine .AbstractTestEnvironment ;
5040import org .scijava .ops .engine .BaseOpHints ;
5141import org .scijava .ops .engine .adapt .functional .ComputersToFunctionsViaFunction ;
5545import org .scijava .ops .engine .matcher .simplify .PrimitiveArraySimplifiers ;
5646import org .scijava .ops .engine .matcher .simplify .PrimitiveLossReporters ;
5747import org .scijava .ops .engine .matcher .simplify .PrimitiveSimplifiers ;
58- import org .scijava .ops .spi .Op ;
59- import org .scijava .ops .spi .OpClass ;
60- import org .scijava .ops .spi .OpCollection ;
61- import org .scijava .ops .spi .OpDependency ;
62- import org .scijava .ops .spi .OpField ;
48+ import org .scijava .ops .spi .*;
6349import org .scijava .priority .Priority ;
6450import org .scijava .types .Nil ;
6551
52+ import java .util .ArrayList ;
53+ import java .util .Arrays ;
54+ import java .util .Iterator ;
55+ import java .util .List ;
56+ import java .util .function .Function ;
57+
6658public class ProvenanceTest extends AbstractTestEnvironment implements
6759 OpCollection
6860{
@@ -71,11 +63,11 @@ public class ProvenanceTest extends AbstractTestEnvironment implements
7163 public static void AddNeededOps () {
7264 ops .register (new ProvenanceTest ());
7365 ops .register (new MapperFunc ());
74- ops .register (new FunctionToArrays ());
66+ ops .register (new FunctionToArrays <> ());
7567 ops .register (new PrimitiveSimplifiers ());
76- ops .register (new PrimitiveArraySimplifiers ());
68+ ops .register (new PrimitiveArraySimplifiers <> ());
7769 ops .register (new PrimitiveLossReporters ());
78- ops .register (new CopyOpCollection ());
70+ ops .register (new CopyOpCollection <> ());
7971 ops .register (new CreateOpCollection ());
8072 Object [] adaptors = objsFromNoArgConstructors (
8173 ComputersToFunctionsViaFunction .class .getDeclaredClasses ());
@@ -151,7 +143,7 @@ public void testProvenance() {
151143 List <RichOp <?>> executionsUpon = ops .history ().executionsUpon (s );
152144 Assertions .assertEquals (1 , executionsUpon .size ());
153145 // Assert only one info in the execution hierarchy
154- InfoTree executionHierarchy = ops . history () .infoTree (executionsUpon .get (0 ));
146+ InfoTree executionHierarchy = Ops .infoTree (executionsUpon .get (0 ));
155147 Assertions .assertEquals (0 , executionHierarchy .dependencies ().size ());
156148 OpInfo info = executionHierarchy .info ();
157149 Assertions .assertTrue (info .implementationName ().contains (this .getClass ()
@@ -180,15 +172,15 @@ public void testPriorityProvenance() {
180172 List <RichOp <?>> history2 = ops .history ().executionsUpon (out2 );
181173
182174 Assertions .assertEquals (1 , history1 .size ());
183- InfoTree opExecutionChain = ops . history () .infoTree (history1 .get (0 ));
175+ InfoTree opExecutionChain = Ops .infoTree (history1 .get (0 ));
184176 Assertions .assertEquals (0 , opExecutionChain .dependencies ().size ());
185177 String expected =
186178 "public final java.util.function.Function org.scijava.ops.engine.impl.ProvenanceTest.baz" ;
187179 Assertions .assertEquals (expected , opExecutionChain .info ()
188180 .getAnnotationBearer ().toString ());
189181
190182 Assertions .assertEquals (1 , history2 .size ());
191- opExecutionChain = ops . history () .infoTree (history2 .get (0 ));
183+ opExecutionChain = Ops .infoTree (history2 .get (0 ));
192184 Assertions .assertEquals (0 , opExecutionChain .dependencies ().size ());
193185 expected =
194186 "public final java.util.function.Function org.scijava.ops.engine.impl.ProvenanceTest.bar" ;
@@ -221,7 +213,7 @@ public void testMappingInfoTree() {
221213 .input (array ).outType (Thing .class ).function ();
222214
223215 // Get the InfoTree associated with the above call
224- InfoTree tree = ops . history () .infoTree (mapper );
216+ InfoTree tree = Ops .infoTree (mapper );
225217
226218 // Assert the mapper is in the tree
227219 Iterator <OpInfo > mapperInfos = ops .infos ("test.provenanceMapper" )
@@ -275,7 +267,7 @@ public void testDependencylessOpRecoveryFromString() {
275267 .outType (Thing .class ) //
276268 .function ();
277269 // Get the signature from the Op
278- String signature = ops . history (). signatureOf (mapper );
270+ String signature = Ops . signature (mapper );
279271 // Generate the Op from the signature and an Op type
280272 Nil <Function <Double , Thing >> specialType = new Nil <>() {};
281273 Function <Double , Thing > actual = ops //
@@ -298,7 +290,7 @@ public void testOpWithDependencyRecoveryFromString() {
298290 .outType (Thing .class ) //
299291 .function ();
300292 // Get the signature from the Op
301- String signature = ops . history (). signatureOf (mapper );
293+ String signature = Ops . signature (mapper );
302294 // Generate the Op from the signature and an Op type
303295 Nil <Function <Double , Thing >> specialType = new Nil <>() {};
304296 Function <Double , Thing > actual = ops //
@@ -321,7 +313,7 @@ public void testAdaptationRecoveryFromString() {
321313 .outType (Thing [].class ) //
322314 .function ();
323315 // Get the signature from the Op
324- String signature = ops . history (). signatureOf (f );
316+ String signature = Ops . signature (f );
325317 // Generate the Op from the signature and an Op type
326318 Nil <Function <Double [], Thing []>> special = new Nil <>() {};
327319 Function <Double [], Thing []> actual = ops . //
@@ -344,7 +336,7 @@ public void testAdaptedOpWithDependencies() {
344336 .outType (Thing [].class ) //
345337 .function ();
346338 // Get the signature from the Op
347- String signature = ops . history (). signatureOf (f );
339+ String signature = Ops . signature (f );
348340 // Generate the Op from the signature and an Op type
349341 Nil <Function <Double [][], Thing []>> special = new Nil <>() {};
350342 Function <Double [][], Thing []> actual = ops //
@@ -369,7 +361,7 @@ public void testSimplificationRecovery() {
369361 {}) //
370362 .computer ();
371363 // Get the signature from the Op
372- String signature = ops . history (). signatureOf (c );
364+ String signature = Ops . signature (c );
373365 // Generate the Op from the signature and an Op type
374366 Nil <Computers .Arity1 <ObjectArray <Number >, ObjectArray <Number >>> special =
375367 new Nil <>()
@@ -401,7 +393,7 @@ public void testFocusedRecovery() {
401393 .outType (Integer [].class ) //
402394 .computer ();
403395 // Get the signature from the Op
404- String signature = ops . history (). signatureOf (c );
396+ String signature = Ops . signature (c );
405397 // Generate the Op from the signature and an Op typ
406398 Nil <Computers .Arity1 <Integer [], Integer []>> special = new Nil <>() {};
407399 Computers .Arity1 <Integer [], Integer []> fromString = ops .opFromSignature (
@@ -428,7 +420,7 @@ public void testSimplificationAdaptationRecovery() {
428420 .outType (Integer [].class ) //
429421 .function ();
430422 // Get the signature from the Op
431- String signature = ops . history (). signatureOf (c );
423+ String signature = Ops . signature (c );
432424 // Generate the Op from the signature and the Op type
433425 Nil <Function <Integer [], Integer []>> special = new Nil <>() {};
434426 Function <Integer [], Integer []> fromString = ops //
@@ -456,7 +448,7 @@ public void testAdaptationWithDependencies() {
456448 .outType (Double [].class ) //
457449 .function ();
458450 // Get the signature from the Op
459- String signature = ops . history (). signatureOf (f );
451+ String signature = Ops . signature (f );
460452 // Generate the Op from the signature and the Op type
461453 Nil <Function <Double [], Double []>> special = new Nil <>() {};
462454 Function <Double [], Double []> actual = ops //
0 commit comments