List<ArtifactInfo> list = new ArrayList<ArtifactInfo>( response.getResults() );
assertEquals( 2, list.size() );
{
ArtifactInfo ai = list.get( 0 );
assertEquals( "1.6.1", ai.version );
assertEquals( "jar", ai.fextension );
assertEquals( "jar", ai.packaging );
}
{
ArtifactInfo ai = list.get( 1 );
assertEquals( "1.5", ai.version );
assertEquals( "jar", ai.fextension );
assertEquals( "jar", ai.packaging );
}
}
{
Query query = new TermQuery( new Term( ArtifactInfo.PACKAGING, "tar.gz" ) );
FlatSearchResponse response = nexusIndexer.searchFlat( new FlatSearchRequest( query ) );
assertEquals( response.getResults().toString(), 1, response.getTotalHits() );
ArtifactInfo ai = response.getResults().iterator().next();
assertEquals( "tar.gz", ai.packaging );
assertEquals( "tar.gz", ai.fextension );
}
{
Query query = new TermQuery( new Term( ArtifactInfo.PACKAGING, "zip" ) );
FlatSearchResponse response = nexusIndexer.searchFlat( new FlatSearchRequest( query ) );
assertEquals( response.getResults().toString(), 1, response.getTotalHits() );
ArtifactInfo ai = response.getResults().iterator().next();
assertEquals( "zip", ai.packaging );
assertEquals( "zip", ai.fextension );
}
}