Search in sources :

Example 11 with Module

use of org.scijava.module.Module in project imagej-ops by imagej.

the class OpServiceTest method testModuleByOp.

/**
 * Tests {@link OpService#module(Op, Object...)}.
 */
@Test
public void testModuleByOp() {
    final DoubleType value = new DoubleType(123.456);
    final Module module = ops.module(new InfinityOp(), value);
    assertSame(InfinityOp.class, module.getDelegateObject().getClass());
    assertSame(value, module.getInput("arg"));
    assertFalse(Double.isInfinite(value.get()));
    module.run();
    assertTrue(Double.isInfinite(value.get()));
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) Module(org.scijava.module.Module) Test(org.junit.Test)

Example 12 with Module

use of org.scijava.module.Module in project imagej-ops by imagej.

the class OpServiceTest method testModuleByType.

/**
 * Tests {@link OpService#module(Class, Object...)}.
 */
@Test
public void testModuleByType() {
    final DoubleType value = new DoubleType(123.456);
    final Module module = ops.module(InfinityOp.class, value);
    assertSame(value, module.getInput("arg"));
    assertFalse(Double.isInfinite(value.get()));
    module.run();
    assertTrue(Double.isInfinite(value.get()));
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) Module(org.scijava.module.Module) Test(org.junit.Test)

Aggregations

Module (org.scijava.module.Module)12 Test (org.junit.Test)5 DoubleType (net.imglib2.type.numeric.real.DoubleType)4 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TableData (omero.gateway.model.TableData)1 CommandInfo (org.scijava.command.CommandInfo)1 ModuleRunner (org.scijava.module.ModuleRunner)1 PreprocessorPlugin (org.scijava.module.process.PreprocessorPlugin)1