Re-enable additional tests
This commit is contained in:
parent
0e1822e5dd
commit
1f541170c7
|
@ -13,9 +13,9 @@
|
|||
|
||||
-->
|
||||
|
||||
<hibernate-mapping package="org.hibernate.test.rowid">
|
||||
<hibernate-mapping package="org.hibernate.orm.test.rowid">
|
||||
|
||||
<typedef name="rowid" class="org.hibernate.test.rowid.RowIdType"/>
|
||||
<typedef name="rowid" class="org.hibernate.orm.test.rowid.RowIdType"/>
|
||||
|
||||
<class name="Point" rowid="rowid">
|
||||
<composite-id>
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id: Point.java 6477 2005-04-21 07:39:21Z oneovthafew $
|
||||
package org.hibernate.test.rowid;
|
||||
package org.hibernate.orm.test.rowid;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -4,60 +4,62 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.rowid;
|
||||
package org.hibernate.orm.test.rowid;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Statement;
|
||||
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.dialect.OracleDialect;
|
||||
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.RequiresDialect;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.dialect.Oracle9iDialect;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Gavin King
|
||||
*/
|
||||
@RequiresDialect( value = Oracle9iDialect.class )
|
||||
public class RowIdTest extends BaseCoreFunctionalTestCase {
|
||||
public String[] getMappings() {
|
||||
return new String[] { "rowid/Point.hbm.xml" };
|
||||
}
|
||||
@RequiresDialect(value = OracleDialect.class, version = 900)
|
||||
@DomainModel(
|
||||
xmlMappings = "org/hibernate/orm/test/rowid/Point.hbm.xml"
|
||||
)
|
||||
@SessionFactory(
|
||||
exportSchema = false
|
||||
|
||||
public String getCacheConcurrencyStrategy() {
|
||||
return null;
|
||||
}
|
||||
)
|
||||
public class RowIdTest2 {
|
||||
|
||||
public boolean createSchema() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void afterSessionFactoryBuilt() {
|
||||
super.afterSessionFactoryBuilt();
|
||||
final Session session = sessionFactory().openSession();
|
||||
session.doWork(
|
||||
connection -> {
|
||||
Statement st = ((SessionImplementor)session).getJdbcCoordinator().getStatementPreparer().createStatement();
|
||||
try {
|
||||
((SessionImplementor)session).getJdbcCoordinator().getResultSetReturn().execute( st, "drop table Point");
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
}
|
||||
((SessionImplementor)session).getJdbcCoordinator().getResultSetReturn().execute( st, "create table Point (\"x\" number(19,2) not null, \"y\" number(19,2) not null, description varchar2(255) )");
|
||||
((SessionImplementor)session).getJdbcCoordinator().getResourceRegistry().release( st );
|
||||
}
|
||||
@BeforeAll
|
||||
public void setUp(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
session -> session.doWork(
|
||||
connection -> {
|
||||
Statement st = session.getJdbcCoordinator().getStatementPreparer().createStatement();
|
||||
try {
|
||||
session.getJdbcCoordinator().getResultSetReturn().execute( st, "drop table Point" );
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
}
|
||||
session.getJdbcCoordinator().getResultSetReturn().execute(
|
||||
st,
|
||||
"create table Point (\"x\" number(19,2) not null, \"y\" number(19,2) not null, description varchar2(255) )"
|
||||
);
|
||||
session.getJdbcCoordinator().getResourceRegistry().release( st );
|
||||
}
|
||||
)
|
||||
);
|
||||
session.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRowId() {
|
||||
inSession(
|
||||
public void testRowId(SessionFactoryScope scope) {
|
||||
scope.inSession(
|
||||
s -> {
|
||||
try {
|
||||
Transaction t = s.beginTransaction();
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id: RowIdType.java 6477 2005-04-21 07:39:21Z oneovthafew $
|
||||
package org.hibernate.test.rowid;
|
||||
package org.hibernate.orm.test.rowid;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
Loading…
Reference in New Issue