use of org.hibernate.testing.TestForIssue in project hibernate-orm by hibernate.
the class GetterSetterSerializationTest method testPrivateFieldGetter.
@Test
@TestForIssue(jiraKey = "HHH-11202")
public void testPrivateFieldGetter() throws Exception {
final AnEntity entity = new AnEntity(new PK(1L));
final Getter getter = new GetterFieldImpl(AnEntity.class, "pk", ReflectHelper.findField(AnEntity.class, "pk"));
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(getter);
final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
final Getter getterClone = (Getter) ois.readObject();
assertSame(getter.get(entity), getterClone.get(entity));
}
use of org.hibernate.testing.TestForIssue in project hibernate-orm by hibernate.
the class JpaSchemaGeneratorTest method testSqlDropScriptSourceClasspath.
@SuppressWarnings("unchecked")
@Test
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlDropScriptSourceClasspath() throws Exception {
Map settings = buildSettings();
settings.put(AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script");
settings.put(AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop");
settings.put(AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getDropSqlScript());
doTest(settings);
}
use of org.hibernate.testing.TestForIssue in project hibernate-orm by hibernate.
the class JpaSchemaGeneratorTest method testSqlCreateScriptSourceUrl.
@SuppressWarnings("unchecked")
@Test
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlCreateScriptSourceUrl() throws Exception {
Map settings = buildSettings();
settings.put(AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop-and-create");
settings.put(AvailableSettings.HBM2DDL_CREATE_SOURCE, "metadata-then-script");
settings.put(AvailableSettings.HBM2DDL_CREATE_SCRIPT_SOURCE, getResourceUrlString(getCreateSqlScript()));
doTest(settings);
}
use of org.hibernate.testing.TestForIssue in project hibernate-orm by hibernate.
the class JpaSchemaGeneratorTest method testSqlLoadScriptSourceClasspath.
@SuppressWarnings("unchecked")
@Test
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlLoadScriptSourceClasspath() throws Exception {
Map settings = buildSettings();
settings.put(AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop-and-create");
settings.put(AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getLoadSqlScript());
doTest(settings);
}
use of org.hibernate.testing.TestForIssue in project hibernate-orm by hibernate.
the class JpaSchemaGeneratorTest method testSqlDropScriptSourceUrl.
@SuppressWarnings("unchecked")
@Test
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlDropScriptSourceUrl() throws Exception {
Map settings = buildSettings();
settings.put(AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script");
settings.put(AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop");
settings.put(AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getResourceUrlString(getDropSqlScript()));
doTest(settings);
}
Aggregations