From 943be879081404f026d1c1edaab298e34aa02178 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 25 Jan 2013 18:15:17 +0100 Subject: [PATCH] DATAJPA-288 - Separate test execution for different persistence providers. Re-enabled more integration tests integration tests. --- pom.xml | 82 +++++++++++++++++-- ...lipseLinkNamespaceUserRepositoryTests.java | 4 +- .../EclipseLinkUserRepositoryFinderTests.java | 15 +++- .../OpenJpaNamespaceUserRepositoryTests.java | 2 +- .../OpenJpaUserRepositoryFinderTests.java | 39 +++++++++ 5 files changed, 125 insertions(+), 17 deletions(-) create mode 100644 src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java diff --git a/pom.xml b/pom.xml index 5be5db7b7..c20a37d63 100644 --- a/pom.xml +++ b/pom.xml @@ -211,15 +211,6 @@ org.apache.maven.plugins maven-surefire-plugin 2.12 - - - **/*Tests.java - - - **/infrastructure/*.java - - -javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar -javaagent:${settings.localRepository}/org/apache/openjpa/openjpa/${openjpa}/openjpa-${openjpa}.jar - org.springframework @@ -234,6 +225,79 @@ runtime + + + **/infrastructure/* + + + + + default-test + + + **/* + + + + + unit-tests + + test + + test + + + **/*UnitTests.java + + + + + integration-tests + + test + + test + + + **/*IntegrationTests.java + **/*Tests.java + + + **/*UnitTests.java + **/OpenJpa* + **/EclipseLink* + **/infrastructure/* + + -javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar + + + + eclipselink-tests + + test + + test + + + **/EclipseLink*Tests.java + + -javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar + + + + openjpa-tests + + test + + test + + + **/OpenJpa*Tests.java + + -javaagent:${settings.localRepository}/org/apache/openjpa/openjpa/${openjpa}/openjpa-${openjpa}.jar + + + diff --git a/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java index f635d12d5..617107dac 100644 --- a/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/EclipseLinkNamespaceUserRepositoryTests.java @@ -16,7 +16,6 @@ package org.springframework.data.jpa.repository; import org.springframework.data.jpa.repository.sample.UserRepository; -import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; /** @@ -24,8 +23,7 @@ import org.springframework.test.context.ContextConfiguration; * * @author Oliver Gierke */ -@DirtiesContext -@ContextConfiguration(value = "classpath:eclipselink.xml", inheritLocations = true) +@ContextConfiguration(value = "classpath:eclipselink.xml") public class EclipseLinkNamespaceUserRepositoryTests extends NamespaceUserRepositoryTests { /** diff --git a/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryFinderTests.java b/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryFinderTests.java index 69711dba2..f6d6ec9c3 100644 --- a/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryFinderTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/EclipseLinkUserRepositoryFinderTests.java @@ -16,7 +16,6 @@ package org.springframework.data.jpa.repository; import org.junit.Ignore; -import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; /** @@ -25,8 +24,16 @@ import org.springframework.test.context.ContextConfiguration; * * @author Oliver Gierke */ -@Ignore -@DirtiesContext -@ContextConfiguration(value = "classpath:eclipselink.xml", inheritLocations = true) +@ContextConfiguration("classpath:eclipselink.xml") public class EclipseLinkUserRepositoryFinderTests extends UserRepositoryFinderTests { + + @Ignore + @Override + public void executesNotInQueryCorrectly() throws Exception { + } + + @Ignore + @Override + public void executesInKeywordForPageCorrectly() { + } } diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java index 05cabbda7..c079aafed 100644 --- a/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaNamespaceUserRepositoryTests.java @@ -41,7 +41,7 @@ import org.springframework.test.context.ContextConfiguration; * * @author Oliver Gierke */ -@ContextConfiguration(value = "classpath:openjpa.xml", inheritLocations = true) +@ContextConfiguration("classpath:openjpa.xml") public class OpenJpaNamespaceUserRepositoryTests extends NamespaceUserRepositoryTests { @PersistenceContext diff --git a/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java b/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java new file mode 100644 index 000000000..7458b4cb6 --- /dev/null +++ b/src/test/java/org/springframework/data/jpa/repository/OpenJpaUserRepositoryFinderTests.java @@ -0,0 +1,39 @@ +/* + * Copyright 2011 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.junit.Ignore; +import org.springframework.test.context.ContextConfiguration; + +/** + * Ignores some test cases using IN queries as long as we wait for fix for + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477. + * + * @author Oliver Gierke + */ +@ContextConfiguration("classpath:openjpa.xml") +public class OpenJpaUserRepositoryFinderTests extends UserRepositoryFinderTests { + + @Ignore + @Override + public void findsByLastnameIgnoringCase() throws Exception { + } + + @Ignore + @Override + public void findsByLastnameIgnoringCaseLike() throws Exception { + } +}