Package net.jini.core.transaction

Examples of net.jini.core.transaction.Transaction.commit()


        expectedResult.add(sampleEntry1);
        Transaction txn = getTransaction();
        testTemplates(templates, txn, Lease.ANY, MAX_ENTRIES, expectedResult,
                      "Reading one entry");
        checkEntriesExist(expectedResult, txn, "Reading one entry");
        txn.commit();
        reset();

        templates.add(new SimpleEntry(null, 2));
        expectedResult.add(sampleEntry2);
        expectedResult.add(sampleEntry3);
View Full Code Here


        txn = getTransaction();
        testTemplates(templates, txn, Lease.ANY, MAX_ENTRIES, expectedResult,
                      "Reading two entries with one template");
        checkEntriesExist(expectedResult, txn,
                          "Reading two entries with one template");
        txn.commit();
        reset();

        templates.add(new SimpleEntry(null, null));
        expectedResult.add(sampleEntry1);
        expectedResult.add(sampleEntry2);
View Full Code Here

        txn = getTransaction();
        testTemplates(templates, txn, Lease.ANY, MAX_ENTRIES, expectedResult,
                      "Reading three entries with one template");
        checkEntriesExist(expectedResult, txn,
                          "Reading three entries with one template");
        txn.commit();
        reset();

        templates.add(null);
        expectedResult.add(sampleEntry1);
        expectedResult.add(sampleEntry2);
View Full Code Here

        txn = getTransaction();
        testTemplates(templates, txn, Lease.ANY, MAX_ENTRIES, expectedResult,
                      "Reading with template containing null value");
        checkEntriesExist(expectedResult, txn,
                          "Reading with template containing null value");
        txn.commit();
        reset();

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

        txn = getTransaction();
        testTemplates(templates, txn, Lease.ANY, MAX_ENTRIES, expectedResult,
                      "Reading with template containing duplicates");
        checkEntriesExist(expectedResult, txn,
                          "Reading with template containing duplicates");
        txn.commit();
        reset();

        /*
         * No more entries can be added to exhausted match set. It also tests
         * that an entry is removed from match set after performing
View Full Code Here

        Thread.sleep(1000);
        if (matchSet.next() != null) {
            throw new TestException("An entry added to exhausted match set. "
                                    + "But must not have been.");
        }
        txn.commit();
        reset();

        /*
         * After maxEntries entries are yielded by next invocations the match
         * set becomes empty. For this test case let maxEntries = 2
View Full Code Here

        matchSet.next();
        if (matchSet.next() != null) {
            throw new TestException("Match set is not empty after maxEntries "
                                    + "are yielded by next invocations");
        }
        txn.commit();
        reset();

        /*
         * The initial duration of the lease must be less than or equal to
         * leaseDuration. Let leaseDuration = instantTime.
View Full Code Here

            if (initialDuration > leaseForeverTime) {
                throw new TestException("Initial duration of the lease "
                                        + "is more than leaseDuration");
            }
        } // else Lease is not tested as the matchset is not leased
        txn.commit();
        reset();

        //corresponds to item #6 in this method's comments
        txn = getTransaction();
        templates.add((SimpleEntry) sampleEntry1.clone());
View Full Code Here

                (SimpleEntry) sampleEntry1.clone(), null, instantTime);
        if (entry != null) {
            throw new TestException("Locked entry can be taken "
                                    + "from the space.");
        }
        txn.commit();
        reset();

        //corresponds to item #7 in this method's comments
        txn = getTransaction();
        templates.add((SimpleEntry) sampleEntry1.clone());
View Full Code Here

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

        // transaction txn is not null and is not usable by the space
        try {
            space05.contents(templates, txn, instantTime, MAX_ENTRIES);
            throw new TestException("TransactionException is not thrown "
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.