use of liquibase.serializer.core.xml.XMLChangeLogSerializer in project liquibase by liquibase.
the class ChangeLogSerializerFactoryTest method unregister_instance.
@Test
public void unregister_instance() {
ChangeLogSerializerFactory factory = ChangeLogSerializerFactory.getInstance();
factory.getSerializers().clear();
assertEquals(0, factory.getSerializers().size());
XMLChangeLogSerializer changeLogSerializer = new XMLChangeLogSerializer();
factory.register(new StringChangeLogSerializer());
factory.register(changeLogSerializer);
assertEquals(2, factory.getSerializers().size());
factory.unregister(changeLogSerializer);
assertEquals(1, factory.getSerializers().size());
}
use of liquibase.serializer.core.xml.XMLChangeLogSerializer in project liquibase by liquibase.
the class ChangeLogSerializerFactoryTest method highestPrioritySerializerReturned.
@Test
public void highestPrioritySerializerReturned() {
ChangeLogSerializerFactory factory = ChangeLogSerializerFactory.getInstance();
XMLChangeLogSerializer highestPriority = new XMLChangeLogSerializer() {
@Override
public int getPriority() {
return super.getPriority() + 4;
}
};
factory.register(highestPriority);
XMLChangeLogSerializer higherPriority = new XMLChangeLogSerializer() {
@Override
public int getPriority() {
return super.getPriority() + 1;
}
};
factory.register(higherPriority);
assertSame(highestPriority, factory.getSerializer("xml"));
assertEquals(3, factory.getSerializers().get("xml").size());
}
Aggregations