Skip to content

Commit

Permalink
added disabled test that shows issue with text search when specifying…
Browse files Browse the repository at this point in the history
… a packaging/classifier kind
  • Loading branch information
jstrachan committed Mar 26, 2013
1 parent f1f4897 commit 4343f45
Showing 1 changed file with 22 additions and 1 deletion.
Expand Up @@ -19,9 +19,11 @@

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.List;

import static org.junit.Assert.assertTrue;
Expand All @@ -40,7 +42,7 @@ public static File targetDir() {
public static void init() throws Exception {
indexer = new MavenIndexerFacade();
indexer.setCacheDirectory(new File(targetDir(), "mavenIndexer"));
indexer.startAndWait();
indexer.start();
}

@AfterClass
Expand Down Expand Up @@ -121,5 +123,24 @@ public void testFindTestSearch() throws Exception {
}
}

@Ignore
public void testFindTestSearchAndPackaging() throws Exception {
assertSearchAndPackaging("activemq", "xsd", null);
assertSearchAndPackaging("camel", null, "maven-archetype");
assertSearchAndPackaging("camel", "xml", "features");
}

protected void assertSearchAndPackaging(String searchText, String packaging, String classifier) throws IOException {
System.out.println("Searching for text '" + searchText + "' packaging " + packaging + " classifier " + classifier);
List<ArtifactDTO> resultsNoText = indexer.searchTextAndPackaging(null, packaging, classifier);
List<ArtifactDTO> results = indexer.searchTextAndPackaging(searchText, packaging, classifier);
for (ArtifactDTO result : results) {
System.out.println("Found " + result);
}

assertTrue("Expect that the text '" + searchText + "' restricts the results but found " + results.size() + " when with no text we found " + resultsNoText.size(), resultsNoText.size() > results.size());
assertTrue("Should have found at last one result!", results.size() > 0);
}


}

0 comments on commit 4343f45

Please sign in to comment.