Skip to content

Commit 2ceaf97

Browse files
committed
Adapt TableIOServiceTest
Using PluginInfo.create available in scijava-common 2.81.0, we can avoid having the FakeTableIOPlugin test class visible in all tests.
1 parent 5979e59 commit 2ceaf97

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100
<license.copyrightOwners>Board of Regents of the University of
101101
Wisconsin-Madison, and Friedrich Miescher Institute for Biomedical Research.</license.copyrightOwners>
102102

103+
<scijava-common.version>2.81.0</scijava-common.version>
104+
103105
<!-- NB: Deploy releases to the SciJava Maven repository. -->
104106
<releaseProfiles>deploy-to-scijava</releaseProfiles>
105107
</properties>

src/test/java/org/scijava/table/FakeTableIOPlugin.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@
3030
package org.scijava.table;
3131

3232
import org.scijava.io.AbstractIOPlugin;
33-
import org.scijava.io.IOPlugin;
34-
import org.scijava.plugin.Plugin;
3533

3634
@SuppressWarnings("rawtypes")
37-
@Plugin(type = IOPlugin.class)
3835
public class FakeTableIOPlugin extends AbstractIOPlugin<Table> {
3936

4037
@Override

src/test/java/org/scijava/table/TableIOServiceTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,23 @@
3939
import org.junit.Before;
4040
import org.junit.Test;
4141
import org.scijava.Context;
42+
import org.scijava.io.IOPlugin;
43+
import org.scijava.plugin.PluginInfo;
44+
import org.scijava.plugin.PluginService;
4245
import org.scijava.table.io.DefaultTableIOService;
4346
import org.scijava.table.io.TableIOService;
4447

4548
public class TableIOServiceTest {
4649

4750
private Context context;
4851

52+
@SuppressWarnings("rawtypes")
4953
@Before
5054
public void setUp() {
5155
context = new Context();
56+
PluginInfo<IOPlugin> info = PluginInfo.create(FakeTableIOPlugin.class,
57+
IOPlugin.class);
58+
context.service(PluginService.class).addPlugin(info);
5259
}
5360

5461
@After

0 commit comments

Comments
 (0)