Skip to content

Instantly share code, notes, and snippets.

@kinow
Last active August 29, 2015 14:19
Show Gist options
  • Save kinow/a7c1f3af857830d4dffc to your computer and use it in GitHub Desktop.
Save kinow/a7c1f3af857830d4dffc to your computer and use it in GitHub Desktop.
Jena tests
package com.hp.hpl.jena.rdf.model.test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class ASimpleTestCase extends TestCase {
public ASimpleTestCase() {
super("testAnything");
}
public static TestSuite suite() {
ASimpleTestCase test = new ASimpleTestCase();
TestSuite ts = new TestSuite();
ts.addTest(test);
return ts;
}
public void testAnything() {
System.out.println("Hello!");
}
}
package com.hp.hpl.jena.rdf.model.test;
import org.junit.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class ASimpleTestCase extends TestCase {
public ASimpleTestCase() {
super("testAnything");
}
public static TestSuite suite() {
ASimpleTestCase test = new ASimpleTestCase();
TestSuite ts = new TestSuite();
ts.addTest(test);
return ts;
}
// Step 1 add JUnit4 annotation
@Test
public void testAnything() {
System.out.println("Hello!");
}
}
package com.hp.hpl.jena.rdf.model.test;
import org.junit.Test;
// Step 2 remove imports and test suite
public class ASimpleTestCase {
// Step 1 add JUnit4 annotation
@Test
public void testAnything() {
System.out.println("Hello!");
}
}
package com.hp.hpl.jena.graph.test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import com.hp.hpl.jena.rdf.model.test.ASimpleTestCase;
// Step 3 move test suite to an external file
@RunWith(Suite.class)
@SuiteClasses(ASimpleTestCase.class)
public class TS_ASimpleTestCase {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment