Package net.jini.discovery

Examples of net.jini.discovery.LookupLocatorDiscovery$LocatorReg


     */
    public void setup(QAConfig sysConfig) throws Exception {
        delayLookupStart = true;//don't start lookups, just want config info
        super.setup(sysConfig);
        configLocs = toLocatorArray(initLookupsToStart);
        lld = new LookupLocatorDiscovery(configLocs, sysConfig.getConfiguration());
        locatorDiscoveryList.add(lld);
    }//end setup
View Full Code Here


     */
    public void run() throws Exception {
        logger.log(Level.FINE, "run()");
        /* Create an instance of LookupLocatorDiscovery using null element */
        try {
            lld = new LookupLocatorDiscovery(nullLocs,
               getConfig().getConfiguration());
            locatorDiscoveryList.add(lld);
            String errStr = new String("no NullPointerException");
            logger.log(Level.FINE, errStr);
            throw new TestException(errStr);
View Full Code Here

        logger.log(Level.FINE, "LookupLocatorDiscovery to additionally "
                          +"discover -- ");
        for(int i=0;i<addLocs.length;i++) {
            logger.log(Level.FINE, "   "+addLocs[i]);
        }//end loop
        LookupLocatorDiscovery lld
                 = new LookupLocatorDiscovery(locsToDiscover,
        getConfig().getConfiguration());
        locatorDiscoveryList.add(lld);
        LookupListener newListener = new AbstractBaseTest.LookupListener();

        /* Verify that the lookup locator discovery utility created
         * above is operational by verifying that the INITIIAL lookups
         * are discovered by both listeners.
         */
        logger.log(Level.FINE, "verifying discovery for initial listener ...");
        mainListener.setLookupsToDiscover(initLookupsToStart);
        lld.addDiscoveryListener(mainListener);
        waitForDiscovery(mainListener);

        logger.log(Level.FINE, "verifying discovery for listener to be removed ...");
        newListener.setLookupsToDiscover(initLookupsToStart);
        lld.addDiscoveryListener(newListener);
        waitForDiscovery(newListener);

        /* Remove the listener */
        lld.removeDiscoveryListener(newListener);
        logger.log(Level.FINE, "removed listener from lookup locator discovery");

        /* Verify that the listener still registered with the lookup
         * locator discovery utility (mainListener) continues to receive
         * discovered events (which verifies that events are still being
View Full Code Here

        logger.log(Level.FINE, "starting discovery by creating a "
                          +"LookupLocatorDiscovery to discover -- ");
        for(int i=0;i<locsToDiscover.length;i++) {
            logger.log(Level.FINE, "   "+locsToDiscover[i]);
        }//end loop
        LookupLocatorDiscovery lld
                    = new LookupLocatorDiscovery(locsToDiscover,
           getConfig().getConfiguration());
        locatorDiscoveryList.add(lld);

        /* Verify that the lookup locator discovery utility created
         * above is operational by verifying that the INITIIAL lookups
         * are discovered.
         */
        mainListener.setLookupsToDiscover(initLookupsToStart);
        lld.addDiscoveryListener(mainListener);
        waitForDiscovery(mainListener);

        /* Replace the current locators to discover with the empty set */
        LookupLocator[] locsToRemove = new LookupLocator[0];
        logger.log(Level.FINE, "replace the current set of "
                          +"locators to discover with the EMPTY SET --");
        LocatorsUtil.displayLocatorSet(locsToRemove,"locator",
                                       Level.FINE);

        LookupLocator[] locsBefore = lld.getLocators();
        lld.setLocators(locsToRemove);
        LookupLocator[] locsAfter = lld.getLocators();

        logger.log(Level.FINE, "comparing locators BEFORE "
                          +"and AFTER replacing current set with the"
                          +"EMPTY SET ...");
        // log comparison info
View Full Code Here

        /* Creating a LookupLocatorDiscovery instance using null as the
         * input to the constructor.
         */
        logger.log(Level.FINE, "creating a LookupLocatorDiscovery with input = "
                          +constStr);
        LookupLocatorDiscovery lld
                    = new LookupLocatorDiscovery(locsToDiscover,
         getConfig().getConfiguration());
        locatorDiscoveryList.add(lld);
        /* Add a listener to the lookup locator discovery utility created
         * above, and verify the listener receives no events.
         */
        mainListener.clearAllEventInfo();//listener expects no events
        lld.addDiscoveryListener(mainListener);
        waitForDiscovery(mainListener);
        /* Re-configure the listener to expect events for the lookups
         * started during setup.
         */
        locsToDiscover = toLocatorArray(initLookupsToStart);
        logger.log(Level.FINE, "calling "+methodStr
                          +" to change the locators to discover to -- ");
        for(int i=0;i<locsToDiscover.length;i++) {
            logger.log(Level.FINE, "   "+locsToDiscover[i]);
        }//end loop
        mainListener.setLookupsToDiscover(initLookupsToStart);
        /* Using either addLocators ore setLocators, re-configure the
         * lookup locator discovery utility to discover the lookup
         * services started in setup
         */
        if(addLocs) {
            lld.addLocators(locsToDiscover);
        } else {
            lld.setLocators(locsToDiscover);
        }//endif
        /* Verify that the listener receives the expected events */
        waitForDiscovery(mainListener);
    }//end run
View Full Code Here

     */
    public void run() throws Exception {
        logger.log(Level.FINE, "run()");
        /* Create another LookupLocatorDiscovery for comparison */
       
        LookupLocatorDiscovery newLLD = null;
  newLLD  = new LookupLocatorDiscovery(new LookupLocator[0],
               getConfig().getConfiguration());
        locatorDiscoveryList.add(newLLD);
        if( !satisfiesEqualityTest(locatorDiscovery,newLLD) ) {
            throw new TestException(
                                 "failed equality test -- DIFFERENT instances "
View Full Code Here

        logger.log(Level.FINE, "starting discovery by creating a "
                          +"LookupLocatorDiscovery to discover -- ");
        for(int i=0;i<locsToDiscover.length;i++) {
            logger.log(Level.FINE, "   "+locsToDiscover[i]);
        }//end loop
        LookupLocatorDiscovery lld
               = new LookupLocatorDiscovery(locsToDiscover,
      getConfig().getConfiguration());
        locatorDiscoveryList.add(lld);
        /* Verify that the lookup locator discovery utility created
         * above is operational by verifying that the INITIIAL lookups
         * are discovered.
         */
        mainListener.setLookupsToDiscover(initLookupsToStart);
        lld.addDiscoveryListener(mainListener);
        waitForDiscovery(mainListener);

        /* Terminate the lookup locator discovery utility */
        lld.terminate();
        logger.log(Level.FINE, "terminated lookup locator discovery");

        /* Since the lookup locator discovery utility was terminated, the
         * listener should receive no more events when new lookups are
         * started that have locators the utility is configured to
View Full Code Here

            /* Start locator discovery by creating a lookup locator discovery*/
            logger.log(Level.FINE, "creating a lookup locator discovery "
                              +"initially configured to discover NO_LOCATORS");
            /* discover no locs at first, wait for test to call setLocators */
            locatorDiscovery
                   = new LookupLocatorDiscovery(new LookupLocator[0],
            sysConfig.getConfiguration());
            locatorDiscoveryList.add(locatorDiscovery);
            mainListener = new LookupListener();
        } catch(Exception e) {
            e.printStackTrace();
View Full Code Here

     */
    public void setup(QAConfig sysConfig) throws Exception {
        delayLookupStart = true;//don't start lookups, just want config info
        super.setup(sysConfig);
        configLocs = toLocatorArray(initLookupsToStart);
        lld = new LookupLocatorDiscovery(configLocs, sysConfig.getConfiguration());
        locatorDiscoveryList.add(lld);
    }//end setup
View Full Code Here

        /* Create LookupLocatorDiscovery instance using the new locs */
        logger.log(Level.FINE, "constructing LookupLocatorDiscovery to discover -- ");
        for(int i=0;i<dupLocs.length;i++) {
            logger.log(Level.FINE, "   "+dupLocs[i]);
        }//end loop
        LookupLocatorDiscovery newLLD
                   = new LookupLocatorDiscovery(dupLocs,
                getConfig().getConfiguration());
        locatorDiscoveryList.add(newLLD);
        /* Verify discovery */
        doDiscovery(newLookups,newLLD,mainListener);
    }//end run
View Full Code Here

TOP

Related Classes of net.jini.discovery.LookupLocatorDiscovery$LocatorReg

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.