Package org.castor.ddlgen

Examples of org.castor.ddlgen.DDLWriter


            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.generateForeignKey(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.generateForeignKey(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.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

    public final void testNoField() {
        try {
            loadData("no_field.xml");

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.generateCreate(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, 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

            DDLGenConfiguration conf = _generator.getConfiguration();

            conf.setProperty(DDLGenConfiguration.SCHEMA_NAME_KEY, "test");
           
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.getSchema().toCreateDDL(writer);
           
            writer.close();
            String ddl = out.toString();
           
            boolean b = _expected.match(_engine, 0, ddl, new String[] {"test"});
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);

            conf.setProperty(DDLGenConfiguration.SCHEMA_NAME_KEY, "");
           
            out = new ByteArrayOutputStream();
            writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.getSchema().toCreateDDL(writer);
           
            writer.close();
            ddl = out.toString();
           
            b = _expected.match(_engine, 1, ddl, new String[] {});
            assertTrue("Generated DDL: " + ddl + "\n"
                     + "Expected DDL: " + _expected.getLastMatchString(), b);
View Full Code Here

    public final void testCreateIndex() {
        try {
            loadData("index_creation.xml");

            ByteArrayOutputStream out = new ByteArrayOutputStream();
            DDLWriter writer = new DDLWriter(out, _generator.getConfiguration());
           
            _generator.generateIndex(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

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.