Skip to content

Commit

Permalink
Fix occasional test failure in NetworkCrawlerTest
Browse files Browse the repository at this point in the history
Previously if DataProvidersManagerTest ran before NetworkCrawlerTest it would
set data filters (which are static) that would interfere with
NetworkCrawlerTest. Now both tests clear filters.
  • Loading branch information
wardev committed Jan 22, 2019
1 parent 097e536 commit 8d4db12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/java/org/orekit/data/DataProvidersManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,20 @@
import java.util.regex.Pattern;

import org.hipparchus.exception.DummyLocalizable;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.orekit.Utils;
import org.orekit.errors.OrekitException;

public class DataProvidersManagerTest {

@After
public void tearDown() {
// clear the filters so they don't change other tests
DataProvidersManager.getInstance().clearFilters();
}

@Test
public void testDefaultConfiguration() {
System.setProperty(DataProvidersManager.OREKIT_DATA_PATH, getPath("regular-data"));
Expand Down
7 changes: 7 additions & 0 deletions src/test/java/org/orekit/data/NetworkCrawlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@

import org.junit.Assert;
import org.junit.Test;
import org.junit.Before;
import org.orekit.errors.OrekitException;

public class NetworkCrawlerTest {

@Before
public void setUp() {
// Clear any filters that another test may have left
DataProvidersManager.getInstance().clearFilters();
}

@Test(expected=OrekitException.class)
public void noElement() throws MalformedURLException {
File existing = new File(url("regular-data").getPath());
Expand Down

0 comments on commit 8d4db12

Please sign in to comment.