HHH-6322 remove local tests

This commit is contained in:
Strong Liu 2011-06-15 10:57:31 +08:00
parent 5227cc2c10
commit cbf1f6cc44
2 changed files with 0 additions and 99 deletions

View File

@ -1,54 +0,0 @@
package org.hibernate.test.optlock;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
@Table(name = "taba")
@Entity
public class A {
private static final long serialVersionUID = 1L;
private int id;
private int version;
private String descr;
public A() {
}
public A(int id, String descr) {
this.id = id;
this.descr = descr;
}
@Id
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Version
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
@Basic
public String getDescr() {
return descr;
}
public void setDescr(String descr) {
this.descr = descr;
}
}

View File

@ -1,45 +0,0 @@
package org.hibernate.test.optlock;
import org.hibernate.Session;
import org.hibernate.test.annotations.TestCase;
/**
* @author Strong Liu
*/
public class IssueHibernateTest extends TestCase {
public IssueHibernateTest() {
}
public IssueHibernateTest(String name) {
super( name );
}
public void testCheckDBVersion() {
Session s = openSession();
s.beginTransaction();
A a1 = new A( 1, "test1" );
s.persist( a1 );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
A a=(A)s.get( A.class,1 );
assertEquals( 0,a.getVersion() );
s.clear();
Session s2 = openSession();
s2.beginTransaction();
A a2 = (A)s2.get( A.class,1 );
a2.setDescr( "changed 2" );
s2.merge( a2 );
s2.getTransaction().commit();
}
@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class<?>[] { A.class };
}
}