01: /*
02: * OracleConstraintReaderTest.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db.oracle;
13:
14: import junit.framework.TestCase;
15:
16: /**
17: *
18: * @author support@sql-workbench.net
19: */
20: public class OracleConstraintReaderTest extends TestCase {
21:
22: public OracleConstraintReaderTest(String testName) {
23: super (testName);
24: }
25:
26: protected void setUp() throws Exception {
27: super .setUp();
28: }
29:
30: protected void tearDown() throws Exception {
31: super .tearDown();
32: }
33:
34: public void testIsDefaultNNConstraint() {
35: OracleConstraintReader instance = new OracleConstraintReader();
36: String definition = "\"MY_COL\" IS NOT NULL";
37: boolean result = instance.isDefaultNNConstraint(definition);
38: assertEquals("Default NN not recognized", true, result);
39:
40: definition = "\"MY_COL\" IS NOT NULL OR COL2 IS NOT NULL";
41: result = instance.isDefaultNNConstraint(definition);
42: assertEquals("Default NN not recognized", false, result);
43:
44: }
45:
46: }
|