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( "target/test-repository" ) );
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 );
143 Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
145 public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
147 return o1.getId().compareTo( o2.getId() );
151 assertEquals( 3, artifacts.size() );
153 ArtifactMetadata artifactMetadata = artifacts.get( 0 );
154 assertEquals( "plexus-spring-1.2-sources.jar", artifactMetadata.getId() );
155 MavenArtifactFacet facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
156 assertEquals( 0, facet.getBuildNumber() );
157 assertNull( facet.getTimestamp() );
158 assertEquals( "sources", facet.getClassifier() );
160 // assertEquals( "java-source", facet.getType() );
162 artifactMetadata = artifacts.get( 1 );
163 assertEquals( "plexus-spring-1.2.jar", artifactMetadata.getId() );
164 facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
165 assertEquals( 0, facet.getBuildNumber() );
166 assertNull( facet.getTimestamp() );
167 assertNull( facet.getClassifier() );
169 // assertEquals( "jar", facet.getType() );
171 artifactMetadata = artifacts.get( 2 );
172 assertEquals( "plexus-spring-1.2.pom", artifactMetadata.getId() );
173 facet = (MavenArtifactFacet) artifactMetadata.getFacet( MavenArtifactFacet.FACET_ID );
174 assertEquals( 0, facet.getBuildNumber() );
175 assertNull( facet.getTimestamp() );
176 assertNull( facet.getClassifier() );
178 // assertEquals( "pom", facet.getType() );
181 private void assertDependency( Dependency dependency, String groupId, String artifactId, String version )
183 assertDependency( dependency, groupId, artifactId, version, "compile" );
186 private void assertDependency( Dependency dependency, String groupId, String artifactId, String version,
189 assertEquals( artifactId, dependency.getArtifactId() );
190 assertEquals( "jar", dependency.getType() );
191 assertEquals( version, dependency.getVersion() );
192 assertEquals( groupId, dependency.getGroupId() );
193 assertEquals( scope, dependency.getScope() );
194 assertNull( dependency.getClassifier() );
195 assertNull( dependency.getSystemPath() );
198 public void testGetProjectVersionMetadataForTimestampedSnapshot()
201 ProjectVersionMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "org.apache", "apache",
203 MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
204 assertEquals( "pom", facet.getPackaging() );
205 assertEquals( "http://www.apache.org/", metadata.getUrl() );
206 assertNull( facet.getParent() );
207 assertEquals( "org.apache", facet.getGroupId() );
208 assertEquals( "apache", facet.getArtifactId() );
209 assertNull( metadata.getCiManagement() );
210 assertNotNull( metadata.getDescription() );
211 // TODO: this would be better
213 // "The Apache Software Foundation provides support for the Apache community of open-source software projects. " +
214 // "The Apache projects are characterized by a collaborative, consensus based development process, an open " +
215 // "and pragmatic software license, and a desire to create high quality software that leads the way in its " +
216 // "field. We consider ourselves not simply a group of projects sharing a server, but rather a community of " +
217 // "developers and users.", metadata.getDescription() );
218 assertEquals( "5-SNAPSHOT", metadata.getId() );
219 assertNull( metadata.getIssueManagement() );
220 checkApacheLicense( metadata );
221 assertEquals( "The Apache Software Foundation", metadata.getName() );
222 String path = "maven/pom/trunk/asf";
223 assertEquals( ASF_SCM_CONN_BASE + path, metadata.getScm().getConnection() );
224 assertEquals( ASF_SCM_DEV_CONN_BASE + path, metadata.getScm().getDeveloperConnection() );
225 assertEquals( ASF_SCM_VIEWVC_BASE + path, metadata.getScm().getUrl() );
226 checkOrganizationApache( metadata );
227 assertEquals( 1, metadata.getMailingLists().size() );
228 assertMailingList( metadata.getMailingLists().get( 0 ), "Apache Announce List",
229 "http://mail-archives.apache.org/mod_mbox/www-announce/", "announce@apache.org",
230 "announce-subscribe@apache.org", "announce-unsubscribe@apache.org",
231 Collections.<String>emptyList(), true );
232 assertEquals( Collections.<Dependency>emptyList(), metadata.getDependencies() );
235 public void testGetProjectVersionMetadataForTimestampedSnapshotMissingMetadata()
238 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-metadata",
240 assertNull( metadata );
243 public void testGetProjectVersionMetadataForTimestampedSnapshotMalformedMetadata()
246 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "malformed-metadata",
248 assertNull( metadata );
251 public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata()
254 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "incomplete-metadata",
256 assertNull( metadata );
259 public void testGetProjectVersionMetadataForInvalidPom()
262 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
266 resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "invalid-pom", "1.0" );
267 fail( "Should have received an exception due to invalid POM" );
269 catch ( MetadataResolutionException e )
271 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID,
272 RepositoryProblemFacet.FACET_ID ).isEmpty() );
273 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
274 RepositoryProblemFacet.FACET_ID,
275 "com.example.test/invalid-pom/1.0" );
276 assertEquals( "invalid-pom", facet.getProblem() );
280 public void testGetProjectVersionMetadataForMislocatedPom()
283 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
287 resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "mislocated-pom", "1.0" );
288 fail( "Should have received an exception due to mislocated POM" );
290 catch ( MetadataResolutionException e )
292 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID,
293 RepositoryProblemFacet.FACET_ID ).isEmpty() );
294 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
295 RepositoryProblemFacet.FACET_ID,
296 "com.example.test/mislocated-pom/1.0" );
297 assertEquals( "mislocated-pom", facet.getProblem() );
301 public void testGetProjectVersionMetadataForMissingPom()
304 assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
306 FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-pom", "1.0" );
307 assertNull( metadata );
309 assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
310 RepositoryProblemFacet facet = (RepositoryProblemFacet) metadataRepository.getMetadataFacet( TEST_REPO_ID,
311 RepositoryProblemFacet.FACET_ID,
312 "com.example.test/missing-pom/1.0" );
313 assertEquals( "missing-pom", facet.getProblem() );
317 public void testGetRootNamespaces()
319 assertEquals( Arrays.asList( "com", "org" ), resolver.getRootNamespaces( TEST_REPO_ID ) );
322 public void testGetNamespaces()
324 assertEquals( Arrays.asList( "example" ), resolver.getNamespaces( TEST_REPO_ID, "com" ) );
325 assertEquals( Arrays.asList( "test" ), resolver.getNamespaces( TEST_REPO_ID, "com.example" ) );
326 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "com.example.test" ) );
328 assertEquals( Arrays.asList( "apache", "codehaus" ), resolver.getNamespaces( TEST_REPO_ID, "org" ) );
329 assertEquals( Arrays.asList( "archiva", "maven" ), resolver.getNamespaces( TEST_REPO_ID, "org.apache" ) );
330 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.apache.archiva" ) );
331 assertEquals( Arrays.asList( "plugins", "shared" ), resolver.getNamespaces( TEST_REPO_ID,
332 "org.apache.maven" ) );
333 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
334 "org.apache.maven.plugins" ) );
335 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
336 "org.apache.maven.shared" ) );
338 assertEquals( Arrays.asList( "plexus" ), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus" ) );
339 assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus.plexus" ) );
342 public void testGetProjects()
344 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com" ) );
345 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com.example" ) );
346 assertEquals( Arrays.asList( "incomplete-metadata", "invalid-pom", "malformed-metadata", "mislocated-pom",
347 "missing-metadata", "test-artifact" ), resolver.getProjects( TEST_REPO_ID,
348 "com.example.test" ) );
350 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org" ) );
351 assertEquals( Arrays.asList( "apache" ), resolver.getProjects( TEST_REPO_ID, "org.apache" ) );
352 assertEquals( Arrays.asList( "archiva", "archiva-base", "archiva-common", "archiva-modules", "archiva-parent" ),
353 resolver.getProjects( TEST_REPO_ID, "org.apache.archiva" ) );
354 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org.apache.maven" ) );
355 assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID,
356 "org.apache.maven.plugins" ) );
357 assertEquals( Arrays.asList( "maven-downloader" ), resolver.getProjects( TEST_REPO_ID,
358 "org.apache.maven.shared" ) );
361 public void testGetProjectVersions()
363 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
364 "incomplete-metadata" ) );
365 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
366 "malformed-metadata" ) );
367 assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
368 "missing-metadata" ) );
369 assertEquals( Arrays.asList( "1.0" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
372 assertEquals( Arrays.asList( "4", "5-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache",
375 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
377 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
379 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
380 "archiva-common" ) );
381 assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
382 "archiva-modules" ) );
383 assertEquals( Arrays.asList( "3" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
384 "archiva-parent" ) );
386 assertEquals( Collections.<String>emptyList(), resolver.getProjectVersions( TEST_REPO_ID,
387 "org.apache.maven.shared",
388 "maven-downloader" ) );
391 public void testGetArtifacts()
393 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
394 "org.codehaus.plexus",
397 assertEquals( 3, artifacts.size() );
398 Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
400 public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
402 return o1.getId().compareTo( o2.getId() );
406 assertArtifact( artifacts.get( 0 ), "plexus-spring-1.2-sources.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
407 assertArtifact( artifacts.get( 1 ), "plexus-spring-1.2.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
408 assertArtifact( artifacts.get( 2 ), "plexus-spring-1.2.pom", 7407, "96b14cf880e384b2d15e8193c57b65c5420ca4c5",
409 "f83aa25f016212a551a4b2249985effc" );
412 public void testGetArtifactsFiltered()
414 ExcludesFilter<String> filter = new ExcludesFilter<String>( Collections.singletonList(
415 "plexus-spring-1.2.pom" ) );
416 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
417 "org.codehaus.plexus",
420 assertEquals( 2, artifacts.size() );
421 Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
423 public int compare( ArtifactMetadata o1, ArtifactMetadata o2 )
425 return o1.getId().compareTo( o2.getId() );
429 assertArtifact( artifacts.get( 0 ), "plexus-spring-1.2-sources.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
430 assertArtifact( artifacts.get( 1 ), "plexus-spring-1.2.jar", 0, EMPTY_SHA1, EMPTY_MD5 );
433 public void testGetArtifactsTimestampedSnapshots()
435 List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
439 assertEquals( 1, artifacts.size() );
441 ArtifactMetadata artifact = artifacts.get( 0 );
442 assertEquals( "missing-metadata-1.0-20091101.112233-1.pom", artifact.getId() );
443 assertEquals( "com.example.test", artifact.getNamespace() );
444 assertEquals( "missing-metadata", artifact.getProject() );
445 assertEquals( "1.0-20091101.112233-1", artifact.getVersion() );
446 assertEquals( TEST_REPO_ID, artifact.getRepositoryId() );
449 private void assertArtifact( ArtifactMetadata artifact, String id, int size, String sha1, String md5 )
451 assertEquals( id, artifact.getId() );
452 assertEquals( md5, artifact.getMd5() );
453 assertEquals( sha1, artifact.getSha1() );
454 assertEquals( size, artifact.getSize() );
455 assertEquals( "org.codehaus.plexus", artifact.getNamespace() );
456 assertEquals( "plexus-spring", artifact.getProject() );
457 assertEquals( "1.2", artifact.getVersion() );
458 assertEquals( TEST_REPO_ID, artifact.getRepositoryId() );
461 private void assertMailingList( MailingList mailingList, String name, String archive, String post, String subscribe,
462 String unsubscribe, List<String> otherArchives, boolean allowPost )
464 assertEquals( archive, mailingList.getMainArchiveUrl() );
467 assertEquals( post, mailingList.getPostAddress() );
471 assertNull( mailingList.getPostAddress() );
473 assertEquals( subscribe, mailingList.getSubscribeAddress() );
474 assertEquals( unsubscribe, mailingList.getUnsubscribeAddress() );
475 assertEquals( name, mailingList.getName() );
476 assertEquals( otherArchives, mailingList.getOtherArchives() );
479 private void assertMailingList( String prefix, MailingList mailingList, String name, boolean allowPost,
482 List<String> otherArchives = new ArrayList<String>();
483 otherArchives.add( "http://www.mail-archive.com/" + prefix + "@archiva.apache.org" );
484 if ( nabbleUrl != null )
486 otherArchives.add( nabbleUrl );
488 otherArchives.add( "http://markmail.org/list/org.apache.archiva." + prefix );
489 assertMailingList( mailingList, name, "http://mail-archives.apache.org/mod_mbox/archiva-" + prefix + "/",
490 prefix + "@archiva.apache.org", prefix + "-subscribe@archiva.apache.org",
491 prefix + "-unsubscribe@archiva.apache.org", otherArchives, allowPost );
494 private void checkApacheLicense( ProjectVersionMetadata metadata )
496 assertEquals( Arrays.asList( new License( "The Apache Software License, Version 2.0",
497 "http://www.apache.org/licenses/LICENSE-2.0.txt" ) ),
498 metadata.getLicenses() );
501 private void checkOrganizationApache( ProjectVersionMetadata metadata )
503 assertEquals( "The Apache Software Foundation", metadata.getOrganization().getName() );
504 assertEquals( "http://www.apache.org/", metadata.getOrganization().getUrl() );