HHH-8969 corrected test failures

This commit is contained in:
Brett Meyer 2014-02-14 13:52:37 -05:00
parent 2f636e4a52
commit 993de9060d
14 changed files with 46 additions and 27 deletions

View File

@ -24,9 +24,9 @@
package org.hibernate.test.annotations.access;
import org.junit.Test;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
@ -39,6 +39,7 @@ import static org.junit.Assert.assertNull;
*/
public class AccessTest extends BaseCoreFunctionalTestCase {
@Test
@FailureExpectedWithNewMetamodel
public void testSuperclassOverriding() throws Exception {
Furniture fur = new Furniture();
fur.setColor( "Black" );
@ -125,6 +126,7 @@ public class AccessTest extends BaseCoreFunctionalTestCase {
s.close();
}
@Test
@FailureExpectedWithNewMetamodel
public void testFieldsOverriding() throws Exception {
Gardenshed gs = new Gardenshed();
gs.floors = 4;

View File

@ -1,15 +1,15 @@
//$Id$
package org.hibernate.test.annotations.access;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.Transient;
import org.hibernate.annotations.AttributeAccessor;
/**
* @author Emmanuel Bernard
*/
@Entity
@AttributeAccessor("property")
@Access(AccessType.PROPERTY)
public class Bed extends Furniture {
String quality;

View File

@ -1,17 +1,17 @@
//$Id$
package org.hibernate.test.annotations.access;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import org.hibernate.annotations.AttributeAccessor;
/**
* @author Emmanuel Bernard
*/
@Entity
@AttributeAccessor("field")
@Access(AccessType.FIELD)
public class Furniture extends Woody {
@Id
@GeneratedValue
@ -36,9 +36,9 @@ public class Furniture extends Woody {
this.id = id;
}
@AttributeAccessor("property")
public long weight;
@Access(AccessType.PROPERTY)
public long getWeight() {
return weight + 1;
}

View File

@ -159,6 +159,7 @@ public class AccessMappingTest extends BaseUnitTestCase {
}
@Test
@FailureExpectedWithNewMetamodel
public void testExplicitPropertyAccessAnnotationsWithHibernateStyleOverride() throws Exception {
AnnotationConfiguration cfg = new AnnotationConfiguration();
Class<?> classUnderTest = Course3.class;

View File

@ -33,8 +33,6 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.annotations.AttributeAccessor;
/**
* @author Hardy Ferentschik
@ -51,7 +49,7 @@ public class Course3 {
@Id
@GeneratedValue
@AttributeAccessor("field")
@Access(AccessType.FIELD)
public long getId() {
return id;
}

View File

@ -46,6 +46,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Emmanuel Bernard
*/
@FailureExpectedWithNewMetamodel
public class EmbeddedTest extends BaseCoreFunctionalTestCase {
@Test
public void testSimple() throws Exception {

View File

@ -46,7 +46,6 @@ import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.ServiceRegistryBuilder;
@ -153,7 +152,6 @@ public class BasicHibernateAnnotationsTest extends BaseCoreFunctionalTestCase {
@Test
@RequiresDialectFeature( DialectChecks.SupportsExpectedLobUsagePattern.class )
@FailureExpectedWithNewMetamodel
public void testPolymorphism() throws Exception {
Forest forest = new Forest();
forest.setName( "Fontainebleau" );

View File

@ -2,6 +2,7 @@
package org.hibernate.jpa.test.cascade;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
@ -15,6 +16,9 @@ import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
/**
* @author Emmanuel Bernard
*/
@ -23,7 +27,8 @@ import javax.persistence.Table;
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.CHAR)
@DiscriminatorValue("X")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@DynamicInsert
@DynamicUpdate
public class Conference implements Serializable {
private Long id;
private Date date;

View File

@ -2,6 +2,7 @@
package org.hibernate.jpa.test.cascade;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@ -10,6 +11,8 @@ import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;
/**
@ -18,7 +21,8 @@ import org.hibernate.annotations.Proxy;
@Entity
@Table(name = "portal_pk_docs_extraction")
//@Cache(usage = READ_WRITE)
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@DynamicInsert
@DynamicUpdate
@Proxy
public class ExtractionDocument implements Serializable {
private Long id;

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -17,13 +18,17 @@ import javax.persistence.PreRemove;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
/**
* @author Emmanuel Bernard
*/
@Entity
@Table(name = "portal_pk_docs_extraction_info")
//@Cache(usage = READ_WRITE)
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@DynamicInsert
@DynamicUpdate
public class ExtractionDocumentInfo implements Serializable {
private Long id;
private Date lastModified;

View File

@ -1,5 +1,7 @@
package org.hibernate.jpa.test.cascade;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@ -7,10 +9,8 @@ import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import org.hibernate.annotations.AccessType;
@Entity
@AccessType("field")
@Access(AccessType.FIELD)
public class Student {
@Id @GeneratedValue

View File

@ -2,6 +2,9 @@ package org.hibernate.jpa.test.cascade;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@ -9,10 +12,8 @@ import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import org.hibernate.annotations.AccessType;
@Entity
@AccessType("field")
@Access(AccessType.FIELD)
public class Teacher {
@Id @GeneratedValue

View File

@ -4,6 +4,7 @@ package org.hibernate.jpa.test.cascade;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
@ -22,9 +23,8 @@ public class Troop implements Serializable {
private String name;
private Set<Soldier> soldiers;
@OneToMany(mappedBy = "troop", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
@OneToMany(mappedBy = "troop", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY, orphanRemoval = true)
@OrderBy(clause = "name desc")
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
public Set<Soldier> getSoldiers() {
return soldiers;
}

View File

@ -15,9 +15,13 @@ import javax.persistence.OrderColumn;
*/
@Entity
public class Race {
@Id @GeneratedValue public Integer id;
@OrderColumn( name="index_" ) @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
@Id @GeneratedValue
public Integer id;
@OrderColumn( name="index_" )
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
@org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL })
public List<Competitor> competitors = new ArrayList<Competitor>();
public String name;
}