1 package org.apache.maven.repository.reporting;
4 * Copyright 2001-2005 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 import java.lang.reflect.Method;
21 import java.lang.reflect.Proxy;
22 import java.util.List;
23 import org.apache.maven.artifact.factory.ArtifactFactory;
24 import org.codehaus.plexus.PlexusTestCase;
26 public class BadMetadataReportProcessorTest extends PlexusTestCase
28 protected ArtifactFactory artifactFactory;
29 private BadMetadataReportProcessor badMetadataReportProcessor;
31 public BadMetadataReportProcessorTest(String testName)
36 protected void setUp() throws Exception
38 artifactFactory = (ArtifactFactory) getContainer().lookup( ArtifactFactory.ROLE );
40 badMetadataReportProcessor = new TestBadMetadataReportProcessor( artifactFactory,
41 new DefaultRepositoryQueryLayer() );
44 protected RepositoryQueryLayer getRepositoryQueryLayer( List returnValues ) throws NoSuchMethodException
46 GenericMockObject mockObject = new GenericMockObject();
47 Method method = RepositoryQueryLayer.class.getMethod( "containsArtifact", null );
48 mockObject.setExpectedReturns( method, returnValues );
49 RepositoryQueryLayer queryLayer = (RepositoryQueryLayer) Proxy.newProxyInstance( this.getClassLoader(),
50 new Class[] { RepositoryQueryLayer.class },
51 new GenericMockObject() );
55 protected void tearDown() throws Exception
57 release( artifactFactory );
60 public void testProcessMetadata()
64 public void testCheckPluginMetadata()
68 public void testCheckSnapshotMetadata()
72 public void testCheckMetadataVersions()
76 public void testCheckRepositoryVersions()