Project

General

Profile

« Previous | Next » 

Revision a784f00f

Added by Katja Luther about 14 years ago

merge cate-development2 branch with trunk

View differences:

cdmlib-persistence/src/test/java/eu/etaxonomy/cdm/persistence/hibernate/CdmDeleteListenerTest.java
12 12

  
13 13
import static org.junit.Assert.assertNotNull;
14 14

  
15
import java.io.FileOutputStream;
15 16
import java.util.Set;
16 17
import java.util.UUID;
17 18

  
......
23 24
import org.unitils.dbunit.annotation.DataSet;
24 25
import org.unitils.dbunit.annotation.ExpectedDataSet;
25 26
import org.unitils.spring.annotation.SpringBeanByType;
27
import org.springframework.security.core.context.SecurityContextHolder;
28
import org.hibernate.LockMode;
26 29

  
27 30
import eu.etaxonomy.cdm.model.name.HybridRelationship;
28 31
import eu.etaxonomy.cdm.model.name.NameRelationship;
......
50 53
	 */
51 54
	@Before
52 55
	public void setUp() throws Exception {
53
		uuid = UUID.fromString("a49a3963-c4ea-4047-8588-2f8f15352730");
56
		uuid = UUID.fromString("44415fc0-1703-11df-8a39-0800200c9a66");
54 57
	}
55 58
	
56 59
	/**
......
59 62
	@Test
60 63
	@DataSet("CdmDeleteListenerTest.xml")
61 64
	@ExpectedDataSet
62
	public void testOnDelete() {
65
	public void testOnDelete() throws Exception {
63 66
		NonViralName name = (NonViralName)taxonNameDao.findByUuid(uuid);
67
		/**
68
		 * Ended up with some horrible hibernate errors otherwise
69
		 */
70
		taxonNameDao.refresh(name, LockMode.READ, null);
64 71
		assertNotNull(name);
65 72
		Set<NameRelationship> relations = name.getNameRelations();
66 73
		Assert.assertEquals("There must be 1 name relationship", 1, relations.size());

Also available in: Unified diff