remove unrelated tests

This commit is contained in:
Dapeng 2016-09-19 16:49:25 +08:00
parent db3fc815be
commit a481ee4a8e
5 changed files with 7 additions and 87 deletions

View file

@ -15,11 +15,6 @@
*/ */
package org.springframework.samples.petclinic.service; 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.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.samples.petclinic.model.Owner; 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.PetType;
import org.springframework.samples.petclinic.model.Vet; import org.springframework.samples.petclinic.model.Vet;
import org.springframework.samples.petclinic.model.Visit; import org.springframework.samples.petclinic.model.Visit;
import org.springframework.samples.petclinic.util.EntityUtils;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Collection;
import java.util.Date;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* <p> Base class for {@link ClinicService} integration tests. </p> <p> Subclasses should specify Spring context * <p> Base class for {@link ClinicService} integration tests. </p> <p> Subclasses should specify Spring context
* configuration using {@link ContextConfiguration @ContextConfiguration} annotation </p> <p> * configuration using {@link ContextConfiguration @ContextConfiguration} annotation </p> <p>
@ -139,7 +138,7 @@ public abstract class AbstractClinicServiceTests {
pet.setName("bowser"); pet.setName("bowser");
Collection<PetType> types = this.clinicService.findPetTypes(); Collection<PetType> types = this.clinicService.findPetTypes();
pet.setType(EntityUtils.getById(types, PetType.class, 2)); pet.setType(EntityUtils.getById(types, PetType.class, 2));
pet.setBirthDate(new DateTime()); pet.setBirthDate(new Date());
owner6.addPet(pet); owner6.addPet(pet);
assertThat(owner6.getPets().size()).isEqualTo(found + 1); assertThat(owner6.getPets().size()).isEqualTo(found + 1);

View file

@ -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;
/**
* <p> Integration test using the jdbc profile.
* @see AbstractClinicServiceTests AbstractClinicServiceTests for more details. </p>
*
* @author Thomas Risberg
* @author Michael Isvy
*/
@ContextConfiguration(locations = {"classpath:spring/business-config.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("jdbc")
public class ClinicServiceJdbcTests extends AbstractClinicServiceTests {
}

View file

@ -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;
/**
* <p> Integration test using the jpa profile.
* @see AbstractClinicServiceTests AbstractClinicServiceTests for more details. </p>
*
* @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 {
}

View file

@ -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;
/**
* <p> Integration test using the 'Spring Data' profile.
* @see AbstractClinicServiceTests AbstractClinicServiceTests for more details. </p>
* @author Michael Isvy
*/
@ContextConfiguration(locations = {"classpath:spring/business-config.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("spring-data-jpa")
public class ClinicServiceSpringDataJpaTests extends AbstractClinicServiceTests {
}

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.samples.petclinic.util; package org.springframework.samples.petclinic.service;
import java.util.Collection; import java.util.Collection;