diff options
author | bvosburgh | 2009-12-19 06:03:32 +0000 |
---|---|---|
committer | bvosburgh | 2009-12-19 06:03:32 +0000 |
commit | 6861c95c872f3fbb682c03acc120125cf8608c18 (patch) | |
tree | 912a086668f4997d473567fdef10b037fb6e9998 /jpa/tests/org.eclipse.jpt.db.tests/src/org | |
parent | 40d0f8e56c2e5dad270f3cb5821fc0d0af1f9509 (diff) | |
download | webtools.dali-6861c95c872f3fbb682c03acc120125cf8608c18.tar.gz webtools.dali-6861c95c872f3fbb682c03acc120125cf8608c18.tar.xz webtools.dali-6861c95c872f3fbb682c03acc120125cf8608c18.zip |
[258541] JPA 2.0 default delimited identifiers - model
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.db.tests/src/org')
6 files changed, 101 insertions, 101 deletions
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java index 8e59babc5f..ea25a8592d 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java @@ -48,7 +48,7 @@ import org.eclipse.jpt.db.ConnectionProfile; import org.eclipse.jpt.db.ConnectionProfileFactory; import org.eclipse.jpt.db.ConnectionProfileListener; import org.eclipse.jpt.db.Database; -import org.eclipse.jpt.db.DatabaseFinder; +import org.eclipse.jpt.db.DatabaseIdentifierAdapter; import org.eclipse.jpt.db.ForeignKey; import org.eclipse.jpt.db.JptDbPlugin; import org.eclipse.jpt.db.Schema; @@ -115,7 +115,7 @@ public abstract class DTPPlatformTests extends TestCase { this.platformProperties = this.loadPlatformProperties(); this.buildDTPDriverDefinitionFile(); this.buildDTPConnectionProfile(); - this.connectionProfile = this.getConnectionProfileFactory().buildConnectionProfile(this.getProfileName(), DatabaseFinder.Default.instance()); + this.connectionProfile = this.getConnectionProfileFactory().buildConnectionProfile(this.getProfileName(), DatabaseIdentifierAdapter.Default.instance()); } @Override @@ -367,15 +367,15 @@ public abstract class DTPPlatformTests extends TestCase { private void verifyDatabaseContent() { Database database = this.connectionProfile.getDatabase(); - assertTrue(database.schemataSize() >= 0); + assertTrue(database.getSchemataSize() >= 0); Schema schema = database.getDefaultSchema(); if (schema != null) { - if (schema.tablesSize() > 0) { - Table table = schema.tables().next(); - assertTrue(table.columnsSize() >= 0); - assertTrue(table.primaryKeyColumnsSize() >= 0); - assertTrue(table.foreignKeysSize() >= 0); + if (schema.getTablesSize() > 0) { + Table table = schema.getTables().iterator().next(); + assertTrue(table.getColumnsSize() >= 0); + assertTrue(table.getPrimaryKeyColumnsSize() >= 0); + assertTrue(table.getForeignKeysSize() >= 0); } } } @@ -511,7 +511,7 @@ public abstract class DTPPlatformTests extends TestCase { schema = this.getDatabase().getSchemaNamed(dtpSchema.getName()); } } - assertTrue(schema.tablesSize() >= 0); // force tables to be loaded + assertTrue(schema.getTablesSize() >= 0); // force tables to be loaded ((ICatalogObject) dtpSchema).refresh(); assertSame(schema, listener.changedSchema); @@ -527,11 +527,11 @@ public abstract class DTPPlatformTests extends TestCase { boolean supportsCatalogs = this.supportsCatalogs(); assertEquals(supportsCatalogs, this.connectionProfile.getDatabase().supportsCatalogs()); if (supportsCatalogs) { - assertTrue(this.connectionProfile.getDatabase().catalogsSize() > 0); - assertEquals(0, this.connectionProfile.getDatabase().schemataSize()); + assertTrue(this.connectionProfile.getDatabase().getCatalogsSize() > 0); + assertEquals(0, this.connectionProfile.getDatabase().getSchemataSize()); } else { - assertEquals(0, this.connectionProfile.getDatabase().catalogsSize()); - assertTrue(this.connectionProfile.getDatabase().schemataSize() > 0); + assertEquals(0, this.connectionProfile.getDatabase().getCatalogsSize()); + assertTrue(this.connectionProfile.getDatabase().getSchemataSize() > 0); } this.connectionProfile.removeConnectionListener(listener); @@ -782,8 +782,8 @@ public abstract class DTPPlatformTests extends TestCase { pw.print("database: "); pw.println(database.getName()); if (database.supportsCatalogs()) { - for (Iterator<Catalog> stream = database.catalogs(); stream.hasNext(); ) { - this.dumpCatalogOn(stream.next(), pw, deep); + for (Catalog catalog : database.getCatalogs()) { + this.dumpCatalogOn(catalog, pw, deep); } } else { this.dumpSchemaContainerOn(database, pw, deep); @@ -799,8 +799,8 @@ public abstract class DTPPlatformTests extends TestCase { } protected void dumpSchemaContainerOn(SchemaContainer schemaContainer, IndentingPrintWriter pw, boolean deep) { - for (Iterator<Schema> stream = schemaContainer.schemata(); stream.hasNext(); ) { - this.dumpSchemaOn(stream.next(), pw, deep); + for (Schema schema : schemaContainer.getSchemata()) { + this.dumpSchemaOn(schema, pw, deep); } } @@ -822,11 +822,11 @@ public abstract class DTPPlatformTests extends TestCase { pw.println(schema.getName()); if (deep) { pw.indent(); - for (Iterator<Table> stream = schema.tables(); stream.hasNext(); ) { - this.dumpTableOn(stream.next(), pw); + for (Table table : schema.getTables()) { + this.dumpTableOn(table, pw); } - for (Iterator<Sequence> stream = schema.sequences(); stream.hasNext(); ) { - this.dumpSequenceOn(stream.next(), pw); + for (Sequence sequence : schema.getSequences()) { + this.dumpSequenceOn(sequence, pw); } pw.undent(); } @@ -836,11 +836,11 @@ public abstract class DTPPlatformTests extends TestCase { pw.print("table: "); pw.println(table.getName()); pw.indent(); - for (Iterator<Column> stream = table.columns(); stream.hasNext(); ) { - this.dumpColumnOn(stream.next(), pw); + for (Column column : table.getColumns()) { + this.dumpColumnOn(column, pw); } - for (Iterator<ForeignKey> stream = table.foreignKeys(); stream.hasNext(); ) { - this.dumpForeignKeyOn(stream.next(), pw); + for (ForeignKey foreignKey : table.getForeignKeys()) { + this.dumpForeignKeyOn(foreignKey, pw); } pw.undent(); } @@ -862,7 +862,7 @@ public abstract class DTPPlatformTests extends TestCase { pw.print("=>"); pw.print(foreignKey.getReferencedTable().getName()); pw.print(" ("); - for (Iterator<ColumnPair> stream = foreignKey.columnPairs(); stream.hasNext(); ) { + for (Iterator<ColumnPair> stream = foreignKey.getColumnPairs().iterator(); stream.hasNext(); ) { ColumnPair cp = stream.next(); pw.print(cp.getBaseColumn().getName()); pw.print("=>"); diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java index e2aacd8656..d410cc790a 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java @@ -225,9 +225,9 @@ public class DerbyTests extends DTPPlatformTests { // FOO Table fooTable = schema.getTableNamed("FOO"); - assertEquals(4, fooTable.columnsSize()); - assertEquals(1, fooTable.primaryKeyColumnsSize()); - assertEquals(1, fooTable.foreignKeysSize()); + assertEquals(4, fooTable.getColumnsSize()); + assertEquals(1, fooTable.getPrimaryKeyColumnsSize()); + assertEquals(1, fooTable.getForeignKeysSize()); Column pkColumn = fooTable.getPrimaryKeyColumn(); assertEquals("ID", pkColumn.getName()); @@ -260,8 +260,8 @@ public class DerbyTests extends DTPPlatformTests { assertEquals(2, salaryColumn.getScale()); assertEquals(-1, salaryColumn.getLength()); - ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key - assertEquals(1, barFK.columnPairsSize()); + ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key + assertEquals(1, barFK.getColumnPairsSize()); assertEquals("BAR", barFK.getAttributeName()); assertNull(barFK.getJoinColumnAnnotationIdentifier("bar")); assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar")); @@ -272,9 +272,9 @@ public class DerbyTests extends DTPPlatformTests { // BAR Table barTable = schema.getTableNamed("BAR"); - assertEquals(3, barTable.columnsSize()); - assertEquals(1, barTable.primaryKeyColumnsSize()); - assertEquals(0, barTable.foreignKeysSize()); + assertEquals(3, barTable.getColumnsSize()); + assertEquals(1, barTable.getPrimaryKeyColumnsSize()); + assertEquals(0, barTable.getForeignKeysSize()); assertEquals("ID", barTable.getPrimaryKeyColumn().getName()); assertFalse(barTable.isPossibleJoinTable()); @@ -298,9 +298,9 @@ public class DerbyTests extends DTPPlatformTests { // FOO_BAZ Table foo_bazTable = schema.getTableNamed("FOO_BAZ"); - assertEquals(2, foo_bazTable.columnsSize()); - assertEquals(0, foo_bazTable.primaryKeyColumnsSize()); - assertEquals(2, foo_bazTable.foreignKeysSize()); + assertEquals(2, foo_bazTable.getColumnsSize()); + assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize()); + assertEquals(2, foo_bazTable.getForeignKeysSize()); assertTrue(foo_bazTable.isPossibleJoinTable()); assertTrue(foo_bazTable.joinTableNameIsDefault()); assertTrue(foo_bazTable.getColumnNamed("FOO_ID").isPartOfForeignKey()); @@ -441,13 +441,13 @@ public class DerbyTests extends DTPPlatformTests { assertNotNull(schema2); Table empTable = schema2.getTableNamed("EMP"); assertNotNull(empTable); - assertEquals(1, empTable.foreignKeysSize()); - ForeignKey fk = empTable.foreignKeys().next(); + assertEquals(1, empTable.getForeignKeysSize()); + ForeignKey fk = empTable.getForeignKeys().iterator().next(); Table refTable = fk.getReferencedTable(); assertNotNull(refTable); assertEquals("ORG", refTable.getName()); - assertEquals(1, fk.columnPairsSize()); - ForeignKey.ColumnPair cp = fk.columnPairs().next(); + assertEquals(1, fk.getColumnPairsSize()); + ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next(); Column baseColumn = cp.getBaseColumn(); assertEquals("ORG_ID", baseColumn.getName()); Column refColumn = cp.getReferencedColumn(); diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java index 43e2d8fb0d..af220df707 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java @@ -146,9 +146,9 @@ public class MySQLTests extends DTPPlatformTests { // foo Table fooTable = schema.getTableNamed("foo"); - assertEquals(3, fooTable.columnsSize()); - assertEquals(1, fooTable.primaryKeyColumnsSize()); - assertEquals(1, fooTable.foreignKeysSize()); + assertEquals(3, fooTable.getColumnsSize()); + assertEquals(1, fooTable.getPrimaryKeyColumnsSize()); + assertEquals(1, fooTable.getForeignKeysSize()); Column pkColumn = fooTable.getPrimaryKeyColumn(); assertEquals("id", pkColumn.getName()); @@ -170,8 +170,8 @@ public class MySQLTests extends DTPPlatformTests { assertTrue(barColumn.isPartOfForeignKey()); assertFalse(barColumn.isPartOfPrimaryKey()); - ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key - assertEquals(1, barFK.columnPairsSize()); + ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key + assertEquals(1, barFK.getColumnPairsSize()); assertEquals("bar", barFK.getAttributeName()); assertNull(barFK.getJoinColumnAnnotationIdentifier("bar")); assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar")); @@ -182,9 +182,9 @@ public class MySQLTests extends DTPPlatformTests { // BAR Table barTable = schema.getTableNamed("bar"); - assertEquals(2, barTable.columnsSize()); - assertEquals(1, barTable.primaryKeyColumnsSize()); - assertEquals(0, barTable.foreignKeysSize()); + assertEquals(2, barTable.getColumnsSize()); + assertEquals(1, barTable.getPrimaryKeyColumnsSize()); + assertEquals(0, barTable.getForeignKeysSize()); assertEquals("id", barTable.getPrimaryKeyColumn().getName()); assertFalse(barTable.isPossibleJoinTable()); assertEquals("BLOB", barTable.getColumnNamed("chunk").getDataTypeName()); @@ -194,9 +194,9 @@ public class MySQLTests extends DTPPlatformTests { // FOO_BAZ Table foo_bazTable = schema.getTableNamed("foo_baz"); - assertEquals(2, foo_bazTable.columnsSize()); - assertEquals(0, foo_bazTable.primaryKeyColumnsSize()); - assertEquals(2, foo_bazTable.foreignKeysSize()); + assertEquals(2, foo_bazTable.getColumnsSize()); + assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize()); + assertEquals(2, foo_bazTable.getForeignKeysSize()); assertTrue(foo_bazTable.isPossibleJoinTable()); assertTrue(foo_bazTable.joinTableNameIsDefault()); assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey()); @@ -384,7 +384,7 @@ public class MySQLTests extends DTPPlatformTests { Table empTable = schema2.getTableNamed("emp"); assertNotNull(empTable); // no foreign keys - assertEquals(0, empTable.foreignKeysSize()); + assertEquals(0, empTable.getForeignKeysSize()); this.dropDatabase("xref_test2"); this.dropDatabase("xref_test1"); diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java index 6e4495639c..cb78ad1544 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java @@ -118,9 +118,9 @@ public class Oracle10gTests extends DTPPlatformTests { // foo Table fooTable = schema.getTableForIdentifier("foo"); - assertEquals(3, fooTable.columnsSize()); - assertEquals(1, fooTable.primaryKeyColumnsSize()); - assertEquals(1, fooTable.foreignKeysSize()); + assertEquals(3, fooTable.getColumnsSize()); + assertEquals(1, fooTable.getPrimaryKeyColumnsSize()); + assertEquals(1, fooTable.getForeignKeysSize()); Column pkColumn = fooTable.getPrimaryKeyColumn(); assertEquals("ID", pkColumn.getName()); @@ -142,8 +142,8 @@ public class Oracle10gTests extends DTPPlatformTests { assertTrue(barColumn.isPartOfForeignKey()); assertFalse(barColumn.isPartOfPrimaryKey()); - ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key - assertEquals(1, barFK.columnPairsSize()); + ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key + assertEquals(1, barFK.getColumnPairsSize()); assertEquals("BAR", barFK.getAttributeName()); assertNull(barFK.getJoinColumnAnnotationIdentifier("bar")); assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar")); @@ -154,9 +154,9 @@ public class Oracle10gTests extends DTPPlatformTests { // BAR Table barTable = schema.getTableForIdentifier("bar"); - assertEquals(2, barTable.columnsSize()); - assertEquals(1, barTable.primaryKeyColumnsSize()); - assertEquals(0, barTable.foreignKeysSize()); + assertEquals(2, barTable.getColumnsSize()); + assertEquals(1, barTable.getPrimaryKeyColumnsSize()); + assertEquals(0, barTable.getForeignKeysSize()); assertEquals("ID", barTable.getPrimaryKeyColumn().getName()); assertFalse(barTable.isPossibleJoinTable()); assertEquals("BLOB", barTable.getColumnForIdentifier("chunk").getDataTypeName()); @@ -166,9 +166,9 @@ public class Oracle10gTests extends DTPPlatformTests { // FOO_BAZ Table foo_bazTable = schema.getTableForIdentifier("foo_baz"); - assertEquals(2, foo_bazTable.columnsSize()); - assertEquals(0, foo_bazTable.primaryKeyColumnsSize()); - assertEquals(2, foo_bazTable.foreignKeysSize()); + assertEquals(2, foo_bazTable.getColumnsSize()); + assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize()); + assertEquals(2, foo_bazTable.getForeignKeysSize()); assertTrue(foo_bazTable.isPossibleJoinTable()); assertTrue(foo_bazTable.joinTableNameIsDefault()); assertTrue(foo_bazTable.getColumnForIdentifier("foo_id").isPartOfForeignKey()); @@ -343,13 +343,13 @@ public class Oracle10gTests extends DTPPlatformTests { assertNotNull(schema2); Table empTable = schema2.getTableNamed("EMP"); assertNotNull(empTable); - assertEquals(1, empTable.foreignKeysSize()); - ForeignKey fk = empTable.foreignKeys().next(); + assertEquals(1, empTable.getForeignKeysSize()); + ForeignKey fk = empTable.getForeignKeys().iterator().next(); Table refTable = fk.getReferencedTable(); assertNotNull(refTable); assertEquals("ORG", refTable.getName()); - assertEquals(1, fk.columnPairsSize()); - ForeignKey.ColumnPair cp = fk.columnPairs().next(); + assertEquals(1, fk.getColumnPairsSize()); + ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next(); Column baseColumn = cp.getBaseColumn(); assertEquals("ORG_ID", baseColumn.getName()); Column refColumn = cp.getReferencedColumn(); diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java index 73feea8609..4b54bbf4fb 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java @@ -220,9 +220,9 @@ public class PostgreSQLTests extends DTPPlatformTests { // FOO Table fooTable = schema.getTableForIdentifier("FOO"); - assertEquals(3, fooTable.columnsSize()); - assertEquals(1, fooTable.primaryKeyColumnsSize()); - assertEquals(1, fooTable.foreignKeysSize()); + assertEquals(3, fooTable.getColumnsSize()); + assertEquals(1, fooTable.getPrimaryKeyColumnsSize()); + assertEquals(1, fooTable.getForeignKeysSize()); Column pkColumn = fooTable.getPrimaryKeyColumn(); assertEquals("id", pkColumn.getName()); @@ -244,8 +244,8 @@ public class PostgreSQLTests extends DTPPlatformTests { assertTrue(barColumn.isPartOfForeignKey()); assertFalse(barColumn.isPartOfPrimaryKey()); - ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key - assertEquals(1, barFK.columnPairsSize()); + ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key + assertEquals(1, barFK.getColumnPairsSize()); assertEquals("bar", barFK.getAttributeName()); assertNull(barFK.getJoinColumnAnnotationIdentifier("bar")); assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar")); @@ -256,9 +256,9 @@ public class PostgreSQLTests extends DTPPlatformTests { // BAR Table barTable = schema.getTableForIdentifier("BAR"); - assertEquals(2, barTable.columnsSize()); - assertEquals(1, barTable.primaryKeyColumnsSize()); - assertEquals(0, barTable.foreignKeysSize()); + assertEquals(2, barTable.getColumnsSize()); + assertEquals(1, barTable.getPrimaryKeyColumnsSize()); + assertEquals(0, barTable.getForeignKeysSize()); assertEquals("id", barTable.getPrimaryKeyColumn().getName()); assertFalse(barTable.isPossibleJoinTable()); assertEquals("BYTEA", barTable.getColumnForIdentifier("CHUNK").getDataTypeName()); @@ -268,9 +268,9 @@ public class PostgreSQLTests extends DTPPlatformTests { // FOO_BAZ Table foo_bazTable = schema.getTableForIdentifier("FOO_BAZ"); - assertEquals(2, foo_bazTable.columnsSize()); - assertEquals(0, foo_bazTable.primaryKeyColumnsSize()); - assertEquals(2, foo_bazTable.foreignKeysSize()); + assertEquals(2, foo_bazTable.getColumnsSize()); + assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize()); + assertEquals(2, foo_bazTable.getForeignKeysSize()); assertTrue(foo_bazTable.isPossibleJoinTable()); assertTrue(foo_bazTable.joinTableNameIsDefault()); assertTrue(foo_bazTable.getColumnForIdentifier("FOO_ID").isPartOfForeignKey()); @@ -409,13 +409,13 @@ public class PostgreSQLTests extends DTPPlatformTests { assertNotNull(schema2); Table empTable = schema2.getTableNamed("emp"); assertNotNull(empTable); - assertEquals(1, empTable.foreignKeysSize()); - ForeignKey fk = empTable.foreignKeys().next(); + assertEquals(1, empTable.getForeignKeysSize()); + ForeignKey fk = empTable.getForeignKeys().iterator().next(); Table refTable = fk.getReferencedTable(); assertNotNull(refTable); assertEquals("org", refTable.getName()); - assertEquals(1, fk.columnPairsSize()); - ForeignKey.ColumnPair cp = fk.columnPairs().next(); + assertEquals(1, fk.getColumnPairsSize()); + ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next(); Column baseColumn = cp.getBaseColumn(); assertEquals("org_id", baseColumn.getName()); Column refColumn = cp.getReferencedColumn(); diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java index b5f54cb8f8..41cea99c95 100644 --- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java +++ b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java @@ -141,9 +141,9 @@ public class SybaseTests extends DTPPlatformTests { // foo Table fooTable = schema.getTableNamed("foo"); - assertEquals(3, fooTable.columnsSize()); - assertEquals(1, fooTable.primaryKeyColumnsSize()); - assertEquals(1, fooTable.foreignKeysSize()); + assertEquals(3, fooTable.getColumnsSize()); + assertEquals(1, fooTable.getPrimaryKeyColumnsSize()); + assertEquals(1, fooTable.getForeignKeysSize()); Column pkColumn = fooTable.getPrimaryKeyColumn(); assertEquals("id", pkColumn.getName()); @@ -182,8 +182,8 @@ public class SybaseTests extends DTPPlatformTests { assertTrue(barColumn.isPartOfForeignKey()); assertFalse(barColumn.isPartOfPrimaryKey()); - ForeignKey barFK = fooTable.foreignKeys().next(); // there should only be 1 foreign key - assertEquals(1, barFK.columnPairsSize()); + ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key + assertEquals(1, barFK.getColumnPairsSize()); assertEquals("bar", barFK.getAttributeName()); assertNull(barFK.getJoinColumnAnnotationIdentifier("bar")); assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar")); @@ -194,9 +194,9 @@ public class SybaseTests extends DTPPlatformTests { // BAR Table barTable = schema.getTableNamed("bar"); - assertEquals(2, barTable.columnsSize()); - assertEquals(1, barTable.primaryKeyColumnsSize()); - assertEquals(0, barTable.foreignKeysSize()); + assertEquals(2, barTable.getColumnsSize()); + assertEquals(1, barTable.getPrimaryKeyColumnsSize()); + assertEquals(0, barTable.getForeignKeysSize()); assertEquals("id", barTable.getPrimaryKeyColumn().getName()); assertFalse(barTable.isPossibleJoinTable()); Column chunkColumn = barTable.getColumnNamed("chunk"); @@ -208,9 +208,9 @@ public class SybaseTests extends DTPPlatformTests { // BAZ Table bazTable = schema.getTableNamed("baz"); - assertEquals(4, bazTable.columnsSize()); - assertEquals(1, bazTable.primaryKeyColumnsSize()); - assertEquals(0, bazTable.foreignKeysSize()); + assertEquals(4, bazTable.getColumnsSize()); + assertEquals(1, bazTable.getPrimaryKeyColumnsSize()); + assertEquals(0, bazTable.getForeignKeysSize()); Column nicknameColumn = bazTable.getColumnNamed("nickname"); assertTrue(nicknameColumn.isNullable()); @@ -229,9 +229,9 @@ public class SybaseTests extends DTPPlatformTests { // FOO_BAZ Table foo_bazTable = schema.getTableNamed("foo_baz"); - assertEquals(2, foo_bazTable.columnsSize()); - assertEquals(0, foo_bazTable.primaryKeyColumnsSize()); - assertEquals(2, foo_bazTable.foreignKeysSize()); + assertEquals(2, foo_bazTable.getColumnsSize()); + assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize()); + assertEquals(2, foo_bazTable.getForeignKeysSize()); assertTrue(foo_bazTable.isPossibleJoinTable()); assertTrue(foo_bazTable.joinTableNameIsDefault()); assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey()); @@ -416,13 +416,13 @@ public class SybaseTests extends DTPPlatformTests { assertNotNull(schema2); Table empTable = schema2.getTableNamed("emp"); assertNotNull(empTable); - assertEquals(1, empTable.foreignKeysSize()); - ForeignKey fk = empTable.foreignKeys().next(); + assertEquals(1, empTable.getForeignKeysSize()); + ForeignKey fk = empTable.getForeignKeys().iterator().next(); Table refTable = fk.getReferencedTable(); assertNotNull(refTable); assertEquals("org", refTable.getName()); - assertEquals(1, fk.columnPairsSize()); - ForeignKey.ColumnPair cp = fk.columnPairs().next(); + assertEquals(1, fk.getColumnPairsSize()); + ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next(); Column baseColumn = cp.getBaseColumn(); assertEquals("org_id", baseColumn.getName()); Column refColumn = cp.getReferencedColumn(); |