You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2013/03/05 10:22:31 UTC
svn commit: r1452708 [2/7] - in
/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini: qa/resources/
test/impl/fiddler/event/ test/share/ test/spec/discoveryservice/
test/spec/discoveryservice/event/
Modified: river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/discoveryservice/AbstractBaseTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/discoveryservice/AbstractBaseTest.java?rev=1452708&r1=1452707&r2=1452708&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/discoveryservice/AbstractBaseTest.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/qa/src/com/sun/jini/test/spec/discoveryservice/AbstractBaseTest.java Tue Mar 5 09:22:30 2013
@@ -86,6 +86,9 @@ import net.jini.security.proxytrust.Serv
import com.sun.jini.proxy.BasicProxyTrustVerifier;
import com.sun.jini.qa.harness.Test;
+import com.sun.jini.test.share.LookupServices;
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
/**
* This class is an abstract class that acts as the base class which
@@ -110,38 +113,137 @@ import com.sun.jini.qa.harness.Test;
*/
abstract public class AbstractBaseTest extends QATestEnvironment implements Test {
- protected boolean debugFlag = false;//resets timeouts for faster completion
- protected boolean displayOn = false;//verbose in waitForDiscovery/Discard
+ protected volatile boolean debugFlag = false;//resets timeouts for faster completion
+ protected volatile boolean displayOn = false;//verbose in waitForDiscovery/Discard
protected static final int FAST_TIMEOUT = 5;
- protected static final int ACTIVE_DISCARDED = 0;//discard
- protected static final int COMM_DISCARDED = 1;//terminate
- protected static final int NO_INTEREST_DISCARDED = 2;//replace groups
- protected static final int PASSIVE_DISCARDED = 3;//stop announcements
+ public static final int ACTIVE_DISCARDED = 0;//discard
+ public static final int COMM_DISCARDED = 1;//terminate
+ public static final int NO_INTEREST_DISCARDED = 2;//replace groups
+ public static final int PASSIVE_DISCARDED = 3;//stop announcements
+
+ /**
+ * @return the genMap
+ */
+ public Map<Object,String[]> getGenMap() {
+ return lookupServices.getGenMap();
+ }
+
+ /**
+ * @return the registrationMap
+ */
+ public Map<Object,RemoteEventListener> getRegistrationMap() {
+ return lookupServices.getRegistrationMap();
+ }
+
+ /**
+ * @return the announceInterval
+ */
+ public int getAnnounceInterval() {
+ return lookupServices.getAnnounceInterval();
+ }
+
+ /**
+ * @return the minNAnnouncements
+ */
+ public int getMinNAnnouncements() {
+ return lookupServices.getMinNAnnouncements();
+ }
+
+ /**
+ * @return the nIntervalsToWait
+ */
+ public int getnIntervalsToWait() {
+ return lookupServices.getnIntervalsToWait();
+ }
+
+ /**
+ * @return the useGroupAndLocDiscovery0
+ */
+ public List<DiscoveryStruct> getUseGroupAndLocDiscovery0() {
+ return lookupServices.getUseGroupAndLocDiscovery0();
+ }
+
+ /**
+ * @return the useGroupAndLocDiscovery1
+ */
+ public List<DiscoveryStruct> getUseGroupAndLocDiscovery1() {
+ return lookupServices.getUseGroupAndLocDiscovery1();
+ }
+
+ /**
+ * @return the useOnlyGroupDiscovery
+ */
+ public List<DiscoveryStruct> getUseOnlyGroupDiscovery() {
+ return lookupServices.getUseOnlyGroupDiscovery();
+ }
+
+ /**
+ * @return the useOnlyLocDiscovery
+ */
+ public List<DiscoveryStruct> getUseOnlyLocDiscovery() {
+ return lookupServices.getUseOnlyLocDiscovery();
+ }
/** Ordered pair containing a ServiceRegistrar and its member groups */
- protected class RegGroupsPair {
- ServiceRegistrar reg;
- String[] groups;
- RegGroupsPair(ServiceRegistrar reg, String[] groups) {
+ public static class RegGroupsPair {
+ private final ServiceRegistrar reg;
+ private final String[] groups;
+
+ public RegGroupsPair(ServiceRegistrar reg, String[] groups) {
this.reg = reg;
- this.groups = groups;
+ this.groups = groups !=null ? groups.clone() : null;
+ }
+
+ /**
+ * @return the reg
+ */
+ ServiceRegistrar getReg() {
+ return reg;
+ }
+
+ /**
+ * @return the groups
+ */
+ String[] getGroups() {
+ return groups != null ? groups.clone() : null;
}
}//end class RegGroupsPair
/** Data structure containing groups and/or locator to discover */
- protected class DiscoveryStruct {
- String[] groups; // ALL_GROUPS or NO_GROUPS ==> empty "slot"
- LookupLocator locator; // null ==> empty "slot"
- RegGroupsPair regGroups;
- DiscoveryStruct(String[] groups,
- LookupLocator locator,
- RegGroupsPair regGroups) {
- this.groups = groups;
+ public static class DiscoveryStruct {
+ private final String[] groups; // ALL_GROUPS or NO_GROUPS ==> empty "slot"
+ private final LookupLocator locator; // null ==> empty "slot"
+ private final RegGroupsPair regGroups;
+ public DiscoveryStruct( String[] groups,
+ LookupLocator locator,
+ RegGroupsPair regGroups) {
+ this.groups = groups != null ? groups.clone() : null;
this.locator = locator;
this.regGroups = regGroups;
}
+
+ /**
+ * @return the groups
+ */
+ String[] getGroups() {
+ return groups != null ? groups.clone() : null;
+ }
+
+ /**
+ * @return the locator
+ */
+ LookupLocator getLocator() {
+ return locator;
+ }
+
+ /**
+ * @return the regGroups
+ */
+ RegGroupsPair getRegGroups() {
+ return regGroups;
+ }
}//end class DiscoveryStruct
/** Tuple type for collecting and returning registrar information from
@@ -151,43 +253,61 @@ abstract public class AbstractBaseTest e
* all registrars.
*/
protected class RegTuple {
- public ServiceRegistrar[] regs;
- public MarshalledObject[] mRegs;
- public Throwable[] exceptions;
- public Map groupsMap;
+ private final ServiceRegistrar[] regs;
+ private final MarshalledObject[] mRegs;
+ private final Throwable[] exceptions;
+ private final Map groupsMap;
RegTuple(ServiceRegistrar[] regs,
MarshalledObject[] mRegs,
Throwable[] exceptions,
Map groupsMap)
{
- this.regs = regs;
- this.mRegs = mRegs;
- this.exceptions = exceptions;
- this.groupsMap = groupsMap;
+ this.regs = regs.clone();
+ this.mRegs = mRegs.clone();
+ this.exceptions = exceptions.clone();
+ this.groupsMap = new HashMap(groupsMap);
+ }
+
+ /**
+ * @return the regs
+ */
+ public ServiceRegistrar[] getRegs() {
+ return regs.clone();
+ }
+
+ /**
+ * @return the mRegs
+ */
+ public MarshalledObject[] getmRegs() {
+ return mRegs.clone();
+ }
+
+ /**
+ * @return the exceptions
+ */
+ public Throwable[] getExceptions() {
+ return exceptions.clone();
+ }
+
+ /**
+ * @return the groupsMap
+ */
+ public Map getGroupsMap() {
+ return new HashMap(groupsMap);
}
}//end class RegTuple
/** Data structure containing information about each registration */
- protected class RegistrationInfo {
- public String[] groupsToDiscover;
- public LookupLocator[] locatorsToDiscover;
- public int handback = -1;//equivalent to null handback
+ public class RegistrationInfo {
+ private volatile String[] groupsToDiscover;
+ private volatile LookupLocator[] locatorsToDiscover;
+ private volatile int handback = -1;//equivalent to null handback
- int expectedHandback;
-
- RegistrationInfo(String[] groupsToDiscover,
- LookupLocator[] locatorsToDiscover,
- int expectedHandback)
- {
- this.groupsToDiscover = groupsToDiscover;
- this.locatorsToDiscover = locatorsToDiscover;
- this.expectedHandback = expectedHandback;
- initState();
- }//end constructor
+ private int expectedHandback;
/* Modified by the listener as events are received */
- public HashMap discoveredMap = new HashMap(11);
- public HashMap discardedMap = new HashMap(11);
+ private final HashMap discoveredMap;
+ private final HashMap discardedMap;
/* Reflects current discovery/discard state for this regInfo.
* Initialized to false.
@@ -195,16 +315,40 @@ abstract public class AbstractBaseTest e
* Should be re-set to false whenever the expected discovery or
* expected discard events change (ex. because of a call to setGroups)
*/
- public boolean discoveryComplete = false;
- public boolean discardComplete = false;
+ private volatile boolean discoveryComplete;
+ private volatile boolean discardComplete;
/* holds current configuration for expected discoveries and discards */
- public HashMap expectedDiscoveredMap = new HashMap(11);
+ private final HashMap expectedDiscoveredMap;
+
+ private final HashMap expectedActiveDiscardedMap;
+ private final HashMap expectedCommDiscardedMap;
+ private final Map expectedNoInterestDiscardedMap;
+ private final Map expectedPassiveDiscardedMap;
+
+
+ RegistrationInfo(String[] groupsToDiscover,
+ LookupLocator[] locatorsToDiscover,
+ int expectedHandback)
+ {
+ this.groupsToDiscover = groupsToDiscover;
+ this.locatorsToDiscover = locatorsToDiscover;
+ this.expectedHandback = expectedHandback;
+ discoveredMap = new HashMap(11);
+ discardedMap = new HashMap(11);
+ discoveryComplete = false;
+ discardComplete = false;
+ expectedDiscoveredMap = new HashMap(11);
+ expectedActiveDiscardedMap = new HashMap(11);
+ expectedCommDiscardedMap = new HashMap(11);
+ expectedNoInterestDiscardedMap = new ConcurrentHashMap();
+ expectedPassiveDiscardedMap = new ConcurrentHashMap(11);
+
+ initState();
+
+ }//end constructor
- public HashMap expectedActiveDiscardedMap = new HashMap(11);
- public HashMap expectedCommDiscardedMap = new HashMap(11);
- public HashMap expectedNoInterestDiscardedMap = new HashMap(11);
- public HashMap expectedPassiveDiscardedMap = new HashMap(11);
+
/** This method resets the state of each flag and set related to
* discovery and discard events received for this regInfo.
@@ -213,15 +357,15 @@ abstract public class AbstractBaseTest e
synchronized(this) {
discoveryComplete = false;
discardComplete = false;
- discoveredMap.clear();
- discardedMap.clear();
+ getDiscoveredMap().clear();
+ getDiscardedMap().clear();
- expectedDiscoveredMap.clear();
+ getExpectedDiscoveredMap().clear();
- expectedActiveDiscardedMap.clear();
- expectedCommDiscardedMap.clear();
- expectedNoInterestDiscardedMap.clear();
- expectedPassiveDiscardedMap.clear();
+ getExpectedActiveDiscardedMap().clear();
+ getExpectedCommDiscardedMap().clear();
+ getExpectedNoInterestDiscardedMap().clear();
+ getExpectedPassiveDiscardedMap().clear();
}//end sync(this)
}//end resetAllEventInfo
@@ -231,8 +375,8 @@ abstract public class AbstractBaseTest e
public void resetDiscoveryEventInfo() {
synchronized(this) {
discoveryComplete = false;
- discoveredMap.clear();
- expectedDiscoveredMap.clear();
+ getDiscoveredMap().clear();
+ getExpectedDiscoveredMap().clear();
}//end sync(this)
}//end resetDiscoveryEventInfo
@@ -242,12 +386,12 @@ abstract public class AbstractBaseTest e
public void resetDiscardEventInfo() {
synchronized(this) {
discardComplete = false;
- discardedMap.clear();
+ getDiscardedMap().clear();
- expectedActiveDiscardedMap.clear();
- expectedCommDiscardedMap.clear();
- expectedNoInterestDiscardedMap.clear();
- expectedPassiveDiscardedMap.clear();
+ getExpectedActiveDiscardedMap().clear();
+ getExpectedCommDiscardedMap().clear();
+ getExpectedNoInterestDiscardedMap().clear();
+ getExpectedPassiveDiscardedMap().clear();
}//end sync(this)
}//end resetDiscardEventInfo
@@ -257,13 +401,13 @@ abstract public class AbstractBaseTest e
* and then re-sets the values of the fields in this class that
* related to the expected discovery/discard state of this regInfo.
*/
- void setLookupsToDiscover(String[] groups, LookupLocator[] locators) {
+ public void setLookupsToDiscover(String[] groups, LookupLocator[] locators) {
groupsToDiscover = groups;
locatorsToDiscover = locators;
discoveryComplete = false;
discardComplete = false;
- expectedNoInterestDiscardedMap.clear();
- expectedPassiveDiscardedMap.clear();
+ getExpectedNoInterestDiscardedMap().clear();
+ getExpectedPassiveDiscardedMap().clear();
synchronized(this) {
/* If a registrar that's already been DISCOVERED belongs to
* NONE of the groups to discover, and has a corresponding
@@ -273,7 +417,7 @@ abstract public class AbstractBaseTest e
* expectedNoInterestDiscardedMap and into the
* expectedPassiveDiscardedMap.
*/
- Set eSet = discoveredMap.entrySet();
+ Set eSet = getDiscoveredMap().entrySet();
Iterator iter = eSet.iterator();
while(iter.hasNext()) {
Map.Entry pair = (Map.Entry)iter.next();
@@ -281,9 +425,9 @@ abstract public class AbstractBaseTest e
String[] srvcRegGroups = (String[])pair.getValue();
boolean inSet = inToDiscoverSet(srvcReg,srvcRegGroups);
if( inToDiscoverSet(srvcReg,srvcRegGroups) ) continue;
- expectedDiscoveredMap.remove(srvcReg);
- expectedNoInterestDiscardedMap.put(srvcReg,srvcRegGroups);
- expectedPassiveDiscardedMap.put(srvcReg,srvcRegGroups);
+ getExpectedDiscoveredMap().remove(srvcReg);
+ getExpectedNoInterestDiscardedMap().put(srvcReg,srvcRegGroups);
+ getExpectedPassiveDiscardedMap().put(srvcReg,srvcRegGroups);
}//end loop
/* If one of the registrars that's already been DISCARDED
* belongs to any of the groups to discover and/or has a
@@ -291,17 +435,17 @@ abstract public class AbstractBaseTest e
* discover, MOVE that registrar's corresponding element from
* the discardedMap into the expectedDiscoveredMap.
*/
- eSet = discardedMap.entrySet();
+ eSet = getDiscardedMap().entrySet();
iter = eSet.iterator();
while(iter.hasNext()) {
Map.Entry pair = (Map.Entry)iter.next();
ServiceRegistrar srvcReg = (ServiceRegistrar)pair.getKey();
String[] srvcRegGroups = (String[])pair.getValue();
if( !inToDiscoverSet(srvcReg,srvcRegGroups) ) continue;
- discardedMap.remove(srvcReg);
- expectedNoInterestDiscardedMap.remove(srvcReg);
- expectedPassiveDiscardedMap.remove(srvcReg);
- expectedDiscoveredMap.put(srvcReg,srvcRegGroups);
+ getDiscardedMap().remove(srvcReg);
+ getExpectedNoInterestDiscardedMap().remove(srvcReg);
+ getExpectedPassiveDiscardedMap().remove(srvcReg);
+ getExpectedDiscoveredMap().put(srvcReg,srvcRegGroups);
}//end loop
}//end sync(this)
/* If one of the groups or locs to discover corresponds to one
@@ -311,7 +455,7 @@ abstract public class AbstractBaseTest e
* those un-discovered lookups to the expectedDiscoveredMap.
*/
synchronized(lockObject) {
- Iterator iter = genMap.keySet().iterator();
+ Iterator iter = getGenMap().keySet().iterator();
while(iter.hasNext()) {
Object curGen = iter.next();
ServiceRegistrar srvcReg = null;
@@ -331,16 +475,16 @@ abstract public class AbstractBaseTest e
continue;
}
}//endif
- String[] srvcRegGroups = (String[])genMap.get(curGen);
- if(groupsToDiscover==DiscoveryGroupManagement.ALL_GROUPS){
- expectedDiscoveredMap.put(srvcReg,srvcRegGroups);
+ String[] srvcRegGroups = (String[])getGenMap().get(curGen);
+ if(getGroupsToDiscover()==DiscoveryGroupManagement.ALL_GROUPS){
+ getExpectedDiscoveredMap().put(srvcReg,srvcRegGroups);
} else {//(groupsToDiscover != ALL_GROUPS
boolean moveToExpected = false;
iLoop:
for(int i=0;i<srvcRegGroups.length;i++) {
- for(int j=0;j<groupsToDiscover.length;j++) {
+ for(int j=0;j<getGroupsToDiscover().length;j++) {
if( srvcRegGroups[i].equals
- (groupsToDiscover[j]) )
+ (getGroupsToDiscover()[j]) )
{
moveToExpected = true;
break iLoop;
@@ -348,9 +492,9 @@ abstract public class AbstractBaseTest e
}//end loop(j)
}//end loop(i)
if(!moveToExpected) {//no groups, try loc
- for(int i=0;i<locatorsToDiscover.length;i++) {
+ for(int i=0;i<getLocatorsToDiscover().length;i++) {
if( locsEqual
- (srvcRegLoc,locatorsToDiscover[i]) )
+ (srvcRegLoc,getLocatorsToDiscover()[i]) )
{
moveToExpected = true;
break;
@@ -358,7 +502,7 @@ abstract public class AbstractBaseTest e
}//end loop
}//endif(!moveToExpected)
if(!moveToExpected) continue;
- expectedDiscoveredMap.put(srvcReg,srvcRegGroups);
+ getExpectedDiscoveredMap().put(srvcReg,srvcRegGroups);
}//endif(groupsToDiscover == ALL_GROUPS)
}//end loop
}//end sync(lockObject)
@@ -371,14 +515,14 @@ abstract public class AbstractBaseTest e
private boolean inToDiscoverSet(ServiceRegistrar srvcReg,
String[] srvcRegGroups)
{
- if(groupsToDiscover == DiscoveryGroupManagement.ALL_GROUPS) {
+ if(getGroupsToDiscover() == DiscoveryGroupManagement.ALL_GROUPS) {
return true;
}//endif
boolean inSet = false;
iLoop:
for(int i=0;i<srvcRegGroups.length;i++) {
- for(int j=0;j<groupsToDiscover.length;j++) {
- if( srvcRegGroups[i].equals(groupsToDiscover[j]) ){
+ for(int j=0;j<getGroupsToDiscover().length;j++) {
+ if( srvcRegGroups[i].equals(getGroupsToDiscover()[j]) ){
inSet = true;
break iLoop;
}//endif
@@ -387,8 +531,8 @@ abstract public class AbstractBaseTest e
if(!inSet) {//no groups, try loc
try {
LookupLocator srvcRegLoc = QAConfig.getConstrainedLocator(srvcReg.getLocator());
- for(int i=0;i<locatorsToDiscover.length;i++) {
- if( locsEqual(srvcRegLoc,locatorsToDiscover[i]) ) {
+ for(int i=0;i<getLocatorsToDiscover().length;i++) {
+ if( locsEqual(srvcRegLoc,getLocatorsToDiscover()[i]) ) {
inSet = true;
break;
}//endif
@@ -409,7 +553,7 @@ abstract public class AbstractBaseTest e
*/
private void initState() {
synchronized(lockObject) {
- Iterator iter = genMap.keySet().iterator();
+ Iterator iter = getGenMap().keySet().iterator();
for(int i=0;iter.hasNext();i++) {
Object curGen = iter.next();
ServiceRegistrar lookupProxy = null;
@@ -427,12 +571,12 @@ abstract public class AbstractBaseTest e
e.printStackTrace();
}
}//endif
- String[] genGroups = (String[])genMap.get(curGen);
+ String[] genGroups = (String[])getGenMap().get(curGen);
/* is genLoc in the set of locators to discover? */
boolean discoverLoc = false;
- if(locatorsToDiscover != null) {
- for(int j=0;j<locatorsToDiscover.length;j++) {
- if( locsEqual(genLoc,locatorsToDiscover[j]) ) {
+ if(getLocatorsToDiscover() != null) {
+ for(int j=0;j<getLocatorsToDiscover().length;j++) {
+ if( locsEqual(genLoc,getLocatorsToDiscover()[j]) ) {
discoverLoc = true;
break;
}//endif
@@ -442,13 +586,13 @@ abstract public class AbstractBaseTest e
/* are any of the generator's member groups in the
* set of groups to discover for this registration?
*/
- if(groupsToDiscover==DiscoveryGroupManagement.ALL_GROUPS) {
+ if(getGroupsToDiscover()==DiscoveryGroupManagement.ALL_GROUPS) {
discoverGroups = true;//even if lookup is NO_GROUPS
} else { // (groupsToDiscover != ALL_GROUPS)
jLoop:
- for(int j=0;j<groupsToDiscover.length;j++) {
+ for(int j=0;j<getGroupsToDiscover().length;j++) {
for(int k=0;k<genGroups.length;k++) {
- if((genGroups[k]).equals(groupsToDiscover[j])){
+ if((genGroups[k]).equals(getGroupsToDiscover()[j])){
discoverGroups = true;
break jLoop;
}//endif
@@ -457,26 +601,117 @@ abstract public class AbstractBaseTest e
}//endif
/* populate the expected discoveries and discards */
if(discoverLoc || discoverGroups) {
- expectedDiscoveredMap.put(lookupProxy,genGroups);
+ getExpectedDiscoveredMap().put(lookupProxy,genGroups);
}//endif
/* active - for discard, group or loc change requests, */
if(discoverLoc || discoverGroups) {
- expectedActiveDiscardedMap.put(lookupProxy,genGroups);
+ getExpectedActiveDiscardedMap().put(lookupProxy,genGroups);
}//endif
/* passive - for announcement termination */
if(discoverGroups) {
- expectedCommDiscardedMap.put(lookupProxy,genGroups);
+ getExpectedCommDiscardedMap().put(lookupProxy,genGroups);
}//endif
/* passive - for announcement stop, groups change */
if(!discoverLoc && discoverGroups) {
- expectedNoInterestDiscardedMap.put(lookupProxy,
+ getExpectedNoInterestDiscardedMap().put(lookupProxy,
genGroups);
- expectedPassiveDiscardedMap.put(lookupProxy,
+ getExpectedPassiveDiscardedMap().put(lookupProxy,
genGroups);
}//endif
}//end loop(iter)
}//end sync
}//end initState
+
+ /**
+ * @return the groupsToDiscover
+ */
+ public String[] getGroupsToDiscover() {
+ return groupsToDiscover;
+ }
+
+ /**
+ * @return the locatorsToDiscover
+ */
+ public LookupLocator[] getLocatorsToDiscover() {
+ return locatorsToDiscover;
+ }
+
+ /**
+ * @return the handback
+ */
+ public int getHandback() {
+ return handback;
+ }
+
+ /**
+ * @return the expectedHandback
+ */
+ public int getExpectedHandback() {
+ return expectedHandback;
+ }
+
+ /**
+ * @return the discoveredMap
+ */
+ public HashMap getDiscoveredMap() {
+ return discoveredMap;
+ }
+
+ /**
+ * @return the discardedMap
+ */
+ public HashMap getDiscardedMap() {
+ return discardedMap;
+ }
+
+ /**
+ * @return the discoveryComplete
+ */
+ public boolean isDiscoveryComplete() {
+ return discoveryComplete;
+ }
+
+ /**
+ * @return the discardComplete
+ */
+ public boolean isDiscardComplete() {
+ return discardComplete;
+ }
+
+ /**
+ * @return the expectedDiscoveredMap
+ */
+ public HashMap getExpectedDiscoveredMap() {
+ return expectedDiscoveredMap;
+ }
+
+ /**
+ * @return the expectedActiveDiscardedMap
+ */
+ public HashMap getExpectedActiveDiscardedMap() {
+ return expectedActiveDiscardedMap;
+ }
+
+ /**
+ * @return the expectedCommDiscardedMap
+ */
+ public HashMap getExpectedCommDiscardedMap() {
+ return expectedCommDiscardedMap;
+ }
+
+ /**
+ * @return the expectedNoInterestDiscardedMap
+ */
+ public Map getExpectedNoInterestDiscardedMap() {
+ return expectedNoInterestDiscardedMap;
+ }
+
+ /**
+ * @return the expectedPassiveDiscardedMap
+ */
+ public Map getExpectedPassiveDiscardedMap() {
+ return expectedPassiveDiscardedMap;
+ }
}//end class RegistrationInfo
/** Remote event listener class used to monitor the discovery events
@@ -543,21 +778,21 @@ abstract public class AbstractBaseTest e
private void discovered(RemoteDiscoveryEvent evnt) {
RegTuple regTuple = getRegistrars(evnt);
- ServiceRegistrar[] regs = regTuple.regs;
- Map groupsMap = regTuple.groupsMap;
+ ServiceRegistrar[] regs = regTuple.getRegs();
+ Map groupsMap = regTuple.getGroupsMap();
if(regs != null) {
synchronized(regInfo) {
boolean oneDiscovered = false;
for(int i=0;i<regs.length;i++) {
/* care only about the generators the test started */
- if( !lookupList.contains(regs[i]) ) continue;
+ if( !lookupServices.lookupListContains(regs[i]) ) continue;
ServiceID srvcID = regs[i].getServiceID();
- logger.log(Level.FINE, "registration_"+regInfo.handback
+ logger.log(Level.FINE, "registration_"+regInfo.getHandback()
+" -- discovered service ID = "+srvcID);
logDebugEventText(evnt);
try {
String[] groups = (String[])groupsMap.get(srvcID);
- regInfo.discoveredMap.put(regs[i],groups);
+ regInfo.getDiscoveredMap().put(regs[i],groups);
LocatorsUtil.displayLocator(QAConfig.getConstrainedLocator(regs[i].getLocator()),
" locator ",
Level.FINE);
@@ -574,8 +809,8 @@ abstract public class AbstractBaseTest e
if(oneDiscovered) {
logger.log(Level.FINE, "# of currently discovered "
+"lookups for registration_"
- +regInfo.handback+" = "
- +regInfo.discoveredMap.size());
+ +regInfo.getHandback()+" = "
+ +regInfo.getDiscoveredMap().size());
}
}//end sync(regInfo)
}//endif
@@ -584,18 +819,18 @@ abstract public class AbstractBaseTest e
private void discarded(RemoteDiscoveryEvent evnt) {
logger.log(Level.FINE, "got \"discarded\" event");
RegTuple regTuple = getRegistrars(evnt);
- ServiceRegistrar[] regs = regTuple.regs;
- Map groupsMap = regTuple.groupsMap;
+ ServiceRegistrar[] regs = regTuple.getRegs();
+ Map groupsMap = regTuple.getGroupsMap();
if(regs != null) {
synchronized(regInfo) {
for(int i=0;i<regs.length;i++) {
ServiceID srvcID = regs[i].getServiceID();
- if(regInfo.discoveredMap.remove(regs[i]) != null) {
- logger.log(Level.FINE, "registration_"+regInfo.handback
+ if(regInfo.getDiscoveredMap().remove(regs[i]) != null) {
+ logger.log(Level.FINE, "registration_"+regInfo.getHandback()
+" -- discarded service ID = "+srvcID);
logDebugEventText(evnt);
String[] groups = (String[])groupsMap.get(srvcID);
- regInfo.discardedMap.put(regs[i],groups);
+ regInfo.getDiscardedMap().put(regs[i],groups);
String displayGroups
= GroupsUtil.toCommaSeparatedStr(groups);
if(displayGroups.equals("")) {
@@ -607,8 +842,8 @@ abstract public class AbstractBaseTest e
}//end loop
logger.log(Level.FINE, "# of currently discovered "
+"lookups for registration_"
- +regInfo.handback+" = "
- +regInfo.discoveredMap.size());
+ +regInfo.getHandback()+" = "
+ +regInfo.getDiscoveredMap().size());
}//end sync(regInfo)
}//endif
}//end discarded
@@ -718,102 +953,43 @@ abstract public class AbstractBaseTest e
logger.log(Level.FINE, " seqNum = "
+evnt.getSequenceNumber() );
logger.log(Level.FINE, " handback = "
- +regInfo.handback);
+ +regInfo.getHandback());
}//end logDebugEventText
}//end class LDSEventListener
- /** Thread in which a number of lookup services are started after various
- * time delays. This thread is intended to be used by tests that need to
- * simulate "late joiner" lookup services. After all of the requested
- * lookup services have been started, this thread will exit.
- */
- protected class StaggeredStartThread extends Thread {
- private final long[] defaultWaitTimes = { 1*1000 };
- private long[] waitTimes;
- /** Use this constructor if it is desired that the lookup service(s)
- * be started at the default wait times.
- */
- public StaggeredStartThread() {
- this(null);
- }//end constructor
-
- /** Use this constructor if it is desired that the lookup service(s)
- * be started at the given wait times.
- */
- public StaggeredStartThread(long[] waitTimes) {
- super("StaggeredStartThread");
- setDaemon(true);
- this.waitTimes = ((waitTimes==null) ? defaultWaitTimes:waitTimes);
- }//end constructor
-
- public void run() {
- int n = waitTimes.length;
- int totalNLookups = nLookupServices+nAddLookupServices;
- for(int i=nLookupServices;i<totalNLookups;i++) {
- long waitMS = ( i < n ? waitTimes[i-1] : waitTimes[n-1] );
- logger.log(Level.FINE, "waiting "+(waitMS/1000)+" seconds before "
- +"attempting to start the next lookup service");
- try {Thread.sleep(waitMS);} catch(InterruptedException e) { }
- LookupLocator l = (LookupLocator) lookupsToStart.get(i);
- int port =
- ((lookupsToStart.size() == totalNLookups ) ? l.getPort()
- : 0);
- try {
- startLookup(i, port, l.getHost());
- } catch(Exception e) {
- e.printStackTrace();
- }
- }//end loop
- }//end run
- }//end class StaggeredStartThread
-
- protected String[] subCategories;
-
- protected String implClassname; //implementation class of lookup
+ protected volatile String[] subCategories;
protected static final String serviceName
= "net.jini.discovery.LookupDiscoveryService";
- protected LookupDiscoveryService discoverySrvc = null;
-
- protected int maxSecsEventWait = 10 * 60;
- protected int announceInterval = 2 * 60 * 1000;
- protected int minNAnnouncements = 2;
- protected int nIntervalsToWait = 3;
+ protected volatile LookupDiscoveryService discoverySrvc = null;
+ protected volatile int maxSecsEventWait = 10 * 60;
+
protected boolean startAllLookupsInSetup = true;
+
+ /* discovery service related */
+ protected volatile int nRegistrations = 0;
+ protected volatile int nAddRegistrations = 0;
+ protected volatile int nSecsLookupDiscovery = 30;
+ /* end discovery service related */
+
+ /* add getter */
+ private ArrayList lookupList = new ArrayList(1);
+ /* end add getter */
+
+ protected volatile int discardType = ACTIVE_DISCARDED;
+
+ protected volatile List useDiscoveryList = new ArrayList();
+
+ protected final long leaseDuration = Integer.MAX_VALUE;
- protected int nLookupServices = 0;
- protected int nAddLookupServices = 0;
- protected int nRegistrations = 0;
- protected int nAddRegistrations = 0;
- protected int nSecsLookupDiscovery = 30;
-
- private ArrayList memberGroupsList = new ArrayList(11);
- protected ArrayList lookupsToStart = new ArrayList(5);
- private ArrayList locatorsStarted = new ArrayList(5);
-
- protected ArrayList lookupList = new ArrayList(1);
- protected HashMap genMap = new HashMap(1);
- protected int nStarted = 0;
-
- protected int discardType = ACTIVE_DISCARDED;
-
- protected ArrayList useDiscoveryList = new ArrayList();
-
- protected ArrayList useGroupAndLocDiscovery0 = new ArrayList(11);
- protected ArrayList useGroupAndLocDiscovery1 = new ArrayList(11);
- protected ArrayList useOnlyGroupDiscovery = new ArrayList(11);
- protected ArrayList useOnlyLocDiscovery = new ArrayList(11);
+ protected volatile boolean announcementsStopped = false;
- protected long leaseDuration = Integer.MAX_VALUE;
- protected HashMap registrationMap = new HashMap(11);
+ /* Would be nice to know what the exact intent of this lock is */
+ private final Object lockObject = new Object();
- protected boolean announcementsStopped = false;
-
- protected Object discoveryLock = new Object();
-
- private Object lockObject = new Object();
+ private volatile LookupServices lookupServices = null;
/** Constructs an instance of this class. Initializes this classname */
public AbstractBaseTest() {
@@ -839,10 +1015,13 @@ abstract public class AbstractBaseTest e
public Test construct(QAConfig config) throws Exception {
super.construct(config);
logger.entering("","setup");
+ lookupServices = new LookupServices(config, getManager(), FAST_TIMEOUT);
getSetupInfo();
- getLookupInfo();
+ //getLookupInfo();
if(startAllLookupsInSetup) {//Start lookup service(s)
- startAllLookups();
+ lookupServices.startInitLookups();
+ lookupServices.startAddLookups();
+// startAllLookups();
}//endif
/* Start monitoring process by creating a LookupDiscoveryService */
logger.log(Level.FINEST,"starting a lookup discovery "
@@ -864,13 +1043,13 @@ abstract public class AbstractBaseTest e
*/
public void tearDown() {
try {
- if(genMap.size() > 0) {
+ if(getGenMap().size() > 0) {
/* Stop announcements if the generator is simulated, but allow
* the super class' tearDown method to actually destroy the
* lookup services (simulated or non-simulated).
*/
if( !announcementsStopped ) {
- Iterator iter = genMap.keySet().iterator();
+ Iterator iter = getGenMap().keySet().iterator();
for(int i=0;iter.hasNext();i++) {
Object generator = iter.next();
if(generator instanceof DiscoveryProtocolSimulator) {
@@ -887,132 +1066,6 @@ abstract public class AbstractBaseTest e
}
}//end tearDown
- /** Method that compares the given port to the ports of all the locators
- * referenced in the set of elements that correspond to lookup services
- * that have been started. Returns <code>true</code> if the given port
- * equals any of the ports referenced in the set; <code>false</code>
- * otherwise. Useful for guaranteeing unique port numbers when starting
- * lookup serives.
- */
- protected boolean portInUse(int port) {
- for(int i=0;i<locatorsStarted.size();i++) {
- int curPort = ((LookupLocator)(locatorsStarted.get(i))).getPort();
- if(port == curPort) return true;
- }//end loop
- return false;
- }//end portInUse
-
- /** Convenience method that can be used to start, at a single point
- * during the current test run, all of the lookup services needed by
- * that test run. Useful when all of the lookup services are to be
- * started during construct processing.
- */
- protected void startAllLookups() throws Exception {
- int totalNLookups = nLookupServices+nAddLookupServices;
- for(int i=0;i<totalNLookups;i++) {
- LookupLocator l = (LookupLocator) lookupsToStart.get(i);
- int port = l.getPort();
- if(portInUse(port) || (lookupsToStart.size() != totalNLookups)){
- port = 0;
- }
- startLookup(i, port, l.getHost());
- }//end loop
- /* If explicit ports were NOT set in config, then use what was started,
- * no questions asked. If explicit ports were set in config, then
- * verify that what was started equals what was wanted.
- */
- if(lookupsToStart.size() > 0) {//explicit ports were set in config
- if(!collectionsEqual(lookupsToStart,locatorsStarted)) {
- throw new TestException("locators started != locators "
- +"wanted");
-
- }//endif
- }//endif
- nStarted = genMap.size();
- }//end startAllLookups
-
- /** Convenience method that can be used to start, at any point during the
- * current test run, a single lookup service with configuration
- * referenced by the given parameter values. Useful when individual
- * lookup services are to be started at different points in time during
- * the test run.
- */
- protected void startLookup(int indx, int port, String serviceHost)
- throws Exception
- {
- logger.log(Level.FINE, "starting lookup service "+indx);
- /* retrieve the member groups with which to configure the lookup */
- String[] memberGroups = (String[])memberGroupsList.get(indx);
- ServiceRegistrar lookupProxy = null;
- if(implClassname.equals("com.sun.jini.test.services.lookupsimulator.LookupSimulatorImpl"))
- {
- /* Use either a random or an explicit locator port */
- DiscoveryProtocolSimulator generator =
- new DiscoveryProtocolSimulator(getConfig(), memberGroups, getManager(), port);
- genMap.put( generator, memberGroups );
- lookupProxy = generator.getLookupProxy();
- } else {//start a non-simulated lookup service implementation
- logger.log(Level.FINER, "Starting lookup for host " + serviceHost);
- lookupProxy = getManager().startLookupService(serviceHost); // already prepared
- genMap.put( lookupProxy, memberGroups );
- }//endif
- lookupList.add( lookupProxy );
- LookupLocator lookupLocator = QAConfig.getConstrainedLocator(lookupProxy.getLocator());
- locatorsStarted.add(lookupLocator);
- LocatorsUtil.displayLocator(lookupLocator,
- " locator ",Level.FINE);
- String displayGroups = GroupsUtil.toCommaSeparatedStr(memberGroups);
- if(displayGroups.equals("")) displayGroups = new String("NO_GROUPS");
- logger.log(Level.FINE, " group(s) = "
- +displayGroups);
- /* Because the lookup discovery service can perform both group and
- * locator discovery, some tests will focus only on group
- * discovery, some only on locator discovery, and some on both
- * group and locator discovery. To provide these tests with
- * a variety of options for the groups and/or locators to discover,
- * a number of data structures are populated below which the
- * tests can use to configure the lookup discovery service for
- * discovery. In some cases, only the member groups from above
- * are stored, in other cases only the locators are stored, and
- * in still other cases, a mix of groups and locators are stored.
- * The case where the groups and locators are mixed is intended
- * to provide tests that verify the lookup discovery service's
- * ability to handle both group and locator discovery with a
- * set that can be used to configure the lookup discovery service
- * to discover some registrars through only group discovery,
- * some registrars through only locator discovery, and some
- * registrars through both group and locator discovery.
- */
- if( (indx%3) == 0 ) {// add both groups and locs
- useGroupAndLocDiscovery0.add
- (new DiscoveryStruct(memberGroups,lookupLocator,
- new RegGroupsPair(lookupProxy,memberGroups)));
- useGroupAndLocDiscovery1.add
- (new DiscoveryStruct(memberGroups,null,
- new RegGroupsPair(lookupProxy,memberGroups)));
- } else if( (indx%3) == 1 ) {// add only the groups
- useGroupAndLocDiscovery0.add
- (new DiscoveryStruct(memberGroups,null,
- new RegGroupsPair(lookupProxy,memberGroups)));
- useGroupAndLocDiscovery1.add(new DiscoveryStruct
- (memberGroups,null,
- new RegGroupsPair(lookupProxy,memberGroups)));
- } else if( (indx%3) == 2 ) {// add only the locators
- useGroupAndLocDiscovery0.add
- (new DiscoveryStruct(null,lookupLocator,
- new RegGroupsPair(lookupProxy,memberGroups)));
- useGroupAndLocDiscovery1.add(new DiscoveryStruct
- (memberGroups,lookupLocator,
- new RegGroupsPair(lookupProxy,memberGroups)));
- }//endif
- useOnlyGroupDiscovery.add
- (new DiscoveryStruct(memberGroups,null,
- new RegGroupsPair(lookupProxy,memberGroups)));
- useOnlyLocDiscovery.add
- (new DiscoveryStruct(null,lookupLocator,
- new RegGroupsPair(lookupProxy,memberGroups)));
- }//end startLookup
-
/** Returns <code>true</code> if the given collections are referentially
* equal, or if the given collections have the same contents;
* <code>false</code> otherwise.
@@ -1032,10 +1085,10 @@ abstract public class AbstractBaseTest e
* String[] array containing the groups that should be used to configure
* the lookup discovery service for group discovery.
*/
- protected String[] getGroupsToDiscover(ArrayList useList) {
+ protected String[] getGroupsToDiscover(List useList) {
ArrayList groupsList = new ArrayList();
for(int i=0;i<useList.size();i++) {
- String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
+ String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).getGroups();
if( (groupsArray == null) || (groupsArray.length == 0) ) continue;
for(int j=0;j<groupsArray.length;j++) {
groupsList.add(groupsArray[j]);
@@ -1048,10 +1101,10 @@ abstract public class AbstractBaseTest e
* LookupLocator[] array containing the locators that should be used
* to configure the lookup discovery service for locator discovery.
*/
- protected LookupLocator[] getLocatorsToDiscover(ArrayList useList) {
+ protected LookupLocator[] getLocatorsToDiscover(List useList) {
ArrayList locsList = new ArrayList();
for(int i=0;i<useList.size();i++) {
- LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
+ LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).getLocator();
if(loc == null) continue;
locsList.add(loc);
}
@@ -1062,73 +1115,73 @@ abstract public class AbstractBaseTest e
/** RegInfo index should always be the handback value for the regInfo */
protected String[] getGroupsToDiscoverByIndex(int regIndex) {
if( (regIndex%4) == 0 ) {
- return getGroupsToDiscover(useGroupAndLocDiscovery0);
+ return getGroupsToDiscover(getUseGroupAndLocDiscovery0());
} else if( (regIndex%4) == 1 ) {
- return getGroupsToDiscover(useOnlyGroupDiscovery);
+ return getGroupsToDiscover(getUseOnlyGroupDiscovery());
} else if( (regIndex%4) == 2 ) {
- return getGroupsToDiscover(useGroupAndLocDiscovery1);
+ return getGroupsToDiscover(getUseGroupAndLocDiscovery1());
} else if( (regIndex%4) == 3 ) {
- return getGroupsToDiscover(useOnlyLocDiscovery);
+ return getGroupsToDiscover(getUseOnlyLocDiscovery());
} else {
- return getGroupsToDiscover(useGroupAndLocDiscovery0);
+ return getGroupsToDiscover(getUseGroupAndLocDiscovery0());
}//endif
}//end getGroupsToDiscoverByIndex
/** RegInfo index should always be the handback value for the regInfo */
- protected ArrayList getGroupListToUseByIndex(int regIndex) {
+ protected List getGroupListToUseByIndex(int regIndex) {
if( (regIndex%4) == 0 ) {
- return useGroupAndLocDiscovery0;
+ return getUseGroupAndLocDiscovery0();
} else if( (regIndex%4) == 1 ) {
- return useOnlyGroupDiscovery;
+ return getUseOnlyGroupDiscovery();
} else if( (regIndex%4) == 2 ) {
- return useGroupAndLocDiscovery1;
+ return getUseGroupAndLocDiscovery1();
} else if( (regIndex%4) == 3 ) {
- return useOnlyLocDiscovery;
+ return getUseOnlyLocDiscovery();
} else {
- return useGroupAndLocDiscovery0;
+ return getUseGroupAndLocDiscovery0();
}//endif
}//end getGroupListToUseByIndex
/** RegInfo index should always be the handback value for the regInfo */
protected LookupLocator[] getLocatorsToDiscoverByIndex(int regIndex) {
if( (regIndex%4) == 0 ) {
- return getLocatorsToDiscover(useGroupAndLocDiscovery0);
+ return getLocatorsToDiscover(getUseGroupAndLocDiscovery0());
} else if( (regIndex%4) == 1 ) {
- return getLocatorsToDiscover(useOnlyGroupDiscovery);
+ return getLocatorsToDiscover(getUseOnlyGroupDiscovery());
} else if( (regIndex%4) == 2 ) {
- return getLocatorsToDiscover(useGroupAndLocDiscovery1);
+ return getLocatorsToDiscover(getUseGroupAndLocDiscovery1());
} else if( (regIndex%4) == 3 ) {
- return getLocatorsToDiscover(useOnlyLocDiscovery);
+ return getLocatorsToDiscover(getUseOnlyLocDiscovery());
} else {
- return getLocatorsToDiscover(useGroupAndLocDiscovery0);
+ return getLocatorsToDiscover(getUseGroupAndLocDiscovery0());
}//endif
}//end getLocatorsToDiscoverByIndex
- /** RegInfo index should always be the handback value for the regInfo */
- protected ArrayList getLocatorListToUseByIndex(int regIndex) {
+ /** RegInfo index should always be the hand-back value for the regInfo */
+ protected List getLocatorListToUseByIndex(int regIndex) {
if( (regIndex%4) == 0 ) {
- return useGroupAndLocDiscovery0;
+ return getUseGroupAndLocDiscovery0();
} else if( (regIndex%4) == 1 ) {
- return useOnlyGroupDiscovery;
+ return getUseOnlyGroupDiscovery();
} else if( (regIndex%4) == 2 ) {
- return useGroupAndLocDiscovery1;
+ return getUseGroupAndLocDiscovery1();
} else if( (regIndex%4) == 3 ) {
- return useOnlyLocDiscovery;
+ return getUseOnlyLocDiscovery();
} else {
- return useGroupAndLocDiscovery0;
+ return getUseGroupAndLocDiscovery0();
}//endif
}//end getLocatorsToDiscoverByIndex
/** Return any elements having at least a groups entry */
- protected Map getPassiveCommDiscardMap(ArrayList useList) {
+ protected Map getPassiveCommDiscardMap(List useList) {
HashMap discardMap = new HashMap();
for(int i=0;i<useList.size();i++) {
- String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
- LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
+ String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).getGroups();
+ LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).getLocator();
if((groupsArray!=null) && (groupsArray.length>0)) {
RegGroupsPair pair =
- ((DiscoveryStruct)(useList.get(i))).regGroups;
- discardMap.put(pair.reg,pair.groups);
+ ((DiscoveryStruct)(useList.get(i))).getRegGroups();
+ discardMap.put(pair.getReg(), pair.getGroups());
}
}
return discardMap;
@@ -1138,29 +1191,29 @@ abstract public class AbstractBaseTest e
protected Map getActiveCommDiscardMap(ArrayList useList) {
HashMap discardMap = new HashMap();
for(int i=0;i<useList.size();i++) {
- String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
- LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
+ String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).getGroups();
+ LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).getLocator();
if( ( (groupsArray != null) && (groupsArray.length > 0) )
|| (loc != null) )
{
RegGroupsPair pair =
- ((DiscoveryStruct)(useList.get(i))).regGroups;
- discardMap.put(pair.reg,pair.groups);
+ ((DiscoveryStruct)(useList.get(i))).getRegGroups();
+ discardMap.put(pair.getReg(), pair.getGroups());
}
}
return discardMap;
}//end getActiveCommDiscardMap
/** Return any elements having at least a locators entry */
- protected Map getModLocatorsDiscardMap(ArrayList useList) {
+ protected Map getModLocatorsDiscardMap(List useList) {
HashMap discardMap = new HashMap();
for(int i=0;i<useList.size();i++) {
- String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).groups;
- LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).locator;
+ String[] groupsArray = ((DiscoveryStruct)(useList.get(i))).getGroups();
+ LookupLocator loc = ((DiscoveryStruct)(useList.get(i))).getLocator();
if( loc != null ) {
RegGroupsPair pair =
- ((DiscoveryStruct)(useList.get(i))).regGroups;
- discardMap.put(pair.reg,pair.groups);
+ ((DiscoveryStruct)(useList.get(i))).getRegGroups();
+ discardMap.put(pair.getReg(), pair.getGroups());
}
}
return discardMap;
@@ -1228,7 +1281,7 @@ abstract public class AbstractBaseTest e
"fiddlerRegistrationPreparer",
ProxyPreparer.class);
}
- registrationMap.put(p.prepareProxy(ldsReg),listener);
+ getRegistrationMap().put(p.prepareProxy(ldsReg),listener);
} catch (ConfigurationException e) {
throw new RemoteException("Configuration Error", e);
}
@@ -1248,7 +1301,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void resetAllEventInfoAllRegs() {
- Set eSet = registrationMap.entrySet();
+ Set eSet = getRegistrationMap().entrySet();
Iterator iter = eSet.iterator();
for(int i=0;iter.hasNext();i++) {
resetAllEventInfoOneReg( (Map.Entry)iter.next() );
@@ -1291,7 +1344,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void resetDiscoveryEventInfoAllRegs() {
- Set eSet = registrationMap.entrySet();
+ Set eSet = getRegistrationMap().entrySet();
Iterator iter = eSet.iterator();
for(int i=0;iter.hasNext();i++) {
resetDiscoveryEventInfoOneReg( (Map.Entry)iter.next() );
@@ -1334,7 +1387,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void resetDiscardEventInfoAllRegs() {
- Set eSet = registrationMap.entrySet();
+ Set eSet = getRegistrationMap().entrySet();
Iterator iter = eSet.iterator();
for(int i=0;iter.hasNext();i++) {
resetDiscardEventInfoOneReg( (Map.Entry)iter.next() );
@@ -1382,19 +1435,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void addGroupsAllRegs(String[] groups) throws RemoteException {
- Set eSet = registrationMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- addGroupsOneReg( groups, (Map.Entry)iter.next() );
- }//end loop
- if( groups == DiscoveryGroupManagement.ALL_GROUPS ) {
- logger.log(Level.FINE, " FAILURE -- tried to add ALL_GROUPS");
- } else if( groups.length <= 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to add NO_GROUPS");
- } else {
- GroupsUtil.displayGroupSet(groups,
- " all regs -- group",Level.FINE);
- }//endif
+ lookupServices.addGroupsAllRegs(groups);
}//end addGroupsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1410,31 +1451,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- String[] groupsToDiscover = groups;
- if( (regInfo.groupsToDiscover != DiscoveryGroupManagement.ALL_GROUPS)
- &&(groups != DiscoveryGroupManagement.ALL_GROUPS) )
- {
- int curLen = (regInfo.groupsToDiscover).length;
- int newLen = groups.length;
- groupsToDiscover = new String[curLen + newLen];
- for(int i=0;i<curLen;i++) {
- groupsToDiscover[i] = new String(regInfo.groupsToDiscover[i]);
- }//end loop
- for(int i=curLen;i<(curLen+newLen);i++) {
- groupsToDiscover[i] = new String(groups[i-curLen]);
- }//end loop
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover(groupsToDiscover,
- new LookupLocator[0]);
- }//end sync(regInfo)
- }//endif
- /* Add to the groups the lds should discover for this registration */
- reg.addGroups(groups);
+ lookupServices.addGroupsOneReg(groups, regListenerPair);
}//end addGroupsOneReg
/** Common code, shared by this class and its sub-classes. For each
@@ -1445,19 +1462,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void setGroupsAllRegs(String[] groups) throws RemoteException {
- Set eSet = registrationMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- setGroupsOneReg( groups, (Map.Entry)iter.next() );
- }//end loop
- if( groups == DiscoveryGroupManagement.ALL_GROUPS ) {
- logger.log(Level.FINE, " all regs -- groups set to ALL_GROUPS");
- } else if( groups.length <= 0 ) {
- logger.log(Level.FINE, " all regs -- groups set to NO_GROUPS");
- } else {
- GroupsUtil.displayGroupSet(groups,
- " all regs -- group",Level.FINE);
- }//endif
+ lookupServices.setGroupsAllRegs(groups);
}//end setGroupsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1473,16 +1478,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover(groups,new LookupLocator[0]);
- }//end sync(regInfo)
- /* Change the groups the lds should discover for this registration */
- reg.setGroups(groups);
+ lookupServices.setGroupsOneReg(groups, regListenerPair);
}//end setGroupsOneReg
/** Common code, shared by this class and its sub-classes. For each
@@ -1493,18 +1489,7 @@ abstract public class AbstractBaseTest e
* @throws jave.rmi.RemoteException
*/
protected void removeGroupsAllRegs(String[] groups) throws RemoteException{
- Iterator iter = (registrationMap.entrySet()).iterator();
- for(int i=0;iter.hasNext();i++) {
- removeGroupsOneReg( groups, (Map.Entry)iter.next() );
- }//end loop
- if( groups == DiscoveryGroupManagement.ALL_GROUPS ) {
- logger.log(Level.FINE, " FAILURE -- tried to remove ALL_GROUPS");
- } else if( groups.length <= 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to remove NO_GROUPS");
- } else {
- GroupsUtil.displayGroupSet(groups,
- " all regs removing -- group",Level.FINE);
- }//endif
+ lookupServices.removeGroupsAllRegs(groups);
}//end removeGroupsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1520,40 +1505,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
-
- String[] curGroupsToDiscover = regInfo.groupsToDiscover;
- String[] groupsToRemove = groups;
- String[] newGroupsToDiscover = DiscoveryGroupManagement.NO_GROUPS;
-
- if( (curGroupsToDiscover != DiscoveryGroupManagement.ALL_GROUPS)
- && (groupsToRemove != DiscoveryGroupManagement.ALL_GROUPS) )
- {
- int curLen = curGroupsToDiscover.length;
- int remLen = groupsToRemove.length;
- ArrayList newList = new ArrayList(curLen+remLen);
- iLoop:
- for(int i=0;i<curLen;i++) {
- for(int j=0;j<remLen;j++) {
- if(curGroupsToDiscover[i].equals(groupsToRemove[j])) {
- continue iLoop;
- }//endif
- }//endloop(j)
- newList.add(curGroupsToDiscover[i]);
- }//end loop(i)
- newGroupsToDiscover
- = (String[])(newList.toArray(new String[newList.size()]));
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover(newGroupsToDiscover,
- new LookupLocator[0]);
- }//end sync(regInfo)
- }//endif
- /* remove the groups the lds should discover from this registration */
- reg.removeGroups(groups);
+ lookupServices.removeGroupsOneReg(groups, regListenerPair);
}//end removeGroupsOneReg
/** Convenience method that allows sub-classes of this class to request,
@@ -1562,26 +1514,10 @@ abstract public class AbstractBaseTest e
*
* @throws jave.rmi.RemoteException
*/
- protected void removeGroupsRegMap(HashMap regMap, String[] groups)
+ protected void removeGroupsRegMap(Map regMap, String[] groups)
throws RemoteException
{
- Set eSet = regMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- Map.Entry regListenerPair = (Map.Entry)iter.next();
- removeGroupsOneReg( groups, regListenerPair );
- if( groups.length <= 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to remove NO_GROUPS");
- } else {
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- GroupsUtil.displayGroupSet( groups,
- " registration_"
- +regInfo.handback
- +" removing -- group",
- Level.FINE);
- }//endif
- }//end loop
+ lookupServices.removeGroupsRegMap(regMap, groups);
}//end removeGroupsRegMap
/** Common code, shared by this class and its sub-classes. For each
@@ -1594,17 +1530,7 @@ abstract public class AbstractBaseTest e
protected void addLocatorsAllRegs(LookupLocator[] locators)
throws RemoteException
{
- Set eSet = registrationMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- addLocatorsOneReg( locators, (Map.Entry)iter.next() );
- }//end loop
- if( locators.length <= 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to add NO_LOCATORS");
- } else {
- LocatorsUtil.displayLocatorSet(locators,
- " all regs -- locator",Level.FINE);
- }//endif
+ lookupServices.addLocatorsAllRegs(locators);
}//end addLocatorsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1620,30 +1546,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- LookupLocator[] locatorsToDiscover = locators;
-
- if(locators != null) {
- int curLen = (regInfo.locatorsToDiscover).length;
- int newLen = locators.length;
- locatorsToDiscover = new LookupLocator[curLen + newLen];
- for(int i=0;i<curLen;i++) {
- locatorsToDiscover[i] = regInfo.locatorsToDiscover[i];
- }//end loop
- for(int i=curLen;i<(curLen+newLen);i++) {
- locatorsToDiscover[i] = locators[i-curLen];
- }//end loop
- }//endif
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover(DiscoveryGroupManagement.NO_GROUPS,
- locatorsToDiscover);
- }//end sync(regInfo)
- /* Add to the locators the lds should discover for this registration */
- reg.addLocators(locators);
+ lookupServices.addLocatorsOneReg(locators, regListenerPair);
}//end addLocatorsOneReg
/** Common code, shared by this class and its sub-classes. For each
@@ -1656,17 +1559,7 @@ abstract public class AbstractBaseTest e
protected void setLocatorsAllRegs(LookupLocator[] locators)
throws RemoteException
{
- Set eSet = registrationMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- setLocatorsOneReg( locators, (Map.Entry)iter.next() );
- }//end loop
- if( locators.length == 0 ) {
- logger.log(Level.FINE, " all regs -- locators set to NO_LOCATORS");
- } else {
- LocatorsUtil.displayLocatorSet(locators,
- " all regs -- locator",Level.FINE);
- }//endif
+ lookupServices.setLocatorsAllRegs(locators);
}//end setLocatorsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1682,17 +1575,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover(DiscoveryGroupManagement.NO_GROUPS,
- locators);
- }//end sync(regInfo)
- /* Change the locators the lds should discover for this registration */
- reg.setLocators(locators);
+ lookupServices.setLocatorsOneReg(locators, regListenerPair);
}//end setLocatorsOneReg
/** Common code, shared by this class and its sub-classes. For each
@@ -1705,18 +1588,7 @@ abstract public class AbstractBaseTest e
protected void removeLocatorsAllRegs(LookupLocator[] locators)
throws RemoteException
{
- Iterator iter = (registrationMap.entrySet()).iterator();
- for(int i=0;iter.hasNext();i++) {
- removeLocatorsOneReg( locators, (Map.Entry)iter.next() );
- }//end loop
- if( locators == null ) {
- logger.log(Level.FINE, " FAILURE -- tried to remove null");
- } else if( locators.length == 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to remove NO_LOCATORS");
- } else {
- LocatorsUtil.displayLocatorSet(locators,
- " all regs removing -- locator",Level.FINE);
- }//endif
+ lookupServices.removeLocatorsAllRegs(locators);
}//end removeLocatorsAllRegs
/** Common code, shared by this class and its sub-classes. For the given
@@ -1732,41 +1604,7 @@ abstract public class AbstractBaseTest e
Map.Entry regListenerPair)
throws RemoteException
{
- LookupDiscoveryRegistration reg
- = (LookupDiscoveryRegistration)regListenerPair.getKey();
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
-
- LookupLocator[] curLocatorsToDiscover = regInfo.locatorsToDiscover;
- LookupLocator[] locatorsToRemove = locators;
- LookupLocator[] newLocatorsToDiscover = new LookupLocator[0];
-
- if( (curLocatorsToDiscover != null) && (locatorsToRemove != null) ) {
- int curLen = curLocatorsToDiscover.length;
- int remLen = locatorsToRemove.length;
- ArrayList newList = new ArrayList(curLen+remLen);
- iLoop:
- for(int i=0;i<curLen;i++) {
- for(int j=0;j<remLen;j++) {
- if( locsEqual
- (curLocatorsToDiscover[i],locatorsToRemove[j]) )
- {
- continue iLoop;
- }//endif
- }//endloop(j)
- newList.add(curLocatorsToDiscover[i]);
- }//end loop(i)
- newLocatorsToDiscover = (LookupLocator[])(newList.toArray
- (new LookupLocator[newList.size()]));
- synchronized(regInfo) {
- /* update the expected state for this regInfo information */
- regInfo.setLookupsToDiscover
- (DiscoveryGroupManagement.NO_GROUPS,
- newLocatorsToDiscover);
- }//end sync(regInfo)
- }//endif
- /* remove the locators the lds should discover for this registration */
- reg.removeLocators(locators);
+ lookupServices.removeLocatorsOneReg(locators, regListenerPair);
}//end removeLocatorsOneReg
/** Convenience method that allows sub-classes of this class to request,
@@ -1775,27 +1613,11 @@ abstract public class AbstractBaseTest e
*
* @throws jave.rmi.RemoteException
*/
- protected void removeLocatorsRegMap(HashMap regMap,
+ protected void removeLocatorsRegMap(Map regMap,
LookupLocator[] locators)
throws RemoteException
{
- Set eSet = regMap.entrySet();
- Iterator iter = eSet.iterator();
- for(int i=0;iter.hasNext();i++) {
- Map.Entry regListenerPair = (Map.Entry)iter.next();
- removeLocatorsOneReg( locators, regListenerPair );
- if( locators.length == 0 ) {
- logger.log(Level.FINE, " NO-OP -- tried to remove NO_LOCATORS");
- } else {
- RegistrationInfo regInfo
- = ((LDSEventListener)regListenerPair.getValue()).getRegInfo();
- LocatorsUtil.displayLocatorSet( locators,
- " registration_"
- +regInfo.handback
- +" removing -- locator",
- Level.FINE);
- }//endif
- }//end loop
+ lookupServices.removeLocatorsRegMap(regMap, locators);
}//end removeLocatorsRegMap
/** Common code shared by each test that needs to wait for discovered
@@ -1805,7 +1627,7 @@ abstract public class AbstractBaseTest e
*/
protected void waitForDiscovery() throws TestException {
/* Wait for the expected number of discovered events from each reg */
- int nSecsToWait0 = (nIntervalsToWait*(announceInterval/1000))/4;
+ int nSecsToWait0 = (getnIntervalsToWait()*(getAnnounceInterval()/1000))/4;
if(nSecsToWait0 == 0) nSecsToWait0 = 10;//small nominal value
int nSecsToWait1 = 1; // guarantee at least 1 pass through timer loop
if(nSecsToWait0 < maxSecsEventWait) {
@@ -1827,24 +1649,24 @@ abstract public class AbstractBaseTest e
*/
logger.log(Level.FINE, "initial wait period complete ... "
+"waiting at most "+nSecsToWait1+" more seconds ...");
- int[] displayFlag = new int[registrationMap.size()];
+ int[] displayFlag = new int[getRegistrationMap().size()];
int nGoodDiscoverySets = 0;
- int nCurRegistrations = registrationMap.size();
+ int nCurRegistrations = getRegistrationMap().size();
timerLoop:
for(int n=0;n<nSecsToWait1;n++) {
/* step through each listener/regInfo */
- Iterator iter = registrationMap.values().iterator();
+ Iterator iter = getRegistrationMap().values().iterator();
for(int i=0;iter.hasNext();i++) {
LDSEventListener listener = (LDSEventListener)iter.next();
RegistrationInfo regInfo = listener.getRegInfo();
synchronized(regInfo) {
- if(regInfo.discoveryComplete) continue;
- Map discoveredMap = regInfo.discoveredMap;
- Map expectedDiscoveredMap = regInfo.expectedDiscoveredMap;
+ if(regInfo.isDiscoveryComplete()) continue;
+ Map discoveredMap = regInfo.getDiscoveredMap();
+ Map expectedDiscoveredMap = regInfo.getExpectedDiscoveredMap();
if(displayOn && displayFlag[i] == 0) {//show info only once
displayFlag[i] = 1;
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discoveredMap.size == "
+discoveredMap.size());
Collection vals = discoveredMap.values();
@@ -1852,23 +1674,23 @@ abstract public class AbstractBaseTest e
String[] vGroups = (String[])itr.next();
if(vGroups == null) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discoveredMap.groups == ALL_GROUPS");
} else if( vGroups.length <= 0 ) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discoveredMap.groups == NO_GROUPS");
} else {
for(int m=0;m<vGroups.length;m++){
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discoveredMap.groups["+m+"] == "
+vGroups[m]);
}//end loop
}//endif
}//end loop
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- expectedDiscoveredMap.size == "
+expectedDiscoveredMap.size());
vals = expectedDiscoveredMap.values();
@@ -1876,18 +1698,18 @@ abstract public class AbstractBaseTest e
String[] vGroups = (String[])itr.next();
if(vGroups == null) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- expectedDiscoveredMap.groups "
+"== ALL_GROUPS");
} else if( vGroups.length <= 0 ) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- expectedDiscoveredMap.groups "
+"== NO_GROUPS");
} else {
for(int m=0;m<vGroups.length;m++){
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- expectedDiscoveredMap.groups["+m+"] "
+"== "+vGroups[m]);
}//end loop
@@ -1898,7 +1720,7 @@ abstract public class AbstractBaseTest e
if(discoveredMap.size() == expectedDiscoveredMap.size()) {
if(n == (nSecsToWait1-1)) {
logger.log(Level.FINE, " registration_"
- +regInfo.handback+" -- events expected ("
+ +regInfo.getHandback()+" -- events expected ("
+expectedDiscoveredMap.size()+") == events "
+"received ("+discoveredMap.size()+")");
}//endif
@@ -1908,7 +1730,7 @@ abstract public class AbstractBaseTest e
{
nGoodDiscoverySets++;
logger.log(Level.FINE, " registration_"
- +regInfo.handback+" -- events expected ("
+ +regInfo.getHandback()+" -- events expected ("
+expectedDiscoveredMap.size()+") == events "
+"received ("+discoveredMap.size()+"),"
+" group sets equal (# of discoveries = "
@@ -1918,7 +1740,7 @@ abstract public class AbstractBaseTest e
} else {
if(n == (nSecsToWait1-1)) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- group sets not equal");
displayUnequalGroupSets(discoveredMap,
expectedDiscoveredMap);
@@ -1927,7 +1749,7 @@ abstract public class AbstractBaseTest e
} else {
if(n == (nSecsToWait1-1)) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- events expected ("
+expectedDiscoveredMap.size()
+") != events received ("
@@ -1965,15 +1787,15 @@ abstract public class AbstractBaseTest e
{
switch(discardType) {
case ACTIVE_DISCARDED:
- return regInfo.expectedActiveDiscardedMap;
+ return regInfo.getExpectedActiveDiscardedMap();
case COMM_DISCARDED:
- return regInfo.expectedCommDiscardedMap;
+ return regInfo.getExpectedCommDiscardedMap();
case NO_INTEREST_DISCARDED:
- return regInfo.expectedNoInterestDiscardedMap;
+ return regInfo.getExpectedNoInterestDiscardedMap();
case PASSIVE_DISCARDED:
- return regInfo.expectedPassiveDiscardedMap;
+ return regInfo.getExpectedPassiveDiscardedMap();
}//end switch
- return regInfo.expectedActiveDiscardedMap;
+ return regInfo.getExpectedActiveDiscardedMap();
}//end getExpectedDiscardedMap
/** Common code shared by each test that needs to wait for discarded
@@ -1982,7 +1804,7 @@ abstract public class AbstractBaseTest e
*/
protected void waitForDiscard(int discardType) throws TestException {
/* Wait for the expected number of discarded events from each reg */
- int nSecsToWait0 = (nIntervalsToWait*(announceInterval/1000))/2;
+ int nSecsToWait0 = (getnIntervalsToWait()*(getAnnounceInterval()/1000))/2;
if(nSecsToWait0 == 0) nSecsToWait0 = 10;//small nominal value
int nSecsToWait1 = 1; // guarantee at least 1 pass through timer loop
if(nSecsToWait0 < maxSecsEventWait) {
@@ -2004,25 +1826,25 @@ abstract public class AbstractBaseTest e
*/
logger.log(Level.FINE, "initial wait period complete ... "
+"waiting at most "+nSecsToWait1+" more seconds ...");
- int[] displayFlag = new int[registrationMap.size()];
+ int[] displayFlag = new int[getRegistrationMap().size()];
int nGoodSets = 0;
- int nCurRegistrations = registrationMap.size();
+ int nCurRegistrations = getRegistrationMap().size();
int n=0;
timerLoop:
for(n=0;n<nSecsToWait1;n++) {
/* step thru each listener/regInfo, testing for discarded events */
- Iterator iter = registrationMap.values().iterator();
+ Iterator iter = getRegistrationMap().values().iterator();
for(int i=0;iter.hasNext();i++) {
LDSEventListener listener = (LDSEventListener)iter.next();
RegistrationInfo regInfo = listener.getRegInfo();
synchronized(regInfo) {
- if(regInfo.discardComplete) continue;
- Map discardedMap = regInfo.discardedMap;
+ if(regInfo.isDiscardComplete()) continue;
+ Map discardedMap = regInfo.getDiscardedMap();
Map expectedDiscardedMap = getExpectedDiscardedMap
(regInfo,discardType);
if(displayOn && displayFlag[i] == 0) {//show info only once
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discardedMap.size == "
+discardedMap.size());
Collection vals = discardedMap.values();
@@ -2030,23 +1852,23 @@ abstract public class AbstractBaseTest e
String[] vGroups = (String[])itr.next();
if(vGroups == null) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discardedMap.groups == ALL_GROUPS");
} else if( vGroups.length <= 0 ) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discardedMap.groups == NO_GROUPS");
} else {
for(int m=0;m<vGroups.length;m++){
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- discardedMap.groups["+m+"] == "
+vGroups[m]);
}//end loop
}//endif
}//end loop
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
+" -- expectedDiscardedMap.size == "
+expectedDiscardedMap.size());
vals = expectedDiscardedMap.values();
@@ -2054,18 +1876,18 @@ abstract public class AbstractBaseTest e
String[] vGroups = (String[])itr.next();
if(vGroups == null) {
logger.log(Level.FINE, " registration_"
- +regInfo.expectedHandback
+ +regInfo.getExpectedHandback()
[... 329 lines stripped ...]