2 Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 package testsuite.clusterj;
20 import com.mysql.clusterj.ClusterJUserException;
21 import testsuite.clusterj.model.BadEmployeeWrongPrimaryKeyAnnotationOnClass;
22 import testsuite.clusterj.model.BadEmployeeNoPrimaryKeyAnnotationOnClass;
23 import testsuite.clusterj.model.BadEmployeePrimaryKeyAnnotationColumnAndColumns;
24 import testsuite.clusterj.model.BadEmployeePrimaryKeyAnnotationNoColumnOrColumns;
25 import testsuite.clusterj.model.BadEmployeePrimaryKeyAnnotationOnClassMisspelledField;
26 import testsuite.clusterj.model.BadIndexDuplicateColumn;
27 import testsuite.clusterj.model.BadIndexDuplicateIndexName;
28 import testsuite.clusterj.model.BadIndexMissingColumn;
30 public class NegativeMetadataTest extends AbstractClusterJModelTest {
33 public void localSetUp() {
34 createSessionFactory();
35 session = sessionFactory.getSession();
39 // doTestFor(BadEmployeeNoPrimaryKeyAnnotationOnClass.class);
40 // doTestFor(BadEmployeePrimaryKeyAnnotationOnClassMisspelledField.class);
41 // doTestFor(BadEmployeeWrongPrimaryKeyAnnotationOnClass.class);
42 // doTestFor(BadEmployeePrimaryKeyAnnotationColumnAndColumns.class);
43 // doTestFor(BadEmployeePrimaryKeyAnnotationNoColumnOrColumns.class);
44 // doTestFor(BadIndexDuplicateIndexName.class);
45 // doTestFor(BadIndexMissingColumn.class);
46 // doTestFor(BadIndexDuplicateColumn.class);
50 public void doTestFor(Class<?> cls) {
52 session.newInstance(cls);
53 error("failed to throw exception for " + cls.getName());
54 } catch (ClusterJUserException ex) {
57 System.out.println(ex.getMessage());