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()));
}
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()));
}
Aggregations