Added Datanucleus tests.

This commit is contained in:
Oliver Gierke
2013-02-25 15:52:15 +01:00
committed by Oliver Gierke
parent 5438c44c8f
commit 4b7d5d37b6
4 changed files with 116 additions and 2 deletions

38
pom.xml
View File

@@ -22,6 +22,7 @@
<dist.key>DATAJPA</dist.key>
<datanucleus>3.3.7</datanucleus>
<eclipselink>2.5.1</eclipselink>
<hibernate>3.6.10.Final</hibernate>
<hsqldb1>1.8.0.10</hsqldb1>
@@ -115,7 +116,6 @@
<version>${aspectj}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
@@ -144,7 +144,6 @@
<version>${hibernate}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
@@ -171,6 +170,21 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-accessplatform-jpa-rdbms</artifactId>
<version>${datanucleus}</version>
<type>pom</type>
<optional>true</optional>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-jpa-query</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- QueryDsl -->
<dependency>
<groupId>com.mysema.querydsl</groupId>
@@ -258,6 +272,21 @@
</excludes>
</configuration>
</execution>
<execution>
<id>datanucleus-tests</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
<configuration>
<includes>
<include>**/DataNucleus*Tests.java</include>
</includes>
<argLine>-javaagent:${settings.localRepository}/org/datanucleus/datanucleus-core/3.2.12/datanucleus-core-3.2.12.jar=-api=JPA <!-- -javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar --></argLine>
</configuration>
</execution>
<execution>
<id>unit-tests</id>
<goals>
@@ -270,6 +299,7 @@
</includes>
</configuration>
</execution>
<execution>
<id>integration-tests</id>
<goals>
@@ -284,12 +314,14 @@
<excludes>
<exclude>**/*UnitTests.java</exclude>
<exclude>**/OpenJpa*</exclude>
<exclude>**/DataNucleus*</exclude>
<exclude>**/EclipseLink*</exclude>
<exclude>**/infrastructure/*</exclude>
</excludes>
<argLine>-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar</argLine>
</configuration>
</execution>
<execution>
<id>eclipselink-tests</id>
<goals>
@@ -303,6 +335,7 @@
<argLine>-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar</argLine>
</configuration>
</execution>
<execution>
<id>openjpa-tests</id>
<goals>
@@ -322,6 +355,7 @@
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>

View File

@@ -0,0 +1,35 @@
/*
* Copyright 2013-2014 the original author or authors.
*
* Licensed 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.springframework.data.jpa.repository;
import javax.persistence.spi.PersistenceProvider;
import org.datanucleus.api.jpa.PersistenceProviderImpl;
import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
/**
* @author Oliver Gierke
*/
public class DataNucleusJpaVendorAdapter extends AbstractJpaVendorAdapter {
/*
* (non-Javadoc)
* @see org.springframework.orm.jpa.JpaVendorAdapter#getPersistenceProvider()
*/
public PersistenceProvider getPersistenceProvider() {
return new PersistenceProviderImpl();
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2008-2014 the original author or authors.
*
* Licensed 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.springframework.data.jpa.repository;
import org.springframework.data.jpa.repository.sample.UserRepository;
import org.springframework.test.context.ContextConfiguration;
/**
* Testcase to run {@link UserRepository} integration tests on top of DataNucleus.
*
* @author Oliver Gierke
*/
@ContextConfiguration(value = "classpath:datanucleus.xml")
public class DataNucleusNamespaceUserRepositoryTests extends NamespaceUserRepositoryTests {
}

View File

@@ -0,0 +1,16 @@
<?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:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="vendorAdaptor" class="org.springframework.data.jpa.repository.DataNucleusJpaVendorAdapter" parent="abstractVendorAdaptor" />
<util:properties id="jpaProperties">
<prop key="datanucleus.autoCreateTables">true</prop>
</util:properties>
</beans>