diff options
author | Brett Porter <brett@apache.org> | 2011-06-29 04:17:55 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2011-06-29 04:17:55 +0000 |
commit | 1f68b697b7f3a450c0578e047c815f2d9d82551f (patch) | |
tree | 68d4f990cb15fe05824f00c84488f3f06bda58d2 /archiva-modules | |
parent | 7d53f8c9ccc31f6240e985c2c1b7793b57563360 (diff) | |
download | archiva-1f68b697b7f3a450c0578e047c815f2d9d82551f.tar.gz archiva-1f68b697b7f3a450c0578e047c815f2d9d82551f.zip |
clean up some tests and avoid creating bad ~/.m2/archiva.xml descriptor
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1140961 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
6 files changed, 45 insertions, 53 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java index 46bbd8a97..6caaedc08 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java @@ -30,8 +30,8 @@ import org.apache.commons.codec.Encoder; import org.apache.commons.codec.binary.Base64; import sun.misc.BASE64Encoder; -import javax.servlet.http.HttpServletResponse; import java.io.File; +import javax.servlet.http.HttpServletResponse; public class RssFeedServletTest extends TestCase @@ -166,12 +166,6 @@ public class RssFeedServletTest } } - //Override - protected String getPlexusConfigLocation() - { - return "org/apache/maven/archiva/web/rss/RssFeedServletTest.xml"; - } - @Override protected void tearDown() throws Exception diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/tags/DependencyTreeTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/tags/DependencyTreeTest.java index 8f8bdaae0..12e36218d 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/tags/DependencyTreeTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/tags/DependencyTreeTest.java @@ -44,14 +44,15 @@ import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import javax.inject.Inject; import java.util.List; +import javax.inject.Inject; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @RunWith( SpringJUnit4ClassRunner.class ) -@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml" } ) +@ContextConfiguration( locations = {"classpath*:/META-INF/spring-context.xml", "classpath:/spring-context.xml", + "classpath:/spring-context-DependencyTreeTest.xml"} ) public class DependencyTreeTest extends TestCase { diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml deleted file mode 100644 index 6a6e174a2..000000000 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<component-set> - <components> - <!-- Components that are common for all test cases --> - <component> - <role>org.apache.maven.archiva.webdav.util.MimeTypes</role> - <implementation>org.apache.maven.archiva.webdav.util.MimeTypes</implementation> - <description>MimeTypes</description> - <configuration> - <resource>archiva-mime-types.txt</resource> - </configuration> - </component> - <component> - <role>org.apache.archiva.metadata.repository.RepositorySessionFactory</role> - <role-hint>default</role-hint> - <implementation>org.apache.archiva.metadata.repository.memory.TestRepositorySessionFactory</implementation> - </component> - </components> -</component-set>
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-DependencyTreeTest.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-DependencyTreeTest.xml new file mode 100644 index 000000000..79e981ec1 --- /dev/null +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context-DependencyTreeTest.xml @@ -0,0 +1,37 @@ +<?xml version="1.0"?> + +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context-3.0.xsd" + default-lazy-init="true"> + + <context:property-placeholder system-properties-mode="OVERRIDE"/> + + <context:annotation-config/> + <context:component-scan base-package="org.apache.archiva.metadata.repository.memory"/> + + <bean name="archivaConfiguration#test" class="org.apache.archiva.configuration.TestConfiguration" /> + <alias name="archivaConfiguration#test" alias="archivaConfiguration#default" /> +</beans> diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context.xml index c3518d797..0c2f74e0e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/resources/spring-context.xml @@ -40,5 +40,4 @@ <bean name="metadataResolver#test" class="org.apache.archiva.metadata.repository.memory.TestMetadataResolver"/> <alias name="metadataResolver#test" alias="metadataResolver#default"/> - -</beans>
\ No newline at end of file +</beans> diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java index b317467c7..61bfd5d93 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java @@ -43,7 +43,6 @@ import org.apache.maven.artifact.metadata.ResolutionGroup; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactCollector; import org.apache.maven.artifact.resolver.ArtifactResolutionException; -import org.apache.maven.artifact.resolver.ResolutionListener; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter; @@ -77,9 +76,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.inject.Named; import java.io.File; import java.util.ArrayList; import java.util.Collection; @@ -90,6 +86,9 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.inject.Named; /** * Default implementation of <code>DependencyTreeBuilder</code>. Customized wrapper for maven-dependency-tree to use |