1 package org.apache.maven.index;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Set;
23
24 import org.apache.lucene.search.Query;
25 import org.apache.maven.index.ArtifactInfo;
26 import org.apache.maven.index.FlatSearchRequest;
27 import org.apache.maven.index.FlatSearchResponse;
28 import org.apache.maven.index.NexusIndexer;
29
30
31
32
33
34 public class MinimalIndexNexusIndexerTest
35 extends AbstractRepoNexusIndexerTest
36 {
37 @Override
38 protected void prepareNexusIndexer( NexusIndexer nexusIndexer )
39 throws Exception
40 {
41 context = nexusIndexer.addIndexingContext( "test-minimal", "test", repo, indexDir, null, null, MIN_CREATORS );
42
43 nexusIndexer.scan( context );
44 }
45
46 public void testNEXUS2712()
47 throws Exception
48 {
49 Query q = nexusIndexer.constructQuery( MAVEN.GROUP_ID, "com.adobe.flexunit", SearchType.EXACT );
50
51 FlatSearchResponse response = nexusIndexer.searchFlat( new FlatSearchRequest( q ) );
52
53 Set<ArtifactInfo> r = response.getResults();
54
55 assertEquals( 1, r.size() );
56
57 ArtifactInfo ai = r.iterator().next();
58
59 assertEquals( "com.adobe.flexunit", ai.groupId );
60 assertEquals( "flexunit", ai.artifactId );
61 assertEquals( "0.90", ai.version );
62 assertEquals( null, ai.classifier );
63 assertEquals( "swc", ai.packaging );
64
65 assertEquals( "swc", ai.fextension );
66 }
67 }