Search in sources :

Example 1 with CompositeOwnerTracker

use of org.hibernate.bytecode.enhance.internal.tracker.CompositeOwnerTracker in project hibernate-orm by hibernate.

the class CompositeOwnerTrackerTest method testCompositeOwnerTracker.

@Test
public void testCompositeOwnerTracker() {
    CompositeOwnerTracker tracker = new CompositeOwnerTracker();
    tracker.add("foo", new TestCompositeOwner());
    tracker.callOwner(".street1");
    assertEquals(1, counter);
    tracker.add("bar", new TestCompositeOwner());
    tracker.callOwner(".city");
    assertEquals(3, counter);
    tracker.removeOwner("foo");
    tracker.callOwner(".country");
    assertEquals(4, counter);
    tracker.removeOwner("bar");
    tracker.callOwner(".country");
    tracker.add("moo", new TestCompositeOwner());
    tracker.callOwner(".country");
    assertEquals(5, counter);
}
Also used : CompositeOwnerTracker(org.hibernate.bytecode.enhance.internal.tracker.CompositeOwnerTracker) Test(org.junit.Test)

Aggregations

CompositeOwnerTracker (org.hibernate.bytecode.enhance.internal.tracker.CompositeOwnerTracker)1 Test (org.junit.Test)1