1 package org.apache.archiva.metadata.repository.storage.maven2;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.metadata.model.ArtifactMetadata;
23 import org.apache.archiva.metadata.model.Dependency;
24 import org.apache.archiva.metadata.model.FacetedMetadata;
25 import org.apache.archiva.metadata.model.License;
26 import org.apache.archiva.metadata.model.MailingList;
27 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
28 import org.apache.archiva.metadata.repository.MetadataRepository;
29 import org.apache.archiva.metadata.repository.MetadataResolutionException;
30 import org.apache.archiva.metadata.repository.filter.ExcludesFilter;
31 import org.apache.archiva.metadata.repository.storage.StorageMetadataResolver;
32 import org.apache.archiva.reports.RepositoryProblemFacet;
33 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
34 import org.apache.maven.archiva.configuration.Configuration;
35 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
36 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
38 import java.util.ArrayList;
39 import java.util.Arrays;
40 import java.util.Collection;
41 import java.util.Collections;
42 import java.util.Comparator;
43 import java.util.List;
45 public class Maven2RepositoryMetadataResolverTest
46 extends PlexusInSpringTestCase
48 private Maven2RepositoryMetadataResolver resolver;
50 private static final String TEST_REPO_ID = "test";
52 private static final String ASF_SCM_CONN_BASE = "scm:svn:http://svn.apache.org/repos/asf/";
54 private static final String ASF_SCM_DEV_CONN_BASE = "scm:svn:https://svn.apache.org/repos/asf/";
56 private static final String ASF_SCM_VIEWVC_BASE = "http://svn.apache.org/viewvc/";
58 private static final String EMPTY_MD5 = "d41d8cd98f00b204e9800998ecf8427e";
60 private static final String EMPTY_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709";
62 private MetadataRepository metadataRepository;
69 ArchivaConfiguration configuration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
70 Configuration c = new Configuration();
71 ManagedRepositoryConfiguration testRepo = new ManagedRepositoryConfiguration();
72 testRepo.setId( TEST_REPO_ID );
73 testRepo.setLocation( getTestPath( "src/test/repositories/test" ) );
74 c.addManagedRepository( testRepo );
75 configuration.save( c );
77 resolver = (Maven2RepositoryMetadataResolver) lookup( StorageMetadataResolver.class, "maven2" );
78 metadataRepository = (MetadataRepository) lookup( MetadataRepository.class );
79 metadataRepository.removeMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID );
82 public void testGetProjectVersionMetadata()
85 ProjectVersionMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "org.apache.archiva",
86 "archiva-common", "1.2.1" );
87 MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
88 assertEquals( "jar", facet.getPackaging() );
89 assertEquals( "http://archiva.apache.org/ref/1.2.1/archiva-base/archiva-common", metadata.getUrl() );
90 assertEquals( "org.apache.archiva", facet.getParent().getGroupId() );
91 assertEquals( "archiva-base", facet.getParent().getArtifactId() );
92 assertEquals( "1.2.1", facet.getParent().getVersion() );
93 assertEquals( "archiva-common", facet.getArtifactId() );
94 assertEquals( "org.apache.archiva", facet.getGroupId() );
95 assertEquals( "continuum", metadata.getCiManagement().getSystem() );
96 assertEquals( "http://vmbuild.apache.org/continuum", metadata.getCiManagement().getUrl() );
97 assertNotNull( metadata.getDescription() );
98 // TODO: this would be better
100 // "Archiva is an application for managing one or more remote repositories, including administration, artifact handling, browsing and searching.",
101 // metadata.getDescription() );
102 assertEquals( "1.2.1", metadata.getId() );
103 assertEquals( "jira", metadata.getIssueManagement().getSystem() );
104 assertEquals( "http://jira.codehaus.org/browse/MRM", metadata.getIssueManagement().getUrl() );
105 checkApacheLicense( metadata );
106 assertEquals( "Archiva Base :: Common", metadata.getName() );
107 String path = "archiva/tags/archiva-1.2.1/archiva-modules/archiva-base/archiva-common";
108 assertEquals( ASF_SCM_CONN_BASE + path, metadata.getScm().getConnection() );
109 assertEquals( ASF_SCM_DEV_CONN_BASE + path, metadata.getScm().getDeveloperConnection() );
110 assertEquals( ASF_SCM_VIEWVC_BASE + path, metadata.getScm().getUrl() );
111 checkOrganizationApache( metadata );
113 assertEquals( 4, metadata.getMailingLists().size() );
114 assertMailingList( "users", metadata.getMailingLists().get( 0 ), "Archiva User List", true,
115 "http://www.nabble.com/archiva-users-f16426.html" );
116 assertMailingList( "dev", metadata.getMailingLists().get( 1 ), "Archiva Developer List", true,
117 "http://www.nabble.com/archiva-dev-f16427.html" );
118 assertMailingList( "commits", metadata.getMailingLists().get( 2 ), "Archiva Commits List", false, null );
119 assertMailingList( "issues", metadata.getMailingLists().get( 3 ), "Archiva Issues List", false,
120 "http://www.nabble.com/Archiva---Issues-f29617.html" );
122 List<Dependency> dependencies = metadata.getDependencies();
123 assertEquals( 10, dependencies.size() );
124 assertDependency( dependencies.get( 0 ), "commons-lang", "commons-lang", "2.2" );
125 assertDependency( dependencies.get( 1 ), "commons-io", "commons-io", "1.4" );
126 assertDependency( dependencies.get( 2 ), "org.slf4j", "slf4j-api", "1.5.0" );
127 assertDependency( dependencies.get( 3 ), "org.codehaus.plexus", "plexus-component-api", "1.0-alpha-22" );
128 assertDependency( dependencies.get( 4 ), "org.codehaus.plexus", "plexus-spring", "1.2", "test" );
129 assertDependency( dependencies.get( 5 ), "xalan", "xalan", "2.7.0" );
130 assertDependency( dependencies.get( 6 ), "dom4j", "dom4j", "1.6.1", "test" );
131 assertDependency( dependencies.get( 7 ), "junit", "junit", "3.8.1", "test" );
132 assertDependency( dependencies.get( 8 ), "easymock", "easymock", "1.2_Java1.3", "test" );
133 assertDependency( dependencies.get( 9 ), "easymock", "easymockclassextension", "1.2", "test" );
136 // TODO: test snapshot, rest of artifacts
137 public void testGetArtifactMetadata()
140 Collection<ArtifactMetadata> springArtifacts = resolver.getArtifacts( TEST_REPO_ID, "org.codehaus.plexus",
141 "plexus-spring", "1.2" );
142 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( springArtifacts );
144 assertEquals( 3, artifacts.size() );
146 ArtifactMetadata artifactMetadata = artifacts.get( 0 );
147 assertEquals( "plexus-spring-1.2-sources.jar", artifactMetadata.getId() );
148 MavenArtifactFacet facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
149 assertEquals( 0, facet.getBuildNumber() );
150 assertNull( facet.getTimestamp() );
151 assertEquals( "sources", facet.getClassifier() );
153 // assertEquals( "java-source", facet.getType() );
155 artifactMetadata = artifacts.get( 1 );
156 assertEquals( "plexus-spring-1.2.jar", artifactMetadata.getId() );
157 facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
158 assertEquals( 0, facet.getBuildNumber() );
159 assertNull( facet.getTimestamp() );
160 assertNull( facet.getClassifier() );
162 // assertEquals( "jar", facet.getType() );
164 artifactMetadata = artifacts.get( 2 );
165 assertEquals( "plexus-spring-1.2.pom", artifactMetadata.getId() );
166 facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
167 assertEquals( 0, facet.getBuildNumber() );
168 assertNull( facet.getTimestamp() );
169 assertNull( facet.getClassifier() );
171 // assertEquals( "pom", facet.getType() );
174 private void assertDependency( Dependency dependency, String groupId, String artifactId, String version )
176 assertDependency( dependency, groupId, artifactId, version, "compile" );
179 private void assertDependency( Dependency dependency, String groupId, String artifactId, String version,
182 assertEquals( artifactId, dependency.getArtifactId() );
183 assertEquals( "jar", dependency.getType() );
184 assertEquals( version, dependency.getVersion() );
185 assertEquals( groupId, dependency.getGroupId() );
186 assertEquals( scope, dependency.getScope() );
187 assertNull( dependency.getClassifier() );
188 assertNull( dependency.getSystemPath() );
191 public void testGetProjectVersionMetadataForTimestampedSnapshot()
194 ProjectVersionMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "org.apache", "apache",
196 MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
197 assertEquals( "pom", facet.getPackaging() );
198 assertEquals( "http://www.apache.org/", metadata.getUrl() );
199 assertNull( facet.getParent() );
200 assertEquals( "org.apache", facet.getGroupId() );
201 assertEquals( "apache", facet.getArtifactId() );
202 assertNull( metadata.getCiManagement() );
203 assertNotNull( metadata.getDescription() );
204 // TODO: this would be better
206 // "The Apache Software Foundation provides support for the Apache community of open-source software projects. " +
207 // "The Apache projects are characterized by a collaborative, consensus based development process, an open " +
208 // "and pragmatic software license, and a desire to create high quality software that leads the way in its " +
209 // "field. We consider ourselves not simply a group of projects sharing a server, but rather a community of " +
210 // "developers and users.", metadata.getDescription() );
211 assertEquals( "5-SNAPSHOT", metadata.getId() );
212 assertNull( metadata.getIssueManagement() );
213 checkApacheLicense( metadata );
214 assertEquals( "The Apache Software Foundation", metadata.getName() );
215 String path = "maven/pom/trunk/asf";
216 assertEquals( ASF_SCM_CONN_BASE + path, metadata.getScm().getConnection() );
217 assertEquals( ASF_SCM_DEV_CONN_BASE + path, metadata.getScm().getDeveloperConnection() );
218 assertEquals( ASF_SCM_VIEWVC_BASE + path, metadata.getScm().getUrl() );
219 checkOrganizationApache( metadata );
220 assertEquals( 1, metadata.getMailingLists().size() );
221 assertMailingList( metadata.getMailingLists().get( 0 ), "Apache Announce List",
222 "http://mail-archives.apache.org/mod_mbox/www-announce/", "announce@apache.org",
223 "announce-subscribe@apache.org", "announce-unsubscribe@apache.org",
224 Collections.<String>emptyList(), true );
225 assertEquals( Collections.<Dependency>emptyList(), metadata.getDependencies() );
228 public void testGetProjectVersionMetadataForTimestampedSnapshotMissingMetadata()
231 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-metadata",
233 assertNull( metadata );
236 public void testGetProjectVersionMetadataForTimestampedSnapshotMalformedMetadata()
239 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "malformed-metadata",
241 assertNull( metadata );
244 public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata()
247 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "incomplete-metadata",
249 assertNull( metadata );
252 public void testGetProjectVersionMetadataForInvalidPom()
255 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
259 resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "invalid-pom", "1.0" );
260 fail( "Should have received an exception due to invalid POM" );
262 catch ( MetadataResolutionException e )
264 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID,
265 RepositoryProblemFacet.FACET_ID ).isEmpty() );
266 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
267 RepositoryProblemFacet.FACET_ID,
268 "com.example.test/invalid-pom/1.0" );
269 assertEquals( "invalid-pom", facet.getProblem() );
273 public void testGetProjectVersionMetadataForMislocatedPom()
276 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
280 resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "mislocated-pom", "1.0" );
281 fail( "Should have received an exception due to mislocated POM" );
283 catch ( MetadataResolutionException e )
285 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID,
286 RepositoryProblemFacet.FACET_ID ).isEmpty() );
287 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
288 RepositoryProblemFacet.FACET_ID,
289 "com.example.test/mislocated-pom/1.0" );
290 assertEquals( "mislocated-pom", facet.getProblem() );
294 public void testGetProjectVersionMetadataForMissingPom()
297 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
299 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-pom", "1.0" );
300 assertNull( metadata );
302 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
303 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
304 RepositoryProblemFacet.FACET_ID,
305 "com.example.test/missing-pom/1.0" );
306 assertEquals( "missing-pom", facet.getProblem() );
310 public void testGetRootNamespaces()
312 assertEquals( Arrays.asList( "com", "org" ), resolver.getRootNamespaces( TEST_REPO_ID ) );
315 public void testGetNamespaces()
317 assertEquals( Arrays.asList( "example" ), resolver.getNamespaces( TEST_REPO_ID, "com" ) );
318 assertEquals( Arrays.asList( "test" ), resolver.getNamespaces( TEST_REPO_ID, "com.example" ) );
319 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "com.example.test" ) );
321 assertEquals( Arrays.asList( "apache", "codehaus" ), resolver.getNamespaces( TEST_REPO_ID, "org" ) );
322 assertEquals( Arrays.asList( "archiva", "maven" ), resolver.getNamespaces( TEST_REPO_ID, "org.apache" ) );
323 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.apache.archiva" ) );
324 assertEquals( Arrays.asList( "plugins", "shared" ), resolver.getNamespaces( TEST_REPO_ID,
325 "org.apache.maven" ) );
326 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
327 "org.apache.maven.plugins" ) );
328 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
329 "org.apache.maven.shared" ) );
331 assertEquals( Arrays.asList( "plexus" ), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus" ) );
332 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus.plexus" ) );
335 public void testGetProjects()
337 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com" ) );
338 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com.example" ) );
339 assertEquals( Arrays.asList( "incomplete-metadata", "invalid-pom", "malformed-metadata", "mislocated-pom",
340 "missing-metadata" ), resolver.getProjects( TEST_REPO_ID, "com.example.test" ) );
342 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org" ) );
343 assertEquals( Arrays.asList( "apache" ), resolver.getProjects( TEST_REPO_ID, "org.apache" ) );
344 assertEquals( Arrays.asList( "archiva", "archiva-base", "archiva-common", "archiva-modules", "archiva-parent" ),
345 resolver.getProjects( TEST_REPO_ID, "org.apache.archiva" ) );
346 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org.apache.maven" ) );
347 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID,
348 "org.apache.maven.plugins" ) );
349 assertEquals( Arrays.asList( "maven-downloader" ), resolver.getProjects( TEST_REPO_ID,
350 "org.apache.maven.shared" ) );
353 public void testGetProjectVersions()
355 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
356 "incomplete-metadata" ) );
357 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
358 "malformed-metadata" ) );
359 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
360 "missing-metadata" ) );
361 assertEquals( Arrays.asList( "1.0" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
364 assertEquals( Arrays.asList( "4", "5-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache",
367 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
369 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
371 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
372 "archiva-common" ) );
373 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
374 "archiva-modules" ) );
375 assertEquals( Arrays.asList( "3" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
376 "archiva-parent" ) );
378 assertEquals( Collections.<String>emptyList(), resolver.getProjectVersions( TEST_REPO_ID,
379 "org.apache.maven.shared",
380 "maven-downloader" ) );
383 public void testGetArtifacts()
385 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
386 "org.codehaus.plexus",
389 assertEquals( 3, artifacts.size() );
390 Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
392 public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
394 return o1.getId().compareTo( o2.getId() );
398 assertArtifact( artifacts.get( 0 ), "plexus-spring-1.2-sources.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
399 assertArtifact( artifacts.get( 1 ), "plexus-spring-1.2.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
400 assertArtifact( artifacts.get( 2 ), "plexus-spring-1.2.pom", 7407, "96b14cf880e384b2d15e8193c57b65c5420ca4c5",
401 "f83aa25f016212a551a4b2249985effc" );
404 public void testGetArtifactsFiltered()
406 ExcludesFilter<String> filter = new ExcludesFilter<String>( Collections.singletonList(
407 "plexus-spring-1.2.pom" ) );
408 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
409 "org.codehaus.plexus",
412 assertEquals( 2, artifacts.size() );
413 Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
415 public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
417 return o1.getId().compareTo( o2.getId() );
421 assertArtifact( artifacts.get( 0 ), "plexus-spring-1.2-sources.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
422 assertArtifact( artifacts.get( 1 ), "plexus-spring-1.2.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
425 public void testGetArtifactsTimestampedSnapshots()
427 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
431 assertEquals( 1, artifacts.size() );
433 ArtifactMetadata artifact = artifacts.get( 0 );
434 assertEquals( "missing-metadata-1.0-20091101.112233-1.pom", artifact.getId() );
435 assertEquals( "com.example.test", artifact.getNamespace() );
436 assertEquals( "missing-metadata", artifact.getProject() );
437 assertEquals( "1.0-20091101.112233-1", artifact.getVersion() );
438 assertEquals( TEST_REPO_ID, artifact.getRepositoryId() );
441 private void assertArtifact( ArtifactMetadata artifact, String id, int size, String sha1, String md5 )
443 assertEquals( id, artifact.getId() );
444 assertEquals( md5, artifact.getMd5() );
445 assertEquals( sha1, artifact.getSha1() );
446 assertEquals( size, artifact.getSize() );
447 assertEquals( "org.codehaus.plexus", artifact.getNamespace() );
448 assertEquals( "plexus-spring", artifact.getProject() );
449 assertEquals( "1.2", artifact.getVersion() );
450 assertEquals( TEST_REPO_ID, artifact.getRepositoryId() );
453 private void assertMailingList( MailingList mailingList, String name, String archive, String post, String subscribe,
454 String unsubscribe, List<String> otherArchives, boolean allowPost )
456 assertEquals( archive, mailingList.getMainArchiveUrl() );
459 assertEquals( post, mailingList.getPostAddress() );
463 assertNull( mailingList.getPostAddress() );
465 assertEquals( subscribe, mailingList.getSubscribeAddress() );
466 assertEquals( unsubscribe, mailingList.getUnsubscribeAddress() );
467 assertEquals( name, mailingList.getName() );
468 assertEquals( otherArchives, mailingList.getOtherArchives() );
471 private void assertMailingList( String prefix, MailingList mailingList, String name, boolean allowPost,
474 List<String> otherArchives = new ArrayList<String>();
475 otherArchives.add( "http://www.mail-archive.com/" + prefix + "@archiva.apache.org" );
476 if ( nabbleUrl != null )
478 otherArchives.add( nabbleUrl );
480 otherArchives.add( "http://markmail.org/list/org.apache.archiva." + prefix );
481 assertMailingList( mailingList, name, "http://mail-archives.apache.org/mod_mbox/archiva-" + prefix + "/",
482 prefix + "@archiva.apache.org", prefix + "-subscribe@archiva.apache.org",
483 prefix + "-unsubscribe@archiva.apache.org", otherArchives, allowPost );
486 private void checkApacheLicense( ProjectVersionMetadata metadata )
488 assertEquals( Arrays.asList( new License( "The Apache Software License, Version 2.0",
489 "http://www.apache.org/licenses/LICENSE-2.0.txt" ) ),
490 metadata.getLicenses() );
493 private void checkOrganizationApache( ProjectVersionMetadata metadata )
495 assertEquals( "The Apache Software Foundation", metadata.getOrganization().getName() );
496 assertEquals( "http://www.apache.org/", metadata.getOrganization().getUrl() );