Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test gear for fcrepo integration testing
Related to: https://jira.duraspace.org/browse/FCREPO-1481
- Loading branch information
Showing
10 changed files
with
265 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/test/java/org/fcrepo/audit/integration/FcrepoAuditIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Licensed to DuraSpace under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* DuraSpace 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. | ||
*/ | ||
package org.fcrepo.audit.integration; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
/** | ||
* Integration tests for the audit system | ||
* | ||
* @author acoburn | ||
* @since 2015-04-23 | ||
*/ | ||
@ContextConfiguration({"/spring-test/test-container.xml"}) | ||
@RunWith(SpringJUnit4ClassRunner.class) | ||
public class FcrepoAuditIT { | ||
|
||
protected Logger logger = LoggerFactory.getLogger(FcrepoAuditIT.class); | ||
|
||
protected static final int SERVER_PORT = Integer.parseInt(System.getProperty("fcrepo.dynamic.test.port", "8080")); | ||
|
||
protected static final String HOSTNAME = "localhost"; | ||
|
||
protected static final String serverAddress = "http://" + HOSTNAME + ":" | ||
+ SERVER_PORT; | ||
|
||
@Test | ||
public void testAudit() throws Exception { | ||
assertEquals(1 + 1, 2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name" : "repo", | ||
"jndiName" : "", | ||
"workspaces" : { | ||
"predefined" : ["default"], | ||
"default" : "default", | ||
"allowCreation" : true | ||
}, | ||
"security" : { | ||
"anonymous" : { | ||
"roles" : ["readonly","readwrite","admin"], | ||
"useOnFailedLogin" : false | ||
}, | ||
"providers" : [ | ||
{ "classname" : "org.fcrepo.auth.common.BypassSecurityServletAuthenticationProvider" } | ||
] | ||
}, | ||
"node-types" : ["fedora-node-types.cnd"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE configuration> | ||
<configuration> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<logger name="org.fcrepo.transform" additivity="false" level="${fcrepo.log.transform:-INFO}"> | ||
<appender-ref ref="STDOUT"/> | ||
</logger> | ||
<logger name="org.fcrepo" additivity="false" level="${fcrepo.log:-INFO}"> | ||
<appender-ref ref="STDOUT"/> | ||
</logger> | ||
<root additivity="false" level="WARN"> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation=" | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> | ||
|
||
<!-- Master context for the test application. --> | ||
<bean class="org.fcrepo.http.commons.test.util.SpringContextSingleton"/> | ||
<import resource="classpath:/spring-test/repo.xml"/> | ||
<import resource="classpath:/spring-test/rest.xml"/> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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" | ||
xmlns:p="http://www.springframework.org/schema/p" | ||
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"> | ||
|
||
<!-- Context that supports the actual ModeShape JCR itself --> | ||
|
||
<context:annotation-config/> | ||
|
||
<context:property-placeholder/> | ||
|
||
<bean name="modeshapeRepofactory" | ||
class="org.fcrepo.kernel.modeshape.spring.ModeShapeRepositoryFactoryBean" | ||
p:repositoryConfiguration="${fcrepo.modeshape.configuration:/config/test_repository.json}"/> | ||
|
||
<bean class="org.modeshape.jcr.ModeShapeEngine" init-method="start"/> | ||
|
||
<bean id="connectionManager" class="org.apache.http.impl.conn.PoolingHttpClientConnectionManager" /> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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" | ||
xmlns:util="http://www.springframework.org/schema/util" | ||
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 | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> | ||
|
||
<context:property-placeholder/> | ||
|
||
<!-- Context that houses JAX-RS Resources that compose the API | ||
as well as some utility gear. --> | ||
|
||
<context:annotation-config/> | ||
|
||
<context:component-scan base-package="org.fcrepo"/> | ||
|
||
<bean class="org.fcrepo.http.commons.session.SessionFactory" /> | ||
|
||
<!-- Mints PIDs--> | ||
<bean class="org.fcrepo.mint.UUIDPidMinter"/> | ||
|
||
<!-- Identifier translation chain --> | ||
<util:list id="translationChain" value-type="org.fcrepo.kernel.api.identifiers.InternalIdentifierConverter"> | ||
<bean class="org.fcrepo.kernel.modeshape.identifiers.NamespaceConverter"/> | ||
</util:list> | ||
|
||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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" | ||
xmlns:p="http://www.springframework.org/schema/p" | ||
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"> | ||
|
||
<context:property-placeholder/> | ||
|
||
<!-- show stack traces for easier debugging --> | ||
<bean id="wildcardExceptionmapper" | ||
class="org.fcrepo.http.commons.exceptionhandlers.WildcardExceptionMapper" | ||
p:showStackTrace="true"/> | ||
|
||
<bean id="containerWrapper" | ||
class="org.fcrepo.http.commons.test.util.ContainerWrapper" | ||
init-method="start" destroy-method="stop" p:port="${fcrepo.dynamic.test.port:8080}" | ||
p:configLocation="classpath:web.xml"/> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" | ||
version="3.0" metadata-complete="false"> | ||
|
||
<display-name>Fedora-on-ModeShape</display-name> | ||
|
||
<context-param> | ||
<param-name>contextConfigLocation</param-name> | ||
<param-value>classpath:spring-test/master.xml</param-value> | ||
</context-param> | ||
|
||
<listener> | ||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> | ||
</listener> | ||
|
||
<servlet> | ||
<servlet-name>jersey-servlet</servlet-name> | ||
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> | ||
|
||
<init-param> | ||
<param-name>javax.ws.rs.Application</param-name> | ||
<param-value>org.fcrepo.http.commons.FedoraApplication</param-value> | ||
</init-param> | ||
|
||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
|
||
<servlet-mapping> | ||
<servlet-name>jersey-servlet</servlet-name> | ||
<url-pattern>/*</url-pattern> | ||
</servlet-mapping> | ||
|
||
</web-app> |