Package javax.jdo

Examples of javax.jdo.FetchGroup.addCategory()


        }
    }

    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


        }
    }

    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

        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

    public void testRemoveCategory() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveCategory");
        Set expectedSet = new HashSet();
        expectedSet.addAll(Arrays.asList(allButMultivaluedMembers));
        Set members = fg.getMembers();
        fg.addCategory(FetchGroup.ALL);
        fg.removeCategory(FetchGroup.MULTIVALUED);
        members = fg.getMembers();
        assertEquals("FetchGroup.addCategory(all).removeCategory(multivalued)"
                + " should contain all but multivalued members.\n",
                expectedSet, members);       
View Full Code Here

                expectedSet, members);
    }

    public void testRemoveMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMember");
        fg.addCategory(FetchGroup.ALL);
        for (int i = allMembers.length - 1; i >= 0; --i) {
            String member = allMembers[i];
            fg.removeMember(member);
            Set members = fg.getMembers();
            assertFalse("FetchGroup should not contain " + member + " but does.\n"
View Full Code Here

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

        }
    }

    public void testUnmodifiableRemoveCategory() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testUnmodifiableRemoveCategory");
        fg.addCategory(FetchGroup.ALL);
        fg.setUnmodifiable();
        try {
            fg.removeCategory(FetchGroup.ALL);
            fail("Unmodifiable FetchGroup should throw on removeCategory.");
        } catch(JDOException ex) {
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.