Revision: 19634 http://sourceforge.net/p/gate/code/19634 Author: markagreenwood Date: 2016-10-05 09:08:51 +0000 (Wed, 05 Oct 2016) Log Message: ----------- make sure GATE is inited you total numpty!
Modified Paths: -------------- gate/branches/sawdust2/gate-core/src/test/java/gate/xml/TestRepositioningInfo.java Modified: gate/branches/sawdust2/gate-core/src/test/java/gate/xml/TestRepositioningInfo.java =================================================================== --- gate/branches/sawdust2/gate-core/src/test/java/gate/xml/TestRepositioningInfo.java 2016-10-05 08:44:04 UTC (rev 19633) +++ gate/branches/sawdust2/gate-core/src/test/java/gate/xml/TestRepositioningInfo.java 2016-10-05 09:08:51 UTC (rev 19634) @@ -1,5 +1,22 @@ package gate.xml; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.net.MalformedURLException; +import java.net.URL; + +import gate.Document; +import gate.Factory; +import gate.FeatureMap; +import gate.Gate; +import gate.corpora.DocumentImpl; +import gate.corpora.TestDocument; +import gate.creole.ResourceInstantiationException; +import gate.util.BomStrippingInputStreamReader; + /** * <p>Title: TestRepositioningInfo.java </p> * <p>Description: Test to check if RepositioningInfo works. </p> @@ -7,16 +24,8 @@ * @author Niraj Aswani * @version 1.0 */ +import junit.framework.TestCase; -import junit.framework.*; -import gate.*; -import gate.creole.*; -import gate.corpora.*; -import gate.util.BomStrippingInputStreamReader; - -import java.net.*; -import java.io.*; - /** * This class tests if Repositinioning Information works. * It creates a document using an inline xml file with preserveOriginalContent @@ -29,18 +38,18 @@ */ public class TestRepositioningInfo extends TestCase { - - /** Constructor */ - public TestRepositioningInfo(String dummy) { - super(dummy); - } - + /** * This method sets up the parameters for the files to be tested */ @Override - protected void setUp() { + protected void setUp() throws Exception { + if (!Gate.isInitialised()) { + Gate.runInSandbox(true); + Gate.init(); + } + testFile = TestDocument.getTestServerName() + "tests/test-inline.xml"; // creating documents @@ -103,12 +112,7 @@ } } - /** Test suite routine for the test runner */ - public static Test suite() { - return new TestSuite(TestRepositioningInfo.class); - } // suite - /** A test file URL */ private String testFile = ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ GATE-cvs mailing list GATE-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gate-cvs