Package javax.jdo

Examples of javax.jdo.FetchGroup


                    + "\n  modifiable: " + printFetchGroup(modifiable),
                    scoped, modifiable);
    }

    public void testPMFGetFetchGroupNotIdentical() {
        FetchGroup first = pmf.getFetchGroup(Address.class, "default");
        FetchGroup second = pmf.getFetchGroup(Address.class, "default");
        assertNotSame("First FetchGroup is identical to second FetchGroup;"
                    + "\n first: " + printFetchGroup(first)
                    + "\nsecond: " + printFetchGroup(second),
                    first, second);
    }
View Full Code Here


                    + "\nsecond: " + printFetchGroup(second),
                    first, second);
    }

    public void testPMGetFetchGroupEquals() {
        FetchGroup unmodifiable = pm.getFetchGroup(Address.class, "default");
        unmodifiable.setUnmodifiable();
        FetchGroup modifiable = pm.getFetchGroup(Address.class, "default");
        assertEquals("Unmodifiable FetchGroup is not equal to modifiable FetchGroup;"
                    + "\nunmodifiable: " + printFetchGroup(unmodifiable)
                    + "\n  modifiable: " + printFetchGroup(modifiable),
                    unmodifiable, modifiable);
    }
View Full Code Here

                    + "\n  modifiable: " + printFetchGroup(modifiable),
                    unmodifiable, modifiable);
    }

    public void testPMModifiable() {
        FetchGroup scoped = pm.getFetchGroup(Address.class, "default");
        assertFalse("Scoped FetchGroup should be modifiable initially, but is unmodifiable.",
                scoped.isUnmodifiable());
        scoped.setUnmodifiable();
        assertTrue("Scoped FetchGroup should be unmodifiable after setUnmodifiable, but is modifiable.",
                scoped.isUnmodifiable());
    }
View Full Code Here

        assertTrue("Scoped FetchGroup should be unmodifiable after setUnmodifiable, but is modifiable.",
                scoped.isUnmodifiable());
    }

    public void testPMFModifiable() {
        FetchGroup scoped = pmf.getFetchGroup(Address.class, "default");
        assertFalse("Unscoped FetchGroup should be modifiable initially, but is unmodifiable.",
                scoped.isUnmodifiable());
        scoped.setUnmodifiable();
        assertTrue("Unscoped FetchGroup should be unmodifiable after setUnmodifiable, but is modifiable.",
                scoped.isUnmodifiable());
    }
View Full Code Here

        checkAddCategory(PIEmployee.class, FetchGroup.MULTIVALUED, multivaluedMembers);
        failOnError();
    }

    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

                + " should contain all but multivalued members.\n",
                expectedSet, members);       
    }

    public void testAddMember() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMember");
        for (int i = 0; i < allMembers.length; ++i) {
            String member = allMembers[i];
            fg.addMember(member);
            Set members = fg.getMembers();
            assertTrue("FetchGroup should contain " + member + " but does not.\n"
                    + printFetchGroup(fg),
                    members.contains(member));
            assertEquals("FetchGroup should contain " + i+1
                    + "members, but does not; ",
View Full Code Here

                    i+1, members.size());
        }
    }

    public void testAddMembers() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testAddMembers");
        fg.addMembers(multivaluedMembers);
        fg.addMembers(allButMultivaluedMembers);
        Set members = fg.getMembers();
        Set expectedSet = new HashSet();
        expectedSet.addAll(Arrays.asList(allMembers));
        assertEquals("FetchGroup should contain all members.\n",
                expectedSet, members);
    }
View Full Code Here

        assertEquals("FetchGroup should contain all members.\n",
                expectedSet, members);
    }

    public void testRemoveMembers() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRemoveMembers");
        fg.addMembers(allMembers);
        fg.removeMembers(relationshipMembers);
        Set members = fg.getMembers();
        Set expectedSet = new HashSet();
        expectedSet.addAll(Arrays.asList(basicMembers));
        expectedSet.add("phoneNumbers");
        assertEquals("FetchGroup should contain basic members " +
                "plus address plus phoneNumbers.\n",
                expectedSet, members);
        fg.removeMembers(basicMembers);
        members = fg.getMembers();
        expectedSet = new HashSet();
        expectedSet.add("phoneNumbers");
        assertEquals("FetchGroup should contain address plus phoneNumbers.\n",
                expectedSet, members);
    }
View Full Code Here

        assertEquals("FetchGroup should contain address plus phoneNumbers.\n",
                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"
                    + printFetchGroup(fg),
                    members.contains(member));
            assertEquals("FetchGroup should contain " + i
                    + "members, but does not; ",
View Full Code Here

                    i, members.size());
        }
    }

    public void testRecursionDepth() {
        FetchGroup fg = pm.getFetchGroup(Employee.class, "testRecursionDepth");
        fg.addMember("manager");
        int depth = fg.getRecursionDepth("manager");
        assertEquals("Initial recursion depth for manager should be 1." +
                printFetchGroup(fg),
                1, depth);
        fg.setRecursionDepth("manager", 64);
        assertEquals("Recursion depth for manager should be 64." +
                printFetchGroup(fg),
                64, fg.getRecursionDepth("manager"));
    }
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.