Package org.castor.ddlgen

Examples of org.castor.ddlgen.DDLWriter


        try {
            loadData("single_field_for_all.xml");

            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                DDLWriter writer = new DDLWriter(out, getGenerator().getConfiguration());
               
                getGenerator().generateCreate(writer);
               
                writer.close();
                out.toString();

                fail("bit type is not supported, expected an exception");
            } catch (GeneratorException e) {
                assertTrue(true);
View Full Code Here


                    getSuffixString(conf, PARAM_PREFIX + "javaobject" + PARAM_LENGTH),
                    getSuffixString(conf, PARAM_PREFIX + "blob" + PARAM_LENGTH),
                    getSuffixString(conf, PARAM_PREFIX + "clob" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            getGenerator().generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();
           
            boolean b = getExpected().match(getEngine(), ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + getExpected().getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getStringValue(PARAM_PREFIX + "integer" + PARAM_PRECISION, ""),
                    conf.getStringValue(PARAM_PREFIX + "char" + PARAM_LENGTH, "") };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

    public final void testDropTable() {
        try {
            loadData("drop_table.xml");

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.generateDrop(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, ddl);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();
           
            boolean b = _expected.match(_engine, 0, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, conf);
           
            _generator.generatePrimaryKey(writer);
           
            writer.close();
            ddl = out.toString();
           
            b = _expected.match(_engine, 1, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, 0, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, conf);
           
            _generator.generatePrimaryKey(writer);
           
            writer.close();
            ddl = out.toString();
           
            b = _expected.match(_engine, 1, ddl, null);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();
           
            boolean b = _expected.match(_engine, 0, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, conf);
           
            _generator.generatePrimaryKey(writer);
           
            writer.close();
            ddl = out.toString();
           
            b = _expected.match(_engine, 1, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

            Object[] params = new Object[] {
                    conf.getInteger(PARAM_PREFIX + "integer" + PARAM_PRECISION),
                    conf.getInteger(PARAM_PREFIX + "char" + PARAM_LENGTH) };
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, conf);
           
            _generator.generateCreate(writer);
           
            writer.close();
            String ddl = out.toString();

            boolean b = _expected.match(_engine, 0, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, conf);
           
            _generator.generatePrimaryKey(writer);
           
            writer.close();
            ddl = out.toString();

            b = _expected.match(_engine, 1, ddl, params);
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

TOP

Related Classes of org.castor.ddlgen.DDLWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.