01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.derbyTesting.functionTests.tests.jdbc4;
21:
22: import java.sql.DatabaseMetaData;
23: import java.sql.Types;
24: import org.apache.derby.shared.common.reference.JDBC40Translation;
25: import org.apache.derbyTesting.junit.BaseJDBCTestCase;
26: import org.apache.derbyTesting.junit.BaseTestCase;
27:
28: /**
29: * JUnit test which checks that the constants in JDBC40Translation are
30: * correct. Each constant in JDBC40Translation should have a test
31: * method comparing it to the value in the java.sql interface.
32: */
33: public class JDBC40TranslationTest extends BaseTestCase {
34:
35: public JDBC40TranslationTest(String name) {
36: super (name);
37: }
38:
39: public void testDatabaseMetaDataFUNCTION_PARAMETER_UNKNOWN() {
40: assertEquals(DatabaseMetaData.functionColumnUnknown,
41: JDBC40Translation.FUNCTION_PARAMETER_UNKNOWN);
42: }
43:
44: public void testDatabaseMetaDataFUNCTION_PARAMETER_IN() {
45: assertEquals(DatabaseMetaData.functionColumnIn,
46: JDBC40Translation.FUNCTION_PARAMETER_IN);
47: }
48:
49: public void testDatabaseMetaDataFUNCTION_PARAMETER_INOUT() {
50: assertEquals(DatabaseMetaData.functionColumnInOut,
51: JDBC40Translation.FUNCTION_PARAMETER_INOUT);
52: }
53:
54: public void testDatabaseMetaDataFUNCTION_RETURN() {
55: assertEquals(DatabaseMetaData.functionReturn,
56: JDBC40Translation.FUNCTION_RETURN);
57: }
58:
59: public void testDatabaseMetaDataFUNCTION_NO_NULLS() {
60: assertEquals(DatabaseMetaData.functionNoNulls,
61: JDBC40Translation.FUNCTION_NO_NULLS);
62: }
63:
64: public void testDatabaseMetaDataFUNCTION_NULLABLE() {
65: assertEquals(DatabaseMetaData.functionNullable,
66: JDBC40Translation.FUNCTION_NULLABLE);
67: }
68:
69: public void testDatabaseMetaDataFUNCTION_NULLABLE_UNKNOWN() {
70: assertEquals(DatabaseMetaData.functionNullableUnknown,
71: JDBC40Translation.FUNCTION_NULLABLE_UNKNOWN);
72: }
73:
74: public void testTypesNCHAR() {
75: assertEquals(Types.NCHAR, JDBC40Translation.NCHAR);
76: }
77:
78: public void testTypesNVARCHAR() {
79: assertEquals(Types.NVARCHAR, JDBC40Translation.NVARCHAR);
80: }
81:
82: public void testTypesLONGNVARCHAR() {
83: assertEquals(Types.LONGNVARCHAR, JDBC40Translation.LONGNVARCHAR);
84: }
85:
86: public void testTypesNCLOB() {
87: assertEquals(Types.NCLOB, JDBC40Translation.NCLOB);
88: }
89:
90: public void testTypesROWID() {
91: assertEquals(Types.ROWID, JDBC40Translation.ROWID);
92: }
93:
94: public void testTypesSQLXML() {
95: assertEquals(Types.SQLXML, JDBC40Translation.SQLXML);
96: }
97: }
|