Package liquibase.database.core

Examples of liquibase.database.core.HsqlDatabase


public class VarcharTypeTest {

    @Test
    public void varchar2ForHsqldbInOracleSyntaxMode() {
        VarcharType type = new VarcharType();
        HsqlDatabase hsqlDatabase = mock(HsqlDatabase.class);
        when(hsqlDatabase.isUsingOracleSyntax()).thenReturn(true);
        DatabaseDataType databaseDataType = type.toDatabaseDataType(hsqlDatabase);
        assertEquals("VARCHAR2", databaseDataType.getType().toUpperCase());
    }
View Full Code Here


    }

    @Test
    public void varcharForHsqldbNotInOracleSyntaxMode() {
        VarcharType type = new VarcharType();
        HsqlDatabase hsqlDatabase = mock(HsqlDatabase.class);
        when(hsqlDatabase.isUsingOracleSyntax()).thenReturn(false);
        DatabaseDataType databaseDataType = type.toDatabaseDataType(hsqlDatabase);
        assertEquals("VARCHAR", databaseDataType.getType().toUpperCase());
    }
View Full Code Here

    @Override
    protected Map<String, Object> createExampleValueMetaData(String parameterName, DatabaseChangeProperty changePropertyAnnotation) {

        if (parameterName.equals("procedureText") || parameterName.equals("procedureBody")) {
            Map<String, Object> returnMap = super.createExampleValueMetaData(parameterName, changePropertyAnnotation);
            returnMap.put(new HsqlDatabase().getShortName(), "CREATE PROCEDURE new_customer(firstname VARCHAR(50), lastname VARCHAR(50))\n" +
                    "   MODIFIES SQL DATA\n" +
                    "   INSERT INTO CUSTOMERS (first_name, last_name) VALUES (firstname, lastname)");

            return returnMap;
        } else {
View Full Code Here

    @Before
    public void setUp() throws Exception {
        Class.forName("org.hsqldb.jdbc.JDBCDriver");
        connection = DriverManager.getConnection("jdbc:hsqldb:mem:TESTDB" + System.currentTimeMillis(), "SA", "");
        database = new HsqlDatabase();
        database.setConnection(new JdbcConnection(connection));

//        Class.forName("com.mysql.jdbc.Driver");
//        connection = DriverManager.getConnection("jdbc:mysql://10.10.100.100/liquibase", "liquibase", "liquibase");
//        database = new MySQLDatabase();
View Full Code Here

        log.info(stringWriter.toString());
        liquibase.update((String) null);

        long currentTimeMillis = System.currentTimeMillis();
        Connection connection2 = DriverManager.getConnection("jdbc:hsqldb:mem:TESTDB2" + currentTimeMillis, "SA", "");
        Database database2 = new HsqlDatabase();
        database2.setConnection(new JdbcConnection(connection2));

        Configuration cfg = new Configuration();
        cfg.configure(HIBERNATE_CONFIG_FILE);
        cfg.getProperties().remove(Environment.DATASOURCE);
        cfg.setProperty(Environment.URL, "jdbc:hsqldb:mem:TESTDB2" + currentTimeMillis);
View Full Code Here

        public Set<InputStream> getResourcesAsStream(String path) throws IOException {
            InputStream stream = null;
            if (path.toLowerCase().endsWith("csv")) {
                stream = new ByteArrayInputStream(usersCsv.getBytes());
            } else if (path.toLowerCase().endsWith("my-logic.sql")) {
                stream = new ByteArrayInputStream(((String)ChangeFactory.getInstance().getChangeMetaData(new CreateProcedureChange()).getParameters().get("procedureBody").getExampleValue(new HsqlDatabase())).getBytes());
            } else if (path.toLowerCase().endsWith("sql")) {
                stream =new ByteArrayInputStream(fileSql.getBytes());
            } else {
                throw new RuntimeException("Unknown resource type: "+ path);
            }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        Class.forName("org.hsqldb.jdbc.JDBCDriver");
        connection = DriverManager.getConnection("jdbc:hsqldb:mem:TESTDB" + System.currentTimeMillis()+"-"+(run++), "SA", "");
        database = new HsqlDatabase();
        database.setConnection(new JdbcConnection(connection));

        Set<Class<? extends DatabaseObject>> typesToInclude = new HashSet<Class<? extends DatabaseObject>>();
        typesToInclude.add(Table.class);
        typesToInclude.add(Column.class);
View Full Code Here

        log.info(stringWriter.toString());
        liquibase.update((String) null);

        long currentTimeMillis = System.currentTimeMillis();
        Connection connection2 = DriverManager.getConnection("jdbc:hsqldb:mem:TESTDB2" + currentTimeMillis, "SA", "");
        Database database2 = new HsqlDatabase();
        database2.setConnection(new JdbcConnection(connection2));

        Configuration cfg = createSpringPackageScanningConfiguration(enhancedId);
        cfg.setProperty("hibernate.connection.url", "jdbc:hsqldb:mem:TESTDB2" + currentTimeMillis);

        SchemaUpdate update = new SchemaUpdate(cfg);
View Full Code Here

TOP

Related Classes of liquibase.database.core.HsqlDatabase

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.