@@ -0,0 +1,1649 @@
+package net.imagej.ops.fopd;%0A%0Aimport net.imagej.ops.OpMatchingService;%0Aimport net.imagej.ops.OpService;%0Aimport net.imglib2.RandomAccess;%0Aimport net.imglib2.img.Img;%0Aimport net.imglib2.type.numeric.real.DoubleType;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.scijava.Context;%0Aimport org.scijava.cache.CacheService;%0Aimport org.scijava.plugin.Parameter;%0A%0A/**%0A * %0A * @author Tim-Oliver Buchholz, University of Konstanz%0A *%0A */%0Apublic abstract class AbstractOpTest %7B%0A%0A%09@Parameter%0A%09protected Context context;%0A%0A%09@Parameter%0A%09protected OpService ops;%0A%0A%09@Parameter%0A%09protected OpMatchingService matcher;%0A%0A%09protected Img%3CDoubleType%3E img;%0A%0A%09protected Img%3CDoubleType%3E posNegImg;%0A%0A%09protected Context createContext() %7B%0A%09%09return new Context(OpService.class, OpMatchingService.class, CacheService.class);%0A%09%7D%0A%0A%09@Before%0A%09public void setUp() %7B%0A%09%09createContext().inject(this);%0A%09%09img = ops.create().img(new int%5B%5D %7B 3, 3 %7D);%0A%09%09posNegImg = ops.create().img(new int%5B%5D %7B 3, 3 %7D);%0A%0A%09%09final RandomAccess%3CDoubleType%3E ra = img.randomAccess();%0A%09%09final RandomAccess%3CDoubleType%3E posNegRA = posNegImg.randomAccess();%0A%09%09for (int x = 0; x %3C img.dimension(0); x++) %7B%0A%09%09%09for (int y = 0; y %3C img.dimension(1); y++) %7B%0A%09%09%09%09ra.setPosition(new int%5B%5D %7B x, y %7D);%0A%09%09%09%09if (x %25 2 == 0) %7B%0A%09%09%09%09%09ra.get().set(1.0);%0A%09%09%09%09%7D%0A%09%09%09%09posNegRA.setPosition(ra);%0A%09%09%09%09posNegRA.get().set(ra.get().get() - 0.5);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09ra.setPosition(new int%5B%5D%7B1,1%7D);%0A%09%09ra.get().set(1);%0A%09%09posNegRA.setPosition(new int%5B%5D%7B1, 1%7D);%0A%09%09posNegRA.get().set(1);%0A%09%7D%0A%0A%09@After%0A%09public synchronized void cleanUp() %7B%0A%09%09if (context != null) %7B%0A%09%09%09context.dispose();%0A%09%09%09context = null;%0A%09%09%09ops = null;%0A%09%09%09matcher = null;%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Add AbstractOpTest.