use of org.apache.cayenne.dbsync.merge.token.model.AddColumnToModel in project cayenne by apache.
the class DefaultDbImportActionTest method testMergeTokensSorting.
@Test
public void testMergeTokensSorting() {
LinkedList<MergerToken> tokens = new LinkedList<MergerToken>();
tokens.add(new AddColumnToModel(null, null));
tokens.add(new AddRelationshipToModel(null, null));
tokens.add(new CreateTableToDb(null));
tokens.add(new CreateTableToModel(null));
assertEquals(asList("CreateTableToDb", "CreateTableToModel", "AddColumnToModel", "AddRelationshipToModel"), toClasses(DefaultDbImportAction.sort(tokens)));
}
use of org.apache.cayenne.dbsync.merge.token.model.AddColumnToModel in project cayenne by apache.
the class TokenSortTest method testToModelTokensCompare.
@Test
public void testToModelTokensCompare() throws Exception {
List<MergerToken> tokens = Arrays.<MergerToken>asList(new DropColumnToModel(null, null), new DropRelationshipToModel(null, null), new DropTableToModel(null), new AddColumnToDb(null, null), new AddRelationshipToModel(null, null), new AddColumnToModel(null, null), new CreateTableToModel(null));
Collections.sort(tokens);
List<String> actual = toClassesNames(tokens);
List<String> expected = Arrays.asList("DropRelationshipToModel", "DropColumnToModel", "DropTableToModel", "CreateTableToModel", "AddColumnToDb", "AddColumnToModel", "AddRelationshipToModel");
assertEquals(expected, actual);
}
use of org.apache.cayenne.dbsync.merge.token.model.AddColumnToModel in project cayenne by apache.
the class TokenSortTest method testSortStability.
@Test
public void testSortStability() throws Exception {
List<MergerToken> tokens = Arrays.<MergerToken>asList(new AddRelationshipToModel(null, null), new AddColumnToModel(null, null), new AddColumnToDb(null, null), new CreateTableToModel(null), new DropTableToModel(null), new DropColumnToModel(null, null), new DropRelationshipToModel(null, null));
Collections.sort(tokens);
List<String> actual = toClassesNames(tokens);
List<String> expected = Arrays.asList("DropRelationshipToModel", "DropColumnToModel", "DropTableToModel", "CreateTableToModel", "AddColumnToDb", "AddColumnToModel", "AddRelationshipToModel");
assertEquals(expected, actual);
Collections.sort(tokens);
actual = toClassesNames(tokens);
assertEquals(expected, actual);
List<MergerToken> tokens2 = Arrays.<MergerToken>asList(new AddColumnToModel(null, null), new AddRelationshipToModel(null, null), new CreateTableToModel(null), new AddColumnToDb(null, null), new DropColumnToModel(null, null), new DropRelationshipToModel(null, null), new DropTableToModel(null));
Collections.sort(tokens2);
actual = toClassesNames(tokens);
assertEquals(expected, actual);
}
use of org.apache.cayenne.dbsync.merge.token.model.AddColumnToModel in project cayenne by apache.
the class TokenSortTest method testToDbTokensCompare.
@Test
public void testToDbTokensCompare() throws Exception {
List<MergerToken> tokens = Arrays.<MergerToken>asList(new DropColumnToDb(null, null), new DropRelationshipToDb(null, null), new DropTableToDb(null), new AddColumnToModel(null, null), new AddRelationshipToDb(null, null), new AddColumnToDb(null, null), new CreateTableToDb(null));
Collections.sort(tokens);
List<String> actual = toClassesNames(tokens);
List<String> expected = Arrays.asList("DropRelationshipToDb", "DropColumnToDb", "DropTableToDb", "CreateTableToDb", "AddColumnToDb", "AddColumnToModel", "AddRelationshipToDb");
assertEquals(expected, actual);
}
Aggregations