use of liquibase.parser.core.xml.XMLChangeLogSAXParser in project liquibase by liquibase.
the class ChangeLogParserFactoryTest method getExtensionParser.
@Test
public void getExtensionParser() throws Exception {
ChangeLogParserFactory parserFactory = ChangeLogParserFactory.getInstance();
ChangeLogParser defaultParser = parserFactory.getParser("asdf.xml", new JUnitResourceAccessor());
assertNotNull(defaultParser);
assertTrue(defaultParser instanceof XMLChangeLogSAXParser);
ChangeLogParser otherXmlParser = new XMLChangeLogSAXParser() {
@Override
public int getPriority() {
return 100;
}
};
parserFactory.register(otherXmlParser);
try {
assertTrue(otherXmlParser == parserFactory.getParser("asdf.xml", new JUnitResourceAccessor()));
assertFalse(defaultParser == parserFactory.getParser("asdf.xml", new JUnitResourceAccessor()));
} finally {
parserFactory.unregister(otherXmlParser);
}
}
use of liquibase.parser.core.xml.XMLChangeLogSAXParser in project liquibase by liquibase.
the class IntXMLChangeLogSAXParserTest method sampleChangeLogs.
@Test
public void sampleChangeLogs() throws Exception {
new XMLChangeLogSAXParser().parse("changelogs/cache/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/db2/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/derby/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/firebird/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/h2/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/hsqldb/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/maxdb/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/mysql/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/oracle/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/pgsql/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/sybase/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/asany/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
new XMLChangeLogSAXParser().parse("changelogs/unsupported/complete/root.changelog.xml", new ChangeLogParameters(), new JUnitResourceAccessor());
}
use of liquibase.parser.core.xml.XMLChangeLogSAXParser in project liquibase by liquibase.
the class ChangeLogParserFactoryTest method getParser_byExtension.
@Test
public void getParser_byExtension() throws Exception {
ChangeLogParserFactory.getInstance().getParsers().clear();
XMLChangeLogSAXParser xmlChangeLogParser = new XMLChangeLogSAXParser();
ChangeLogParserFactory.getInstance().register(xmlChangeLogParser);
ChangeLogParserFactory.getInstance().register(new SqlChangeLogParser());
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser("xml", new JUnitResourceAccessor());
assertNotNull(parser);
assertTrue(xmlChangeLogParser == parser);
}
Aggregations