1 17 18 package org.apache.avalon.repository; 19 20 21 import junit.framework.TestCase; 22 23 24 30 public class ArtifactURLTest extends TestCase 31 { 32 36 public ArtifactURLTest( String name ) 37 { 38 super( name ); 39 } 40 41 public void testArtifactURLGroup() throws Exception 42 { 43 Artifact artifact = 44 Artifact.createArtifact( "artifact:peter/rabbit" ); 45 assertTrue( "peter".equals( artifact.getGroup() ) ); 46 } 47 48 public void testArtifactURLCompositeGroup() throws Exception 49 { 50 Artifact artifact = 51 Artifact.createArtifact( "artifact:the/peter/rabbit" ); 52 assertTrue( "the/peter".equals( artifact.getGroup() ) ); 53 } 54 55 public void testArtifactURLName() throws Exception 56 { 57 Artifact artifact = 58 Artifact.createArtifact( "artifact:peter/rabbit" ); 59 assertTrue( "rabbit".equals( artifact.getName() ) ); 60 } 61 62 public void testArtifactURLType() throws Exception 63 { 64 Artifact artifact = 65 Artifact.createArtifact( "artifact:peter/rabbit" ); 66 assertTrue( "jar".equals( artifact.getType() ) ); 67 } 68 69 public void testArtifactURLNullVersion() throws Exception 70 { 71 Artifact artifact = 72 Artifact.createArtifact( "artifact:peter/rabbit" ); 73 assertNull( artifact.getVersion() ); 74 } 75 76 public void testArtifactRefVersionURL() throws Exception 77 { 78 Artifact artifact = 79 Artifact.createArtifact( "artifact:peter/rabbit#1.1" ); 80 assertTrue( "1.1".equals( artifact.getVersion() ) ); 81 } 82 83 } 84 | Popular Tags |