Examples of Child


Examples of hivemind.test.config.impl.Child

        assertEquals("value1", p1.getValue());

        l = p1.getChildren();
        assertEquals(2, l.size());

        Child c1 = (Child) l.get(0);

        assertSame(p1, c1.getParent());

        assertEquals("detailkey1", c1.getKey());
        assertEquals("detailvalue1", c1.getValue());

        Child c2 = (Child) l.get(1);

        assertSame(p1, c2.getParent());

        assertEquals("detailkey2", c2.getKey());
        assertEquals("detailvalue2", c2.getValue());
    }
View Full Code Here

Examples of hivemind.test.config.impl.Child

        assertEquals("value1", p1.getValue());

        l = p1.getChildren();
        assertEquals(2, l.size());

        Child c1 = (Child) l.get(0);

        assertSame(p1, c1.getParent());

        assertEquals("detailkey1", c1.getKey());
        assertEquals("detailvalue1", c1.getValue());

        Child c2 = (Child) l.get(1);

        assertSame(p1, c2.getParent());

        assertEquals("detailkey2", c2.getKey());
        assertEquals("detailvalue2", c2.getValue());
    }
View Full Code Here

Examples of hivemind.test.config.impl.Child

        assertEquals("value1", p1.getValue());

        l = p1.getChildren();
        assertEquals(2, l.size());

        Child c1 = (Child) l.get(0);

        assertSame(p1, c1.getParent());

        assertEquals("detailkey1", c1.getKey());
        assertEquals("detailvalue1", c1.getValue());

        Child c2 = (Child) l.get(1);

        assertSame(p1, c2.getParent());

        assertEquals("detailkey2", c2.getKey());
        assertEquals("detailvalue2", c2.getValue());
    }
View Full Code Here

Examples of interfaces.Child

    System.out.println("Doing stuff in testOne ...");

    Parent bean = Impala.getBean("parent", Parent.class);
    System.out.println("Got bean of type " + bean);

    Child child = bean.tryGetChild();
    try {
      child.childMethod();
      fail();
    }
    catch (RuntimeException e) {
      // e.printStackTrace();
    }
View Full Code Here

Examples of models.Child

 
  Parent father = Parent.find("byName", "parent").first();
  Parent mother = Parent.find("byName", "mother").first();
  Person tutor = Person.find("byUserName", "tutor").first();
  Person newTutor = Person.find("byUserName", "new_tutor").first();
  Child child = Child.find("byName", "child_2").first();
 
  assertNotNull(father);
  assertNotNull(mother);
  assertNotNull(child);
  assertNotNull(tutor);
View Full Code Here

Examples of models.LifeCycle.Child

        t("123", Deleted.class, 1);
    }
   
    @Test
    public void testInheritedBatchDelete() {
        Child lc0 = new Child();
        lc0.foo = "bar";
        lc0.bar = "order";
        lc0.fee = "123";
        lc0.save();
       
        Child lc1 = new Child();
        lc1.foo = "foo";
        lc1.bar = "order";
        lc1.fee = "123";
        lc1.save();
       
        Child.q("bar", "order").delete();
       
        // onBatchDelete is static method so
        // parent hook will not get called
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.Child

    public void testPeerObjectUpdatedToOneRelationship() throws Exception {
        Master a = parentContext1.newObject(Master.class);
        Master altA = parentContext1.newObject(Master.class);

        Child p = parentContext1.newObject(Child.class);
        p.setMaster(a);
        a.setName("X");
        altA.setName("Y");
        parentContext1.commitChanges();

        Child p1 = (Child) parentContext2.localObject(p.getObjectId(), null);
        Master altA1 = (Master) parentContext2.localObject(altA.getObjectId(), null);

        final ObjectContext childContext1 = parentContext1.createChildContext();
        final Child p2 = (Child) childContext1.localObject(p.getObjectId(), p);
        final Master altA2 = (Master) childContext1.localObject(altA.getObjectId(), altA);
        Master a2 = (Master) childContext1.localObject(a.getObjectId(), a);

        p1.setMaster(altA1);
        assertSame(a2, p2.getMaster());
        assertNotSame(altA2, p2.getMaster());
        parentContext2.commitChanges();

        new ThreadedTestHelper() {

            @Override
            protected void assertResult() throws Exception {
                assertSame(altA2, p2.getMaster());
                assertFalse(
                        "Peer data context became dirty on event processing",
                        childContext1.hasChanges());
            }
        }.assertWithTimeout(2000);
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.Child

    public void testPeerObjectUpdatedToManyRelationship() throws Exception {
        Master a = parentContext1.newObject(Master.class);
        a.setName("X");

        Child px = parentContext1.newObject(Child.class);
        px.setMaster(a);

        Child py = parentContext1.newObject(Child.class);

        parentContext1.commitChanges();

        Child py1 = (Child) parentContext2.localObject(py.getObjectId(), py);
        Master a1 = (Master) parentContext2.localObject(a.getObjectId(), a);

        final ObjectContext peer2 = parentContext1.createChildContext();
        final Child py2 = (Child) peer2.localObject(py.getObjectId(), py);
        final Master a2 = (Master) peer2.localObject(a.getObjectId(), a);

        a1.addToChildren(py1);
        assertEquals(1, a2.getChildren().size());
        assertFalse(a2.getChildren().contains(py2));
View Full Code Here

Examples of org.apache.cayenne.testdo.relationship.Child

    public void testPeerObjectUpdatedToOneRelationship() throws Exception {
        Master a = parentContext1.newObject(Master.class);
        Master altA = parentContext1.newObject(Master.class);

        Child p = parentContext1.newObject(Child.class);
        p.setMaster(a);
        a.setName("X");
        altA.setName("Y");
        parentContext1.commitChanges();

        Child p1 = parentContext2.localObject(p);
        Master altA1 = parentContext2.localObject(altA);

        final ObjectContext childContext1 = runtime.newContext(parentContext1);
        final Child p2 = childContext1.localObject(p);
        final Master altA2 = childContext1.localObject(altA);
        Master a2 = childContext1.localObject(a);

        p1.setMaster(altA1);
        assertSame(a2, p2.getMaster());
        assertNotSame(altA2, p2.getMaster());
        parentContext2.commitChanges();

        new ParallelTestContainer() {

            @Override
            protected void assertResult() throws Exception {
                assertSame(altA2, p2.getMaster());
                assertFalse(
                        "Peer data context became dirty on event processing",
                        childContext1.hasChanges());
            }
        }.runTest(2000);
View Full Code Here

Examples of org.baeldung.persistence.model.Child

    // tests

    @Test(expected = DataIntegrityViolationException.class)
    public void whenChildIsDeletedWhileParentStillHasForeignKeyToIt_thenDataException() {
        final Child childEntity = new Child();
        childService.create(childEntity);

        final Parent parentEntity = new Parent(childEntity);
        service.create(parentEntity);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.