01: /*
02: * Copyright 2006 Le Duc Bao, Ralf Joachim
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package org.castor.ddlgen;
17:
18: import junit.framework.Test;
19: import junit.framework.TestCase;
20: import junit.framework.TestSuite;
21:
22: import org.castor.ddlgen.engine.mysql.MysqlGenerator;
23:
24: /**
25: * Test GeneratorFactory
26: *
27: * @author <a href="mailto:leducbao AT gmail DOT com">Le Duc Bao</a>
28: * @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
29: * @version $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
30: * @since 1.1
31: */
32: public final class GeneratorFactoryTest extends TestCase {
33:
34: /**
35: * Constructor for GeneratorFactoryTest
36: * @param testcase test case
37: */
38: public GeneratorFactoryTest(final String testcase) {
39: super (testcase);
40: }
41:
42: /**
43: * {@inheritDoc}
44: */
45: protected void setUp() throws Exception {
46: super .setUp();
47: }
48:
49: /**
50: * {@inheritDoc}
51: */
52: protected void tearDown() throws Exception {
53: super .tearDown();
54: }
55:
56: /**
57: * test get mysql ddl generator
58: */
59: public void testGetMySQLDDLGenerator() {
60:
61: try {
62: MysqlGenerator generator = (MysqlGenerator) GeneratorFactory
63: .createDDLGenerator("mysql", null, null);
64: assertEquals(generator.getClass(), MysqlGenerator.class);
65: } catch (GeneratorException e) {
66: assertTrue(e.getMessage(), false);
67: }
68: }
69:
70: /**
71: *
72: * @return Test
73: * @throws Exception exception
74: */
75: public static Test suite() throws Exception {
76: TestSuite suite = new TestSuite("DDL generator factory tests");
77: suite.addTest(new GeneratorFactoryTest(
78: "testGetMySQLDDLGenerator"));
79:
80: return suite;
81: }
82:
83: }
|