Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Fixed test that relied on presence of pom.xml file.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwardgar committed Feb 10, 2016
1 parent 3631ee2 commit 4d5a48c
Showing 1 changed file with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@
package thredds.crawlabledataset;

import org.junit.Test;
import static org.junit.Assert.*;

import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

/**
* A description
Expand All @@ -48,18 +53,13 @@
*/
public class TestCrawlableDataset
{

@Test
public void testEmptyPath()
{
String path = "";

CrawlableDataset crDs = checkCrDs( path, path);
if ( crDs.exists() )
{
assertTrue( "Unexpected exist()==true for CrDs(\"\").",
false);
}
assertFalse("Unexpected exist()==true for CrDs(\"\").", crDs.exists());
}

@Test
Expand All @@ -69,23 +69,17 @@ public void testRootPath()
String name = "";

CrawlableDataset crDs = checkCrDs( path, name );
if ( ! crDs.exists() )
{
assertTrue( "CrDs(\"/\") doesn't exist.",
false );
}

assertTrue("CrDs(\"/\") doesn't exist.", crDs.exists());
}

@Test
public void testDotPath()
{
String path = ".";
String name = ".";
List results = new ArrayList();
results.add( "pom.xml" );
public void testResourcePath() throws URISyntaxException {
File iospResourcesDir = new File(getClass().getResource("/resources/nj22/iosp").toURI());
String path = iospResourcesDir.getAbsolutePath();
String name = iospResourcesDir.getName();
List<String> expectedChildrenNames = Arrays.asList("ghcnm.ncml", "igra-monthly.ncml", "igra-por.ncml");

checkCrDsChildren( path, name, results );
checkCrDsChildren(path, name, expectedChildrenNames);
}

// ToDo Get test working with manufactured directory.
Expand Down

0 comments on commit 4d5a48c

Please sign in to comment.