Search in sources :

Example 1 with RegexMatcher

use of liquibase.util.RegexMatcher in project liquibase by liquibase.

the class AbstractIntegrationTest method testEncodingUpdating2SQL.

@Test
public void testEncodingUpdating2SQL() throws Exception {
    if (database == null) {
        return;
    }
    Liquibase liquibase = createLiquibase(encodingChangeLog);
    StringWriter writer = new StringWriter();
    liquibase.update(this.contexts, writer);
    assertTrue("Update to SQL preserves encoding", new RegexMatcher(writer.toString(), new String[] { //For the UTF-8 encoded cvs
    "^.*INSERT.*VALUES.*àèìòùáéíóúÀÈÌÒÙÁÉÍÓÚâêîôûäëïöü.*$", "çñ®", //For the latin1 one
    "^.*INSERT.*VALUES.*àèìòùáéíóúÀÈÌÒÙÁÉÍÓÚâêîôûäëïöü.*$", "çñ®" }).allMatchedInSequentialOrder());
}
Also used : Liquibase(liquibase.Liquibase) RegexMatcher(liquibase.util.RegexMatcher) Test(org.junit.Test)

Aggregations

Liquibase (liquibase.Liquibase)1 RegexMatcher (liquibase.util.RegexMatcher)1 Test (org.junit.Test)1