Skip to main content
summaryrefslogtreecommitdiffstats
blob: 9c9fbf96c5cb2ae27de0f315dac2d61014296f7d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
 * <copyright>
 *
 * Copyright (c) 2005, 2006, 2007 Springsite BV (The Netherlands) and others
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Martin Taal
 * </copyright>
 *
 * $Id: CapaTest.java,v 1.4 2007/02/01 12:36:24 mtaal Exp $
 */

package org.eclipse.emf.teneo.hibernate.test.emf.sample;

import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
import org.eclipse.emf.teneo.samples.emf.sample.capa.CapaFactory;
import org.eclipse.emf.teneo.samples.emf.sample.capa.MachineList;
import org.eclipse.emf.teneo.test.AbstractActionTest;
import org.eclipse.emf.teneo.test.emf.sample.CapaAction;
import org.eclipse.emf.teneo.test.stores.TestStore;
import org.hibernate.Session;

/**
 * Tests the capa sample to reattach an object
 * 
 * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
 * @version $Revision: 1.4 $
 */
public class CapaTest extends AbstractActionTest {

	private static CapaAction testAction = new CapaAction() {
		
		/** Reattach machinelist and check */
		protected void checkReAttach(CapaFactory factory, TestStore store, MachineList ml) {
			final HibernateTestStore hts = (HibernateTestStore)store;
			hts.refresh();
			hts.beginTransaction();
			final Session sess = hts.getSession();
			sess.update(ml);
	        ml.getMachines().add(getNewMachine(factory, "test"));
			
			//ml.getMachines().add(getNewMachine(factory, "id4"));
			hts.commitTransaction();
		}

	};

	public CapaTest() {
		super(testAction);
	}
}

Back to the top