From a481ee4a8e0ffcd29502508fd878da064f4acac8 Mon Sep 17 00:00:00 2001 From: Dapeng Date: Mon, 19 Sep 2016 16:49:25 +0800 Subject: [PATCH] remove unrelated tests --- .../service/AbstractClinicServiceTests.java | 13 ++++--- .../service/ClinicServiceJdbcTests.java | 36 ------------------- .../service/ClinicServiceJpaTests.java | 23 ------------ .../ClinicServiceSpringDataJpaTests.java | 20 ----------- .../petclinic/service}/EntityUtils.java | 2 +- 5 files changed, 7 insertions(+), 87 deletions(-) delete mode 100644 src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java delete mode 100644 src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java delete mode 100644 src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java rename src/{main/java/org/springframework/samples/petclinic/util => test/java/org/springframework/samples/petclinic/service}/EntityUtils.java (97%) diff --git a/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java b/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java index b803af44e..330247ba4 100644 --- a/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java +++ b/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java @@ -15,11 +15,6 @@ */ package org.springframework.samples.petclinic.service; -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Collection; - -import org.joda.time.DateTime; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.samples.petclinic.model.Owner; @@ -27,10 +22,14 @@ import org.springframework.samples.petclinic.model.Pet; import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.model.Visit; -import org.springframework.samples.petclinic.util.EntityUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.transaction.annotation.Transactional; +import java.util.Collection; +import java.util.Date; + +import static org.assertj.core.api.Assertions.assertThat; + /** *

Base class for {@link ClinicService} integration tests.

Subclasses should specify Spring context * configuration using {@link ContextConfiguration @ContextConfiguration} annotation

@@ -139,7 +138,7 @@ public abstract class AbstractClinicServiceTests { pet.setName("bowser"); Collection types = this.clinicService.findPetTypes(); pet.setType(EntityUtils.getById(types, PetType.class, 2)); - pet.setBirthDate(new DateTime()); + pet.setBirthDate(new Date()); owner6.addPet(pet); assertThat(owner6.getPets().size()).isEqualTo(found + 1); diff --git a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java b/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java deleted file mode 100644 index 49e57ea40..000000000 --- a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJdbcTests.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2002-2013 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.samples.petclinic.service; - -import org.junit.runner.RunWith; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - *

Integration test using the jdbc profile. - * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

- * - * @author Thomas Risberg - * @author Michael Isvy - */ -@ContextConfiguration(locations = {"classpath:spring/business-config.xml"}) -@RunWith(SpringJUnit4ClassRunner.class) -@ActiveProfiles("jdbc") -public class ClinicServiceJdbcTests extends AbstractClinicServiceTests { - - -} diff --git a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java b/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java deleted file mode 100644 index e024f21fd..000000000 --- a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceJpaTests.java +++ /dev/null @@ -1,23 +0,0 @@ - -package org.springframework.samples.petclinic.service; - -import org.junit.runner.RunWith; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - *

Integration test using the jpa profile. - * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

- * - * @author Rod Johnson - * @author Sam Brannen - * @author Michael Isvy - */ - -@ContextConfiguration(locations = {"classpath:spring/business-config.xml"}) -@RunWith(SpringJUnit4ClassRunner.class) -@ActiveProfiles("jpa") -public class ClinicServiceJpaTests extends AbstractClinicServiceTests { - -} \ No newline at end of file diff --git a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java b/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java deleted file mode 100644 index e01dda551..000000000 --- a/src/test/java/org/springframework/samples/petclinic/service/ClinicServiceSpringDataJpaTests.java +++ /dev/null @@ -1,20 +0,0 @@ - -package org.springframework.samples.petclinic.service; - -import org.junit.runner.RunWith; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - *

Integration test using the 'Spring Data' profile. - * @see AbstractClinicServiceTests AbstractClinicServiceTests for more details.

- * @author Michael Isvy - */ - -@ContextConfiguration(locations = {"classpath:spring/business-config.xml"}) -@RunWith(SpringJUnit4ClassRunner.class) -@ActiveProfiles("spring-data-jpa") -public class ClinicServiceSpringDataJpaTests extends AbstractClinicServiceTests { - -} \ No newline at end of file diff --git a/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java b/src/test/java/org/springframework/samples/petclinic/service/EntityUtils.java similarity index 97% rename from src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java rename to src/test/java/org/springframework/samples/petclinic/service/EntityUtils.java index a18f65c39..367aff37c 100644 --- a/src/main/java/org/springframework/samples/petclinic/util/EntityUtils.java +++ b/src/test/java/org/springframework/samples/petclinic/service/EntityUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.samples.petclinic.util; +package org.springframework.samples.petclinic.service; import java.util.Collection;