Commit 8d4db124 authored by Evan Ward's avatar Evan Ward

Fix occasional test failure in NetworkCrawlerTest

Previously if DataProvidersManagerTest ran before NetworkCrawlerTest it would
set data filters (which are static) that would interfere with
NetworkCrawlerTest. Now both tests clear filters.
parent 097e536a
...@@ -27,6 +27,7 @@ import java.util.regex.Matcher; ...@@ -27,6 +27,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.hipparchus.exception.DummyLocalizable; import org.hipparchus.exception.DummyLocalizable;
import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.orekit.Utils; import org.orekit.Utils;
...@@ -34,6 +35,12 @@ import org.orekit.errors.OrekitException; ...@@ -34,6 +35,12 @@ import org.orekit.errors.OrekitException;
public class DataProvidersManagerTest { public class DataProvidersManagerTest {
@After
public void tearDown() {
// clear the filters so they don't change other tests
DataProvidersManager.getInstance().clearFilters();
}
@Test @Test
public void testDefaultConfiguration() { public void testDefaultConfiguration() {
System.setProperty(DataProvidersManager.OREKIT_DATA_PATH, getPath("regular-data")); System.setProperty(DataProvidersManager.OREKIT_DATA_PATH, getPath("regular-data"));
......
...@@ -27,10 +27,17 @@ import java.util.regex.Pattern; ...@@ -27,10 +27,17 @@ import java.util.regex.Pattern;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.Before;
import org.orekit.errors.OrekitException; import org.orekit.errors.OrekitException;
public class NetworkCrawlerTest { public class NetworkCrawlerTest {
@Before
public void setUp() {
// Clear any filters that another test may have left
DataProvidersManager.getInstance().clearFilters();
}
@Test(expected=OrekitException.class) @Test(expected=OrekitException.class)
public void noElement() throws MalformedURLException { public void noElement() throws MalformedURLException {
File existing = new File(url("regular-data").getPath()); File existing = new File(url("regular-data").getPath());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment