Package net.jini.space

Examples of net.jini.space.JavaSpace05.contents()


         * that an entry is removed from match set after performing
         * MatchSet.next() method
         */
        JavaSpace05 space05 = (JavaSpace05) space;
        templates.add(sampleEntry1);
        MatchSet matchSet = space05.contents(templates, null, Lease.ANY,
                                             MAX_ENTRIES);
        if (matchSet.next() == null) {
            throw new TestException("Match set is exhausted. "
                                    + "But it shouldn't be.");
        }
View Full Code Here


        /*
         * After maxEntries entries are yielded by next invocations the match
         * set becomes empty. For this test case let maxEntries = 2
         */
        templates.add(null);    // for 3 existing entries
        matchSet = space05.contents(templates, null, Lease.ANY, 2);
        matchSet.next();
        matchSet.next();
        if (matchSet.next() != null) {
            throw new TestException("Match set is not empty after maxEntries "
                                    + "are yielded by next invocations");
View Full Code Here

        /*
         * The initial duration of the lease must be less than or equal to
         * leaseDuration. Let leaseDuration = instantTime.
         */
        templates.add(null);    // for 3 existing entries
        matchSet = space05.contents(templates, null, leaseForeverTime,
                                    MAX_ENTRIES);
        Lease lease = matchSet.getLease();
        if (lease != null) {
            long initialDuration = lease.getExpiration()
                    - System.currentTimeMillis();
View Full Code Here

        reset();

        templates.add((SimpleEntry) sampleEntry1.clone());
        templates.add("not an Entry");
        try {
            space05.contents(templates, null, Lease.ANY, MAX_ENTRIES);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when a non-null element of tepmlates "
                                    + "is not an instance on Entry");
        } catch (IllegalArgumentException e) {}
View Full Code Here

                                    + "is not an instance on Entry");
        } catch (IllegalArgumentException e) {}

        templates.clear();
        try {
            space05.contents(templates, null, Lease.ANY, MAX_ENTRIES);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when templates is empty");
        } catch (IllegalArgumentException e) {}

        templates.add((SimpleEntry) sampleEntry1.clone());
View Full Code Here

                                    + "when templates is empty");
        } catch (IllegalArgumentException e) {}

        templates.add((SimpleEntry) sampleEntry1.clone());
        try {
            space05.contents(templates, null, 0, MAX_ENTRIES);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when leaseDuration is nither positive "
                                    + "nor Lease.ANY (0)");
        } catch (IllegalArgumentException e) {}
View Full Code Here

                                    + "when leaseDuration is nither positive "
                                    + "nor Lease.ANY (0)");
        } catch (IllegalArgumentException e) {}

        try {
            space05.contents(templates, null, Lease.ANY - 1, MAX_ENTRIES);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when leaseDuration is nither positive "
                                    + "nor Lease.ANY (Lease.ANY-1)");
        } catch (IllegalArgumentException e) {}
View Full Code Here

                                    + "when leaseDuration is nither positive "
                                    + "nor Lease.ANY (Lease.ANY-1)");
        } catch (IllegalArgumentException e) {}

        try {
            space05.contents(templates, null, Lease.ANY, 0);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when maxEntries is non-positive (0)");
        } catch (IllegalArgumentException e) {}

        try {
View Full Code Here

            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when maxEntries is non-positive (0)");
        } catch (IllegalArgumentException e) {}

        try {
            space05.contents(templates, null, Lease.ANY, -1);
            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when maxEntries is non-positive (-1)");
        } catch (IllegalArgumentException e) {}

        try {
View Full Code Here

            throw new TestException("IllegalArgumentException is not thrown "
                                    + "when maxEntries is non-positive (-1)");
        } catch (IllegalArgumentException e) {}

        try {
            space05.contents(null, null, Lease.ANY, MAX_ENTRIES);
            throw new TestException("NullPointerException is not thrown "
                                    + "when tmpls is null");
        } catch (NullPointerException e) {}

        cleanSpace(space);
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.