aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-06-07 17:57:33 +0000
committerOlivier Lamy <olamy@apache.org>2011-06-07 17:57:33 +0000
commit9b142e861d811a2623db10984ec4d4ce9afd56dd (patch)
treec41de7e275f9cd74d1f7551b211cc05c3cc7c9cc /archiva-modules
parent9c55823b96a84a67cd17157e8938601de4de86db (diff)
downloadarchiva-9b142e861d811a2623db10984ec4d4ce9afd56dd.tar.gz
archiva-9b142e861d811a2623db10984ec4d4ce9afd56dd.zip
start fixing spring configuration for unit test in archiva-webdav
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1133115 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/pom.xml13
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml11
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml25
3 files changed, 42 insertions, 7 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml
index 6d72c2708..b6ef0aca4 100644
--- a/archiva-modules/archiva-web/archiva-webdav/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml
@@ -150,4 +150,17 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemPropertyVariables>
+ <appserver.base>${project.build.outputDirectory}</appserver.base>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml
index 291aa01ec..995a1e998 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml
@@ -28,18 +28,15 @@
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
- <context-param>
- <param-name>contextClass</param-name>
- <param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
- </context-param>
-
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
- classpath*:/META-INF/plexus/components.xml
classpath*:/META-INF/spring-context.xml
- target/test-classes/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
+
</param-value>
</context-param>
+ <!--
+ target/test-classes/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
+ -->
</web-app>
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml
index 6742098a0..faaedbe28 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/resources/spring-context.xml
@@ -27,6 +27,8 @@
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.maven.archiva.webdav,org.apache.archiva.metadata.repository"/>
@@ -42,4 +44,27 @@
</property>
</bean>
+ <bean name="servletAuthenticator" class="org.apache.maven.archiva.webdav.MockServletAuthenticator"/>
+
+ <bean name="archivaConfiguration#default" class="org.apache.maven.archiva.configuration.DefaultArchivaConfiguration">
+ <property name="registry" ref="registry#default"/>
+ </bean>
+
+ <alias name="archivaConfiguration#default" alias="archivaConfiguration"/>
+
+ <bean name="registry#default" class="org.codehaus.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <property name="properties">
+ <value>
+ <![CDATA[
+ <configuration>
+ <system/>
+ <xml fileName="${appserver.base}/conf/archiva.xml" config-forceCreate="true"
+ config-optional="true"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </configuration>
+ ]]>
+ </value>
+ </property>
+ </bean>
+
</beans> \ No newline at end of file