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.io.File;
23 import java.util.Collection;
24
25
26 public class Nexus3233NexusIndexerTest
27 extends AbstractNexusIndexerTest
28 {
29 protected File repo = new File( getBasedir(), "src/test/nexus-3233" );
30
31 @Override
32 protected void prepareNexusIndexer( NexusIndexer nexusIndexer )
33 throws Exception
34 {
35 context =
36 nexusIndexer.addIndexingContext( "nexus-3233", "nexus-3233", repo, indexDir, null, null, FULL_CREATORS );
37 nexusIndexer.scan( context );
38 }
39
40 public void testIdentifyPomPackagingArtifacts()
41 throws Exception
42 {
43
44 Collection<ArtifactInfo> ais = nexusIndexer.identify( MAVEN.SHA1, "741ea3998e6db3ce202d8b88aa53889543f050cc" );
45
46 assertEquals( 1, ais.size() );
47
48 ArtifactInfo ai = ais.iterator().next();
49
50 assertNotNull( ai );
51
52 assertEquals( "cisco.infra.dft", ai.groupId );
53
54 assertEquals( "dma.maven.plugins", ai.artifactId );
55
56 assertEquals( "1.0-SNAPSHOT", ai.version );
57
58
59 ais = nexusIndexer.identify( MAVEN.SHA1, "efb52d4ef65452b4e575fc2e7709595915775857" );
60
61 assertEquals( 1, ais.size() );
62
63 ai = ais.iterator().next();
64
65 assertNotNull( ai );
66
67 assertEquals( "cisco.infra.dft", ai.groupId );
68
69 assertEquals( "parent.pom", ai.artifactId );
70
71 assertEquals( "1.0-SNAPSHOT", ai.version );
72 }
73 }