@@ -0,0 +1,1753 @@
+import static org.hibernate.id.PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER;%0Aimport static org.hibernate.id.PersistentIdentifierGenerator.TABLE;%0Aimport static org.hibernate.id.SequenceGenerator.SEQUENCE;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport hibernate.conventions.generator.TableSequenceGenerator;%0A%0Aimport java.util.Properties;%0A%0Aimport org.hibernate.cfg.NamingStrategy;%0Aimport org.hibernate.cfg.ObjectNameNormalizer;%0Aimport org.hibernate.dialect.Dialect;%0Aimport org.hibernate.dialect.Oracle10gDialect;%0Aimport org.hibernate.id.SequenceGenerator;%0Aimport org.hibernate.type.Type;%0Aimport org.junit.Test;%0A%0Apublic class TableSequenceGeneratorTest %7B%0A%0A%09private SequenceGenerator generator = new TableSequenceGenerator();%0A%0A%09private ObjectNameNormalizer normalizer = new ObjectNameNormalizer() %7B%0A%0A%09%09@Override%0A%09%09protected boolean isUseQuotedIdentifiersGlobally() %7B%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09protected NamingStrategy getNamingStrategy() %7B%0A%09%09%09return null;%0A%09%09%7D%0A%0A%09%7D;%0A%0A%09@Test%0A%09public void testConfigureNoTableName() %7B%0A%0A%09%09Type type = null;%0A%09%09Dialect dialect = new Oracle10gDialect();%0A%0A%09%09Properties params = new Properties();%0A%09%09params.put(IDENTIFIER_NORMALIZER, normalizer);%0A%0A%09%09generator.configure(type, params, dialect);%0A%0A%09%09assertNull(params.get(TABLE));%0A%0A%09%7D%0A%0A%09@Test%0A%09public void testConfigureTypePropertiesDialect() %7B%0A%0A%09%09String tableName = %22test%22;%0A%0A%09%09Type type = null;%0A%09%09Dialect dialect = new Oracle10gDialect();%0A%0A%09%09Properties params = new Properties();%0A%09%09params.put(org.hibernate.id.PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, normalizer);%0A%09%09params.put(TABLE, tableName);%0A%0A%09%09generator.configure(type, params, dialect);%0A%0A%09%09assertEquals(%22seq_%22 + tableName, params.get(SEQUENCE));%0A%0A%09%7D%0A%0A%7D%0A

teste TableSequenceGenerator