Examples of ParentTestEntity


Examples of com.force.sdk.jpa.entities.ParentTestEntity

     */           
    public void testExtendedBehavior() {
        TestEntity t = new TestEntity();
        JPATestUtils.initializeTestEntity(t);
        //new/transient
        ParentTestEntity p = JPATestUtils.setMasterDetailRelationship(t);
        t.setParent(p);
        Assert.assertFalse(emExt.contains(t), "Entity is not transient.");
        emExt.persist(p);
        emExt.persist(t);
//        Assert.assertNull(t.getId(), "Entity was already committed.");//fails
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

     */           
    public void testTxBehavior() {
        TestEntity t = new TestEntity();
        JPATestUtils.initializeTestEntity(t);
        //new/transient
        ParentTestEntity p = JPATestUtils.setMasterDetailRelationship(t);
        t.setParent(p);
        Assert.assertFalse(em.contains(t), "Entity is not transient.");
        EntityTransaction tx = em.getTransaction();
        if (tx.isActive())tx.commit();
        try {
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

        if (isExtended) {
            errMsg = "Extended: ";
        }
        Assert.assertTrue(e.contains(entity), errMsg + " Entity is not managed.");
        Assert.assertTrue(e.contains(entity.getParent()), errMsg + " Parent is not managed.");
        ParentTestEntity parent = entity.getParent();
        String pid = parent.getId();
        EntityTransaction tx = e.getTransaction();
        tx.begin();
        tx.commit();
        if (isExtended) {
            Assert.assertTrue(e.contains(entity) && e.contains(parent), errMsg + " Entity is not managed.");
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

        EntityTransaction tx = e.getTransaction();
        tx.begin();
        TestEntity removed = new TestEntity();
        //new
        JPATestUtils.initializeTestEntity(removed);
        ParentTestEntity parentRemoved = JPATestUtils.setMasterDetailRelationship(removed);
        e.persist(parentRemoved);
        e.persist(removed);
        TestEntity managed = e.find(TestEntity.class, eId);
        //managed
        Assert.assertTrue(e.contains(managed) && e.contains(removed) && e.contains(parentRemoved),
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

     */
    private String prepareTest(EntityManager e, boolean isExtended) {
        TestEntity t = new TestEntity();
        JPATestUtils.initializeTestEntity(t);
        //new/transient
        ParentTestEntity p = JPATestUtils.setMasterDetailRelationship(t);
        t.setParent(p);
        EntityTransaction tx = e.getTransaction();
        String errMsg = "Tx scoped: ";
        if (isExtended) {
            errMsg = "Extended: ";
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

                {new TestEntity(), "email",             "0foobar@salesforce.com", "77foobar@salesforce.com"},
                {new TestEntity(), "url",               new URL("http://localhost:0000"), new URL("http://localhost:7000")},
                {new TestEntity(), "characterObject",   'A', '7'},
                {new TestEntity(), "booleanObject",     Boolean.TRUE, Boolean.FALSE},
               
                {new ParentTestEntity(), "name",        "parent entity", "updated name"},
        };
        return entities;
    }
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

        TestEntity entity3 = new TestEntity();
        JPATestUtils.initializeTestEntity(entity3);
        entity3.setName("entityXX");
        entity3.setBoolType(false);
        entity3.setIntType(3);
        ParentTestEntity parent1 = new ParentTestEntity();
        parent1.setName("Parent1");
        entity1.setParent(parent1);
        entity1.setParentMasterDetail(parent1);
        ParentTestEntity parent2 = new ParentTestEntity();
        parent2.setName("Parent2");
        entity2.setParent(parent2);
        entity2.setParentMasterDetail(parent2);
        ParentTestEntity parent3 = new ParentTestEntity();
        parent3.setName("Parent3");
        entity3.setParent(parent3);
        entity3.setParentMasterDetail(parent3);
       
        addTestDataInTx(Lists.newArrayList(parent1, entity1, parent2, entity2, parent3, entity3));
       
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

        entity1.setBoolType(true);
        TestEntity entity2 = new TestEntity();
        JPATestUtils.initializeTestEntity(entity2);
        entity2.setName("entity2");
        entity2.setBoolType(false);
        ParentTestEntity parent = new ParentTestEntity();
        parent.init();
        entity1.setParent(parent);
        entity1.setParentMasterDetail(parent);
        entity2.setParent(parent);
        entity2.setParentMasterDetail(parent);
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

    protected void initTestData() {
        classTearDown();
        EntityTransaction tx = em.getTransaction();
        try {
            tx.begin();
            parent = new ParentTestEntity();
            parent.init();
            em.persist(parent);
            parentMD = new ParentTestEntity();
            parentMD.init();
            em.persist(parentMD);
            for (Digit d : Digit.values()) {
                TestEntity entity = new TestEntity();
                JPATestUtils.initializeTestEntity(entity, d);
View Full Code Here

Examples of com.force.sdk.jpa.entities.ParentTestEntity

   
    @DataProvider
    public Object[][] deleteData() throws NumberFormatException, MalformedURLException {
        Object [][] entities = new Object[][]{
                {new TestEntity(), 10, 0},
                {new ParentTestEntity(), 2, 0},
        };
        return entities;
    }
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.