Search in sources :

Example 1 with ChangeLogParserFactory

use of liquibase.parser.ChangeLogParserFactory in project liquibase by liquibase.

the class ChangeLogParserFactoryTest method unregister_instance.

@Test
public void unregister_instance() {
    ChangeLogParserFactory factory = ChangeLogParserFactory.getInstance();
    factory.getParsers().clear();
    assertEquals(0, factory.getParsers().size());
    ChangeLogParser mockChangeLogParser = new MockChangeLogParser();
    factory.register(new XMLChangeLogSAXParser());
    factory.register(mockChangeLogParser);
    factory.register(new SqlChangeLogParser());
    assertEquals(3, factory.getParsers().size());
    factory.unregister(mockChangeLogParser);
    assertEquals(2, factory.getParsers().size());
}
Also used : SqlChangeLogParser(liquibase.parser.core.sql.SqlChangeLogParser) ChangeLogParserFactory(liquibase.parser.ChangeLogParserFactory) SqlChangeLogParser(liquibase.parser.core.sql.SqlChangeLogParser) ChangeLogParser(liquibase.parser.ChangeLogParser) XMLChangeLogSAXParser(liquibase.parser.core.xml.XMLChangeLogSAXParser) Test(org.junit.Test)

Example 2 with ChangeLogParserFactory

use of liquibase.parser.ChangeLogParserFactory in project liquibase by liquibase.

the class ChangeLogParserFactoryTest method reset.

@Test
public void reset() {
    ChangeLogParserFactory instance1 = ChangeLogParserFactory.getInstance();
    ChangeLogParserFactory.reset();
    assertFalse(instance1 == ChangeLogParserFactory.getInstance());
}
Also used : ChangeLogParserFactory(liquibase.parser.ChangeLogParserFactory) Test(org.junit.Test)

Aggregations

ChangeLogParserFactory (liquibase.parser.ChangeLogParserFactory)2 Test (org.junit.Test)2 ChangeLogParser (liquibase.parser.ChangeLogParser)1 SqlChangeLogParser (liquibase.parser.core.sql.SqlChangeLogParser)1 XMLChangeLogSAXParser (liquibase.parser.core.xml.XMLChangeLogSAXParser)1