Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
switched http-api to jersey and changed http-api integration tests to…
… use grizzly
  • Loading branch information
fasseg committed Apr 17, 2013
1 parent ce65d71 commit ece5bdd
Show file tree
Hide file tree
Showing 23 changed files with 250 additions and 288 deletions.
51 changes: 41 additions & 10 deletions fcrepo-generator-dc/pom.xml
Expand Up @@ -38,30 +38,61 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-http-commons</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-servlet-webserver</artifactId>
<version>1.9.57</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-grizzly</artifactId>
<version>1.17.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<version>1.17.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- This dependency is for compile-time: it keeps this module independent
of any given choice of JAX-RS implementation. It must be _after_ the test
Expand Down
Expand Up @@ -8,7 +8,6 @@
import java.util.List;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
Expand All @@ -21,14 +20,15 @@
import org.fcrepo.AbstractResource;
import org.fcrepo.generator.dublincore.DCGenerator;
import org.fcrepo.services.ObjectService;
import org.springframework.beans.factory.annotation.Autowired;

@Path("/objects/{pid}/oai_dc")
public class DublinCoreGenerator extends AbstractResource {

@Resource
List<DCGenerator> dcgenerators;

@Inject
@Autowired
ObjectService objectService;

@GET
Expand Down
Expand Up @@ -13,7 +13,7 @@
import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration({"/spring-test/generator.xml", "/spring-test/repo.xml"})
@ContextConfiguration({"/spring-test/test-container.xml"})
public class DublinCoreGeneratorIT extends AbstractResourceIT {

@Test
Expand Down
30 changes: 8 additions & 22 deletions fcrepo-generator-dc/src/test/resources/spring-test/generator.xml
Expand Up @@ -10,37 +10,23 @@
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml"/>

<context:property-placeholder/>

<context:annotation-config/>
<context:annotation-config />

<context:component-scan base-package="org.fcrepo.generator,org.fcrepo.exceptionhandlers"/>

<bean class="org.fcrepo.session.SessionFactory" />

<jaxrs:server address="http://localhost:${test.port:8080}/rest">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.generator.DublinCoreGenerator"/>
<bean class="org.fcrepo.api.FedoraObjects"/>
<bean class="org.fcrepo.api.FedoraDatastreams"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.fcrepo.exceptionhandlers.PathNotFoundExceptionMapper"/>
<bean class="org.fcrepo.exceptionhandlers.AccessControlExceptionMapper"/>
<bean class="org.fcrepo.exceptionhandlers.WildcardExceptionMapper">
<property name="showStackTrace" value="true"/>
</bean>
</jaxrs:providers>
</jaxrs:server>

<bean class="org.fcrepo.session.SessionFactory" />

<!-- Mints PIDs-->
<bean class="org.fcrepo.identifiers.UUIDPidMinter"/>

<util:list id="dcgenerators" value-type="org.fcrepo.generator.dublincore.DCGenerator">
<bean class="org.fcrepo.generator.dublincore.WellKnownDatastreamGenerator">
<property name="wellKnownDsid" value="DC"/>
</bean>
<bean class="org.fcrepo.generator.dublincore.JcrPropertiesGenerator"/>
</util:list>

<!-- Mints PIDs-->
<bean class="org.fcrepo.identifiers.UUIDPidMinter"/>

</beans>
107 changes: 57 additions & 50 deletions fcrepo-http-api/pom.xml
Expand Up @@ -26,43 +26,7 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-cxf-rt</artifactId>
<version>${enunciate.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- RESTEasy -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
<version>${resteasy.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Apache Velocity -->
<!-- Apache Velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
Expand All @@ -75,7 +39,21 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<!-- test gear -->
<dependency>
<groupId>org.fcrepo</groupId>
Expand All @@ -84,29 +62,58 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-http-commons</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<groupId>com.sun.grizzly</groupId>
<artifactId>grizzly-servlet-webserver</artifactId>
<version>1.9.57</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-grizzly</artifactId>
<version>1.17.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<scope>provided</scope>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<version>1.17.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
Expand Down

0 comments on commit ece5bdd

Please sign in to comment.