Skip to content

Commit

Permalink
Moved fields to top of classes
Browse files Browse the repository at this point in the history
  • Loading branch information
qsiebers committed Aug 25, 2017
1 parent c78c547 commit e20fe3e
Show file tree
Hide file tree
Showing 34 changed files with 109 additions and 107 deletions.
Expand Up @@ -50,15 +50,15 @@ public class ChangelogTestCase {

private final static String testdataDirectory = "db2tm";

private String base;
private String casename;

@Parameters
public static List<String[]> generateTests() throws IOException {
TestFileUtils.transferTestInputDirectory(testdataDirectory + "/in/sync");
return TestFileUtils.getTestInputFiles(testdataDirectory, "in/sync", ".xml");
}

private String base;
private String casename;

public ChangelogTestCase(String root, String xmlfile) {
this.casename = xmlfile.substring(0, xmlfile.length() - 4);
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -42,6 +42,9 @@ public class DB2TMGeneralTestCase {

private final static String testdataDirectory = "db2tm";

private String base;
private String filename;

/**
* @return The test cases generated by this.
*/
Expand All @@ -53,9 +56,6 @@ public static List<String[]> generateTests() throws IOException {

// --- Test case class

private String base;
private String filename;

public DB2TMGeneralTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -44,6 +44,9 @@ public class DB2TMRescanTestCase {

private final static String testdataDirectory = "db2tm";

private String base;
private String filename;

/**
* @return The test cases generated by this.
*/
Expand All @@ -55,9 +58,6 @@ public static List<String[]> generateTests() throws IOException {

// --- Test case class

private String base;
private String filename;

public DB2TMRescanTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -41,6 +41,14 @@

public class QueryProcessorTest extends AbstractQueryTest {

/// constants for various options

private static final String HIERARCHY_WALKER_ON =
"/* #OPTION: optimizer.hierarchy-walker = true */ ";

private static final String HIERARCHY_WALKER_OFF =
"/* #OPTION: optimizer.hierarchy-walker = false */ ";

public QueryProcessorTest(String name) {
super(name);
}
Expand All @@ -57,14 +65,6 @@ public void tearDown() {
closeStore();
}

/// constants for various options

private static final String HIERARCHY_WALKER_ON =
"/* #OPTION: optimizer.hierarchy-walker = true */ ";

private static final String HIERARCHY_WALKER_OFF =
"/* #OPTION: optimizer.hierarchy-walker = false */ ";

/// empty topic map

public void testEmptyDirectInstanceOfAB() throws InvalidQueryException {
Expand Down
Expand Up @@ -30,6 +30,9 @@
import net.ontopia.topicmaps.impl.basic.InMemoryTopicMapStore;

public class AssociationWalkerTest extends AbstractUtilsTestCase {
protected TopicIF bart, homer, marge, gramps, lisa, maggie;
protected TopicIF at_descendant_of, rt_ancestor, rt_descendant;

public AssociationWalkerTest(String name) {
super(name);
}
Expand Down Expand Up @@ -58,9 +61,6 @@ public void testSimpleWalker() {

}

protected TopicIF bart, homer, marge, gramps, lisa, maggie;
protected TopicIF at_descendant_of, rt_ancestor, rt_descendant;

@Override
public void setUp() {
TopicMapStoreIF store = new InMemoryTopicMapStore();
Expand Down
Expand Up @@ -38,13 +38,13 @@ public class DeletionUtilsTopicMapTest {

private final static String testdataDirectory = "canonical";

private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".ltm|.xtm");
}

private String filename;

public DeletionUtilsTopicMapTest(String root, String filename) {
this.filename = filename;
}
Expand Down
Expand Up @@ -38,16 +38,16 @@ public class MergeTMTestCase {

private final static String testdataDirectory = "merge";

protected String base;
protected String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".xtm");
}

// --- Test case class

protected String base;
protected String filename;

public MergeTMTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -39,16 +39,16 @@ public class MergeToXTMTestCase {

private final static String testdataDirectory = "merge";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".xtm");
}

// --- Test case class

private String base;
private String filename;

public MergeToXTMTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -39,17 +39,15 @@ public class TopicMapSynchronizerTests {

private final static String testdataDirectory = "tmsync";

private String base;
private String root;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", "-target.ltm");
}

// --- Test case class

private String base;
private String root;
private String filename;

public TopicMapSynchronizerTests(String root, String filename) {
this.root = root;
this.filename = filename;
Expand Down
Expand Up @@ -36,13 +36,13 @@ public class CTMInvalidTestCase {

private final static String testdataDirectory = "ctm";

private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "invalid", ".ctm");
}

private String filename;

public CTMInvalidTestCase(String root, String filename) {
this.filename = filename;
}
Expand Down
Expand Up @@ -37,14 +37,14 @@ public class JTMTestCase {

private final static String testdataDirectory = "jtm";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".jtm");
}

private String base;
private String filename;

public JTMTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -34,13 +34,13 @@ public class LTMErrorTestCase {

private final static String testdataDirectory = "ltm";

private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "error", ".ltm");
}

private String filename;

public LTMErrorTestCase(String root, String filename) {
this.filename = filename;
}
Expand Down
Expand Up @@ -36,6 +36,11 @@
@RunWith(Parameterized.class)
public class LTMTestCase {

private final static String testdataDirectory = "ltm";

private String base;
private String filename;

/**
* @return true iff the test-case in fileName was added to test features
* after LTM1.3 was implemented.
Expand All @@ -45,16 +50,11 @@ public static boolean ltm13(String fileName) {
return false;
}

private final static String testdataDirectory = "ltm";

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".ltm");
}

private String base;
private String filename;

public LTMTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -39,6 +39,9 @@ public class LTMTopicMapWriterFilterTestCase {

private final static String testdataDirectory = "ltmWriter";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "filter-in", ".ltm|.rdf|.xtm");
Expand All @@ -53,8 +56,6 @@ public static List generateTests() {
* 'filter-baseline'. The baseline must be created manually, or by inspecting
* the file in 'filter-out'.
*/
private String base;
private String filename;

public LTMTopicMapWriterFilterTestCase(String root, String filename) {
this.filename = filename;
Expand Down
Expand Up @@ -38,16 +38,16 @@ public class LTMTopicMapWriterGeneralTestCase {

private final static String testdataDirectory = "ltmWriter";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".ltm|.rdf|.xtm");
}

// --- Test case class

private String base;
private String filename;

public LTMTopicMapWriterGeneralTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -38,6 +38,9 @@ public class LTMTopicMapWriterSpecialTestCase {

private final static String testdataDirectory = "ltmWriter";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "x-in", ".ltm|.rdf|.xtm");
Expand All @@ -51,9 +54,6 @@ public static List generateTests() {
* 'x-out' with a baseline file in 'x-baseline'. The baseline must be created
* manually, or by inspecting the file in 'out'.
*/
private String base;
private String filename;

public LTMTopicMapWriterSpecialTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -40,6 +40,11 @@
@RunWith(Parameterized.class)
public abstract class AbstractCanonicalExporterTests {

protected String base;
protected URL inputFile;
protected String filename;
protected String _testdataDirectory;

// --- Canonicalization type methods

/**
Expand Down Expand Up @@ -88,11 +93,6 @@ protected TopicMapStoreFactoryIF getStoreFactory() {

// --- Test case class

protected String base;
protected URL inputFile;
protected String filename;
protected String _testdataDirectory;

@Test
public void testExport() throws IOException {
TestFileUtils.verifyDirectory(base, "out");
Expand Down
Expand Up @@ -38,16 +38,16 @@ public class CanonicalXTM21WriterTestCase {

private final static String testdataDirectory = "xtm21";

protected String base;
protected String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".xtm");
}

// --- Test case class

protected String base;
protected String filename;

public CanonicalXTM21WriterTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down
Expand Up @@ -38,16 +38,16 @@ public class CanonicalXTM2WriterTestCase {

private final static String testdataDirectory = "xtm2";

private String base;
private String filename;

@Parameters
public static List generateTests() {
return TestFileUtils.getTestInputFiles(testdataDirectory, "in", ".xtm");
}

// --- Test case class

private String base;
private String filename;

public CanonicalXTM2WriterTestCase(String root, String filename) {
this.filename = filename;
this.base = TestFileUtils.getTestdataOutputDirectory() + testdataDirectory;
Expand Down

0 comments on commit e20fe3e

Please sign in to comment.