Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f8c9bfedf9ee26bd14d9e30f1c56ef237d4eb05a (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
/**
 * <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: PlayImExportTest.java,v 1.4 2007/02/01 12:36:24 mtaal Exp $
 */

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

import java.io.InputStream;
import java.io.OutputStream;

import org.eclipse.emf.teneo.hibernate.HbConstants;
import org.eclipse.emf.teneo.hibernate.HbDataStore;
import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
import org.eclipse.emf.teneo.test.AbstractActionTest;
import org.eclipse.emf.teneo.test.emf.sample.PlayImExportAction;
import org.eclipse.emf.teneo.test.stores.TestStore;

/**
 * Tests import export
 * 
 * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
 * @version $Revision: 1.4 $
 */
public class PlayImExportTest extends AbstractActionTest {

	private static PlayImExportAction testAction = new PlayImExportAction() {

		/** Import/export, from and to */
		protected void imExport(InputStream is, OutputStream os, TestStore store) {
			// import
			HibernateTestStore hbTestStore = (HibernateTestStore) store;
			HbDataStore ds = hbTestStore.getEmfDataStore();
			ds.importDataStore(is, HbConstants.EXCHANGE_FORMAT_XML);

			// export
			ds.exportDataStore(os, HbConstants.EXCHANGE_FORMAT_XML, null);
		}
	};

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

Back to the top