Package javax.jdo

Examples of javax.jdo.FetchGroup


        }
    }

    public void testPMFGetFetchGroupClassNotPersistenceCapable() {
        try {
            FetchGroup fg = pmf.getFetchGroup(Integer.class, "testtestPMFGetFetchGroupClassNotPersistenceCapableGetFetchGroupClassNotPersistenceCapable");
            fail("getFetchGroup should throw on nonPersistenceCapable class.");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here


        }
    }

    public void testPMFGetFetchGroupInterfaceNotPersistenceCapable() {
        try {
            FetchGroup fg = pmf.getFetchGroup(IEmployee.class, "testPMFGetFetchGroupInterfaceNotPersistenceCapable");
            fail("getFetchGroup should throw on nonPersistenceCapable interface.");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    public void testAddMemberNotAMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMemberNotAMember");
        try {
            fg.addMember("NotAMember");
            fail("FetchGroup should throw on addMember(NotAMember).");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    public void testAddMembersNotAMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMembersNotAMember");
        try {
            fg.addMembers(new String[]{"NotAMember"});
            fail("FetchGroup should throw on addMembers(NotAMember).");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    public void testRemoveMemberNotAMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMemberNotAMember");
        fg.addCategory(FetchGroup.ALL);
        try {
            fg.removeMember("NotAMember");
            fail("FetchGroup should throw on removeMember(NotAMember).");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    public void testRemoveMembersNotAMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMembersNotAMember");
        fg.addCategory(FetchGroup.ALL);
        try {
            fg.removeMembers(new String[]{"NotAMember"});
            fail("FetchGroup should throw on removeMembers(NotAMember).");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    public void testSetRecursionDepthNotAMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testSetRecursionDepthNotAMember");
        try {
            fg.setRecursionDepth("NotAMember", 64);
            fail("FetchGroup should throw on setRecursionDepth(NotAMember).");
        } catch(JDOException ex) {
            // good catch!
        }
    }
View Full Code Here

            // good catch!
        }
    }

    private void checkAddCategory(Class cls, String category, String[] expected) {
        FetchGroup fg = pm.getFetchGroup(cls, "test" + count() + category);
        Set expectedSet = new HashSet();
        expectedSet.addAll(Arrays.asList(expected));
        Set members = fg.getMembers();
        assertTrue("New FetchGroup should have no members; "
                + printFetchGroup(fg),
                members.isEmpty());
        fg.addCategory(category);
        members = fg.getMembers();
        if (!members.equals(expectedSet)) {
            appendMessage("FetchGroup(" + cls.getName()
                    + ".addCategory(" + category + ") should contain\n"
                + expectedSet + " but contains\n" + members);
        }
View Full Code Here

                    + "Expected: " + expected + " actual: " + actual,
                    actual, expected);
    }

    public void testPMGetFetchGroupIdentical() {
        FetchGroup scoped = pm.getFetchGroup(Address.class, "default");
        FetchGroup identical = pm.getFetchGroup(Address.class, "default");
        assertSame("Modifiable FetchGroup is not identical to modifiable FetchGroup;"
                    + "FetchGroup: " + printFetchGroup(scoped)
                    + " identical: " + printFetchGroup(identical),
                    scoped, identical);
    }
View Full Code Here

                    + " identical: " + printFetchGroup(identical),
                    scoped, identical);
    }

    public void testPMGetFetchGroupUnmodifiableNotIdentical() {
        FetchGroup scoped = pm.getFetchGroup(Address.class, "default");
        scoped.setUnmodifiable();
        FetchGroup modifiable = pm.getFetchGroup(Address.class, "default");
        assertNotSame("Unmodifiable FetchGroup is identical to modifiable FetchGroup;"
                    + "\nunmodifiable: " + printFetchGroup(scoped)
                    + "\n  modifiable: " + printFetchGroup(modifiable),
                    scoped, modifiable);
    }
View Full Code Here

TOP

Related Classes of javax.jdo.FetchGroup

Copyright © 2018 www.massapicom. 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.