HHH-9898 Test for correct behaviour of 2LC

* Test is marked as ignored since it is expected to run it only manually
This commit is contained in:
Radim Vansa 2015-08-04 11:21:04 +02:00 committed by Galder Zamarreño
parent 984125e87e
commit c8ed5e1bef
4 changed files with 1167 additions and 12 deletions

View File

@ -153,6 +153,7 @@ public final class Address {
Address address = (Address) o;
// inhabitants must not be in the comparison since we would end up in infinite recursion
if (id != address.id) return false;
if (streetNumber != address.streetNumber) return false;
if (version != address.version) return false;
@ -160,8 +161,6 @@ public final class Address {
return false;
if (countryName != null ? !countryName.equals(address.countryName) : address.countryName != null)
return false;
if (inhabitants != null ? !inhabitants.equals(address.inhabitants) : address.inhabitants != null)
return false;
if (streetName != null ? !streetName.equals(address.streetName) : address.streetName != null)
return false;
if (zipCode != null ? !zipCode.equals(address.zipCode) : address.zipCode != null)
@ -177,7 +176,6 @@ public final class Address {
result = 31 * result + (cityName != null ? cityName.hashCode() : 0);
result = 31 * result + (countryName != null ? countryName.hashCode() : 0);
result = 31 * result + (zipCode != null ? zipCode.hashCode() : 0);
result = 31 * result + (inhabitants != null ? inhabitants.hashCode() : 0);
result = 31 * result + id;
result = 31 * result + version;
return result;

View File

@ -7,10 +7,12 @@
package org.hibernate.test.cache.infinispan.stress.entities;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Version;
import java.util.HashSet;
import java.util.Set;
@ -22,8 +24,9 @@ public final class Family {
private int id;
private String name;
private String secondName;
@OneToMany
@OneToMany(cascade = CascadeType.ALL, mappedBy = "family", orphanRemoval = true)
private Set<Person> members;
@Version
private int version;
public Family(String name) {
@ -97,10 +100,9 @@ public final class Family {
Family family = (Family) o;
// members must not be in the comparison since we would end up in infinite recursive call
if (id != family.id) return false;
if (version != family.version) return false;
if (members != null ? !members.equals(family.members) : family.members != null)
return false;
if (name != null ? !name.equals(family.name) : family.name != null)
return false;
if (secondName != null ? !secondName.equals(family.secondName) : family.secondName != null)
@ -113,7 +115,6 @@ public final class Family {
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (secondName != null ? secondName.hashCode() : 0);
result = 31 * result + (members != null ? members.hashCode() : 0);
result = 31 * result + id;
result = 31 * result + version;
return result;

View File

@ -26,16 +26,14 @@
thread_pool.max_threads="8"
thread_pool.keep_alive_time="5000"
thread_pool.queue_enabled="false"
thread_pool.queue_max_size="100"
thread_pool.rejection_policy="Run"
thread_pool.rejection_policy="Discard"
oob_thread_pool.enabled="true"
oob_thread_pool.min_threads="1"
oob_thread_pool.max_threads="8"
oob_thread_pool.max_threads="200"
oob_thread_pool.keep_alive_time="5000"
oob_thread_pool.queue_enabled="false"
oob_thread_pool.queue_max_size="100"
oob_thread_pool.rejection_policy="Run"/>
oob_thread_pool.rejection_policy="Discard"/>
<org.infinispan.test.fwk.TEST_PING ergonomics="false" testName=""/>