Переглянути джерело

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
tags/archiva-1.4-M1
Brett Porter 13 роки тому
джерело
коміт
1f68b697b7

+ 1
- 7
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

+ 3
- 2
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
{

+ 0
- 38
archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml Переглянути файл

@@ -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>

+ 37
- 0
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>

+ 1
- 2
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>
</beans>

+ 3
- 4
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

Завантаження…
Відмінити
Зберегти