Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d838e4eac6ea5cedfc26e691c898c9a379c74a74 (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
56
57
58
59
60
61
62
63
/**
 * <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: JoinColumnsTest.java,v 1.4 2007/02/01 12:36:23 mtaal Exp $
 */

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

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.eclipse.emf.teneo.test.AbstractActionTest;
import org.eclipse.emf.teneo.test.StoreTestException;
import org.eclipse.emf.teneo.test.emf.annotations.JoinColumnsAction;
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 JoinColumnsTest extends AbstractActionTest {

	private static JoinColumnsAction testAction = new JoinColumnsAction() {
		
		/** Checks the version column */
		protected void checkVersion(TestStore store) { 
    		Connection conn = null;
    		Statement stmt = null;
	    	try {
			try {
	    			conn = store.getConnection();
	    			stmt = conn.createStatement();
	    			// check version column name
		    		ResultSet rs = stmt.executeQuery("select myversion from person");
		    		assertTrue(rs.next());
	    		} finally {
	    			if (stmt != null) stmt.close();
	    			if (conn != null) conn.close();
	    		}
	    	} catch (SQLException e) {
	    		throw new StoreTestException("Sql exception when checking db schema", e);
	    	}
		}
	};

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

Back to the top