use of liquibase.test.JUnitResourceAccessor 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.test.JUnitResourceAccessor 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 {
assertSame(otherXmlParser, parserFactory.getParser("asdf.xml", new JUnitResourceAccessor()));
assertNotSame(defaultParser, parserFactory.getParser("asdf.xml", new JUnitResourceAccessor()));
} finally {
parserFactory.unregister(otherXmlParser);
}
}
use of liquibase.test.JUnitResourceAccessor in project liquibase by liquibase.
the class ChangeLogParserFactoryTest method getParsers.
@Test
public void getParsers() throws Exception {
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser("asdf.xml", new JUnitResourceAccessor());
assertNotNull(parser);
assertTrue(parser instanceof XMLChangeLogSAXParser);
}
use of liquibase.test.JUnitResourceAccessor in project liquibase by liquibase.
the class ChangeLogParserFactoryTest method getParser_byFile.
@Test
public void getParser_byFile() throws Exception {
ChangeLogParserFactory.getInstance().unregisterAllParsers();
assumeThat(ChangeLogParserFactory.getInstance().getParsers(), empty());
XMLChangeLogSAXParser xmlChangeLogParser = new XMLChangeLogSAXParser();
ChangeLogParserFactory.getInstance().register(xmlChangeLogParser);
ChangeLogParserFactory.getInstance().register(new SqlChangeLogParser());
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser("path/to/a/file.xml", new JUnitResourceAccessor());
assertNotNull(parser);
assertSame(xmlChangeLogParser, parser);
}
use of liquibase.test.JUnitResourceAccessor in project liquibase by liquibase.
the class ChangeLogParserFactoryTest method getParser_noneMatching.
@Test(expected = UnknownChangelogFormatException.class)
public void getParser_noneMatching() throws Exception {
ChangeLogParserFactory.getInstance().unregisterAllParsers();
XMLChangeLogSAXParser xmlChangeLogParser = new XMLChangeLogSAXParser();
ChangeLogParserFactory.getInstance().register(xmlChangeLogParser);
ChangeLogParserFactory.getInstance().register(new SqlChangeLogParser());
ChangeLogParserFactory.getInstance().getParser("badextension", new JUnitResourceAccessor());
}
Aggregations