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 2012/01/21 08:28:36 UTC

svn commit: r1234278 [25/29] - in /river/tck: ./ configs/ doc/ doc/api/ doc/api/com/ doc/api/com/sun/ doc/api/com/sun/jini/ doc/api/com/sun/jini/compat/ doc/api/com/sun/jini/compat/admin1/ doc/api/com/sun/jini/compat/admin2/ doc/api/com/sun/jini/compat...

Added: river/tck/src/com/sun/jini/compat/test/PublicGroupTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/PublicGroupTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/PublicGroupTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/PublicGroupTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,141 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test;
+
+import java.io.IOException;
+import java.rmi.RemoteException;
+
+import com.sun.jini.compat.harness.TestUtility;
+import com.sun.jini.compat.harness.Status;
+import com.sun.jini.compat.harness.DefaultTest;
+import com.sun.jini.compat.harness.BasicServiceAdmin;
+import com.sun.jini.compat.harness.BasicAdmin;
+import com.sun.jini.compat.harness.Config;
+
+import net.jini.core.lookup.ServiceRegistrar;
+import net.jini.core.lookup.ServiceItem;
+
+/**
+ * Tests whether a service registers with a lookup service (belonging 
+ * to the public group) that starts after the service started.
+ */
+public class PublicGroupTest extends DefaultTest {
+    
+    private BasicServiceAdmin admin;
+    private ServiceRegistrar lookup;
+
+
+    /**
+     * Starts up the service and waits quietTime
+     * so that (hopefully) there are no 
+     * further multicast requests, and then starts a lookup
+     * service that belongs to the public group. The test registers 
+     * with the lookup service to be notified when the service of 
+     * interest registers and then waits for six times the failureTime. 
+     * If no notification is received, it follows up with a query to
+     * the lookup service to make sure the event wasn't lost or missed. 
+     * If the service has not registered with the lookup service 
+     * during that time, the service fails.
+     *
+     * @param args Command line arguments passed through
+     * @return The status of this run (failed or passed
+     *         and a comment)
+     */
+    public Status run(String[] args) {
+	Config conf = getConfig();
+	admin = (BasicServiceAdmin) conf.getAdmin();
+
+	try {
+            TestUtility.log(Config.ALL,"Test: starting program");
+            admin.start();
+        } catch (RemoteException re) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",re);
+            return Status.failed(Status.ENV,"Problem starting program");
+        }
+
+        /* Try to wait through all the multicast requests so that
+         * the registration is more likely to be from announcements */
+        try {
+            TestUtility.log(Config.ALL,"Test: waiting "
+                + conf.getQuietTime() + " milliseconds for (hopefully) "
+                + "all multicast requests");
+            Thread.sleep(conf.getQuietTime());
+        } catch (InterruptedException ie) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",ie);
+            return Status.failed(Status.ENV,"Test interrupted");
+        }
+
+	try {
+	    TestUtility.log(Config.ALL,"Test: starting lookup in public group");
+	    lookup = TestUtility.startLookup(new String[] {""}, 
+		conf.getQuietTime(), "PublicGroupTest_RegistrarLog", conf);
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem starting lookup service");
+        }
+
+	ServiceItem serviceItem = null;
+	try {
+            long timeout = 6 * conf.getFailureTime();
+            TestUtility.log(Config.ALL,"Test: waiting up to " + timeout 
+                + " milliseconds for program to register in lookup");
+	    serviceItem = TestUtility.waitForRegistration(lookup,timeout,conf);
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem while waiting for "
+                + "program to register with lookup");
+        }
+	    
+	if (serviceItem == null) {
+	    return Status.failed(Status.TEST, "Service never found");
+	}    
+
+	return Status.passed("OK");
+    }    
+
+    public void tearDown() {
+        super.tearDown();
+
+        try {
+            if (lookup != null) {
+                TestUtility.log(Config.ALL,"Test: stopping lookup");
+                TestUtility.stopLookup(lookup, getConfig());
+            }
+        } catch (RemoteException ignore) {}
+        try {
+            if (admin != null) {
+                TestUtility.log(Config.ALL,"Test: stopping program");
+                admin.stop();
+            }
+        } catch (RemoteException ignore) {}
+    }
+       
+    public String[] getCategories() {
+	return (new String[] { BasicServiceAdmin.CATEGORY });
+    }
+
+    public Class[] getRequiredAdmins() {
+	return (new Class[] { BasicAdmin.class, BasicServiceAdmin.class });
+    }
+
+    public String getDescription() {
+	return "PublicGroupTest";
+    }
+
+}
+

Propchange: river/tck/src/com/sun/jini/compat/test/PublicGroupTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/RegistrationTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/RegistrationTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/RegistrationTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/RegistrationTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,139 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test;
+
+import java.rmi.RemoteException;
+
+import com.sun.jini.compat.harness.TestUtility;
+import com.sun.jini.compat.harness.Status;
+import com.sun.jini.compat.harness.DefaultTest;
+import com.sun.jini.compat.harness.BasicServiceAdmin;
+import com.sun.jini.compat.harness.BasicAdmin;
+import com.sun.jini.compat.harness.Config;
+
+import net.jini.core.lookup.ServiceRegistrar;
+import net.jini.core.lookup.ServiceItem;
+
+/**
+ * Tests whether a service can start up and successfully register 
+ * with an already running lookup service within a certain amount 
+ * of time after starting up.  Test also checks that the service's
+ * service ID conforms to the ServiceID specification.
+ */
+public class RegistrationTest extends DefaultTest {
+
+    private BasicServiceAdmin admin;
+    private ServiceRegistrar lookup;
+
+    /**
+     * Starts up a lookup service in the public group, starts up 
+     * the service being tested, and posts a notification request to 
+     * the lookup service to see if this service registers.
+     * If the test doesn't receive a notification within the time 
+     * allotted, it performs a lookup to make sure that the remote 
+     * event wasn't lost and that the service really
+     * did not register. If the service still doesn't appear 
+     * to be registered or if the service's service ID is
+     * non-conformant, it fails.
+     *
+     * @param args Command line arguments passed through
+     * @return The status of this run (failed or passed
+     *         and a comment)
+     */
+    public Status run(String[] args) {
+	Config conf = getConfig();
+	admin = (BasicServiceAdmin) conf.getAdmin();
+
+	try {
+	    TestUtility.log(Config.ALL,"Test: starting lookup in public group");
+	    lookup = TestUtility.startLookup(new String[] {""}, 
+		conf.getQuietTime(), "RegistrationTest_RegistrarLog", conf);
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem starting lookup service");
+        }
+
+	try {
+	    TestUtility.log(Config.ALL,"Test: starting program");
+	    admin.start();
+	} catch (RemoteException re) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",re);
+            return Status.failed(Status.ENV,"Problem starting program");
+        }
+	    
+	ServiceItem serviceItem = null;
+	try {
+	    long timeout = 4 * conf.getFailureTime();
+	    TestUtility.log(Config.ALL,"Test: waiting up to " + timeout 
+		+ " milliseconds for program to register in lookup");
+	    serviceItem = TestUtility.waitForRegistration(lookup,timeout,conf);
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem while waiting for "
+                + "program to register with lookup");
+        }
+
+	if (serviceItem == null) {
+	    return Status.failed(Status.TEST, "Service never registered");
+	}    
+
+	if (serviceItem.serviceID == null) {
+	    return Status.failed(Status.TEST, 
+                "Service registered without a ServiceID");
+	}    
+
+	String reason = TestUtility.checkServiceID(serviceItem.serviceID);
+	if (reason != null) {
+	    return Status.failed(Status.TEST, 
+                "Service's service ID is non-conformant: " + reason);
+	}    
+
+	return Status.passed("OK");
+    }    
+    
+    public void tearDown() {
+        super.tearDown();
+
+        try {
+            if (lookup != null) {
+		TestUtility.log(Config.ALL,"Test: stopping lookup");
+                TestUtility.stopLookup(lookup, getConfig());
+            }
+        } catch (RemoteException ignore) {}
+        try {
+            if (admin != null) {
+		TestUtility.log(Config.ALL,"Test: stopping program");
+                admin.stop();
+            }
+        } catch (RemoteException ignore) {}
+    }
+
+    public String[] getCategories() {
+	return (new String[] { BasicServiceAdmin.CATEGORY });
+    }
+
+    public Class[] getRequiredAdmins() {
+	return (new Class[] { BasicAdmin.class, BasicServiceAdmin.class });
+    }
+    
+    public String getDescription() {
+	return "RegistrationTest";
+    }
+
+}
+

Propchange: river/tck/src/com/sun/jini/compat/test/RegistrationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/RequestPacketTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/RequestPacketTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/RequestPacketTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/RequestPacketTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,185 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test;
+
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.EOFException;
+
+import java.net.DatagramPacket;
+
+import java.rmi.RemoteException;
+
+import java.util.List;
+
+import com.sun.jini.compat.harness.TestUtility;
+import com.sun.jini.compat.harness.Status;
+import com.sun.jini.compat.harness.DefaultTest;
+import com.sun.jini.compat.harness.BasicServiceAdmin;
+import com.sun.jini.compat.harness.BasicClientAdmin;
+import com.sun.jini.compat.harness.BasicAdmin;
+import com.sun.jini.compat.harness.Config;
+
+import net.jini.core.lookup.ServiceID;
+
+/**
+ * Tests whether the multicast request packets sent by the client or 
+ * service are properly formatted.
+ */
+public class RequestPacketTest extends DefaultTest {
+
+    BasicAdmin admin;
+
+    /**
+     * Listens for a multicast request packet from the appropriate 
+     * multicast group. If it gets a packet from the provided address 
+     * (from the Admin) it tries to decode the packet.
+     * <ul>
+     *   <li>It makes sure that the packet is not over 512 bytes and 
+     *   that the protocol number is correct.
+     *   <li>It then decodes the port and the group count. It makes 
+     *   sure the group count is correct and decodes the group names.
+     *   <li>Finally it decodes the lookup service count and makes 
+     *   sure the count is correct by attempting to decode that many 
+     *   lookup service ServiceID objects.
+     * </ul>
+     * If any of these steps cannot be performed (because of 
+     * improper encoding) or returns the incorrect result (because of 
+     * improper content), the service or client fails.
+     *
+     * @param args Command line arguments passed through
+     * @return The status of this run (failed or passed
+     *         and a comment)
+     */
+    public Status run(String[] args) {
+	Config conf = getConfig();
+	admin = conf.getAdmin();
+
+	List results;
+	int timeout = conf.getFailureTime();
+	try {
+	    TestUtility.log(Config.ALL,"Test: starting program and "
+                + "waiting up to " + timeout
+                + " milliseconds for its first multicast request");
+	    results = TestUtility.startProductAndGetMulticastRequests(
+		timeout, 1, admin);
+	} catch(IOException ioe) {
+	    return Status.failed(Status.INDEF, "Failed to receive a "
+		+ "multicast request packet within " + timeout 
+		+ " milliseconds");
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem starting program or "
+                + "waiting for multicast request");
+        }
+
+	TestUtility.log(Config.ALL,"Test: checking multicast request "
+            + "packet");
+	DatagramPacket pkt = (DatagramPacket) results.get(0);
+
+	if (pkt.getLength() > 512) {
+	    return Status.failed(Status.TEST, "Packet over 512 bytes");
+	}
+
+	try {
+	    /*
+             * getData() returns a buffer whose length is longer than
+             * getLength(). We shorten the buffer length so the 
+             * EOFException detection mechanism (used below) will work.
+             */
+            byte[] buf = new byte[pkt.getLength()];
+	    System.arraycopy(pkt.getData(), 0, buf, 0, buf.length);
+
+	    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+	    DataInputStream dis = new DataInputStream(bais);
+	    
+	    int protoVersion = dis.readInt();
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "protocol version " + protoVersion);
+	    if (protoVersion != 1) {
+		return Status.failed(Status.TEST, "Multicast request should "
+		    + "have protocol version 1");
+	    }
+
+	    int port = dis.readInt();
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "port " + port);
+
+	    int lookupCount = dis.readInt();
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "a lookup count of " + lookupCount);
+
+	    int count;
+	    for (count = 0; count < lookupCount; count++) {
+	        ServiceID tmpID = new ServiceID(dis);
+	    }
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "a list of " + count + " lookups");
+
+	    // this simply makes sure that the group count is accurate
+	    int groupCount = dis.readInt();
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "a group count of " + groupCount);
+
+	    StringBuffer groups = new StringBuffer("");
+	    for (count = 0; count < groupCount; count++) {
+		groups.append(dis.readUTF());
+	    }
+	    TestUtility.log(Config.ALL,"Test: multicast request contains "
+		+ "the groups: " + groups);
+	    
+	} catch (EOFException eofe) {
+	    TestUtility.log(Config.ERROR,"Test: caught exception",eofe);
+	    return Status.failed(Status.TEST, "Multicast request packet "
+		+ "ended unexpectedly");
+	} catch (IOException ioe) {
+	    TestUtility.log(Config.ERROR,"Test: caught exception",ioe);
+	    return Status.failed(Status.TEST, "Multicast request packet "
+		+ "improperly formatted");
+	}    
+
+	return Status.passed("OK");
+    }
+
+    public void tearDown() {
+        super.tearDown();
+
+        try {
+            if (admin != null) {
+		TestUtility.log(Config.ALL,"Test: stopping program");
+                admin.stop();
+            }
+        } catch (RemoteException ignore) {}
+    }
+
+    public String[] getCategories() {
+	return (new String[] { BasicClientAdmin.CATEGORY,
+			       BasicServiceAdmin.CATEGORY });
+    }
+
+    public Class[] getRequiredAdmins() {
+	return (new Class[] { BasicAdmin.class });
+    }
+
+    public String getDescription() {
+	return "RequestPacketTest";
+    }
+
+}
+

Propchange: river/tck/src/com/sun/jini/compat/test/RequestPacketTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/ServiceIDTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/ServiceIDTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/ServiceIDTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/ServiceIDTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,105 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test;
+
+import com.sun.jini.compat.harness.TestUtility;
+import com.sun.jini.compat.test.lookup.TestImpl;
+import com.sun.jini.compat.test.lookup.TestRegistrar;
+import com.sun.jini.compat.test.lookup.TestUtils;
+import com.sun.jini.compat.test.lookup.TestException;
+import com.sun.jini.compat.test.lookup.TestFailedException;
+import com.sun.jini.compat.test.lookup.TestUnresolvedException;
+
+import net.jini.core.lookup.ServiceRegistrar;
+import net.jini.core.lookup.ServiceItem;
+import net.jini.core.lookup.ServiceRegistration;
+import net.jini.core.lookup.ServiceID;
+import java.rmi.RemoteException;
+
+/** This class is used to test that a service registered with
+ *  the Lookup service is assigned a service ID that conforms
+ *  to the ServiceID specification.
+ *
+ *  @see com.sun.jini.compat.test.lookup.QATest
+ *  @see com.sun.jini.compat.test.lookup.QATestImpl
+ *  @see com.sun.jini.compat.test.lookup.QATestRegistrar
+ *  @see com.sun.jini.compat.test.lookup.QATestUtils
+ */
+public class ServiceIDTest extends TestRegistrar {
+
+    private ServiceItem[] srvcItems ;
+    private ServiceRegistration[] srvcRegs ;
+    private int nInstances = 0;
+
+    /** the expected number of matches when testing lookup by ID */
+    private static int EXPECTED_N_MATCHES = 1;
+
+    public ServiceIDTest() {
+    }
+
+    /** Performs actions necessary to prepare for execution of the 
+     *  current QA test.
+     *
+     *  Creates the lookup service. Loads and instantiates all service 
+     *  classes; then registers each service class instance with the maximum
+     *  service lease duration.
+     *  @exception QATestException will usually indicate an "unresolved"
+     *  condition because at this point the test has not yet begun.
+     */
+    public void setupQATest() throws TestException {
+	super.setupQATest();
+        nInstances = super.getNInstances();
+
+	srvcItems = super.createServiceItems(TEST_SRVC_CLASSES);
+	srvcRegs = super.registerAll();
+    }
+
+    /** Executes the current QA test.
+     *  @exception QATestException usually indicates test failure
+     */
+    public void doQATest() throws TestException {
+        if (srvcRegs[0] == null) {
+            throw new TestException("Service never registered");
+        }    
+
+        ServiceID serviceID = srvcRegs[0].getServiceID();
+        if (serviceID == null) {
+            throw new TestException("Service registered without a ServiceID");
+        }    
+
+        String reason = TestUtility.checkServiceID(serviceID);
+        if (reason != null) {
+            throw new TestException(
+                "Service's service ID is non-conformant: " + reason);
+        }    
+    }
+
+
+    /** Performs cleanup actions necessary to achieve a graceful exit of 
+     *  the current QA test.
+     *  @exception TestException will usually indicate an "unresolved"
+     *  condition because at this point the test has completed.
+     */
+    public void cleanupQATest() throws TestException {
+	super.cleanupQATest();
+    }
+   
+    public String getDescription() {
+	return "ServiceIDTest";
+    }
+}

Propchange: river/tck/src/com/sun/jini/compat/test/ServiceIDTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/ServiceLeaseExpirationTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/ServiceLeaseExpirationTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/ServiceLeaseExpirationTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/ServiceLeaseExpirationTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,178 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+
+package com.sun.jini.compat.test;
+
+import com.sun.jini.compat.test.lookup.TestRegistrar;
+import com.sun.jini.compat.test.lookup.TestException;
+import com.sun.jini.compat.test.lookup.TestFailedException;
+import com.sun.jini.compat.test.lookup.TestUnresolvedException;
+import com.sun.jini.compat.test.lookup.TestUtils;
+import com.sun.jini.compat.harness.Config;
+
+import net.jini.core.lookup.ServiceRegistrar;
+import net.jini.core.lookup.ServiceItem;
+import net.jini.core.lookup.ServiceRegistration;
+import net.jini.core.lookup.ServiceMatches;
+import net.jini.core.lookup.ServiceTemplate;
+import net.jini.core.lease.*;
+import java.rmi.RemoteException;
+
+/** This class is used to test that any service item registered with the Lookup
+ *  service can no longer be successfully looked up after the service
+ *  item's lease has expired.
+ *
+ *  @see com.sun.jini.compat.test.lookup.Test
+ *  @see com.sun.jini.compat.test.lookup.TestImpl
+ *  @see com.sun.jini.compat.test.lookup.TestRegistrar
+ *  @see com.sun.jini.compat.test.lookup.TestUtils
+ */
+public class ServiceLeaseExpirationTest extends TestRegistrar {
+
+    /** the expected number of matches when testing lookup by ID */
+    private static int EXPECTED_N_MATCHES = 1;
+    private final static int DEFAULT_LOOP_COUNT = 5;
+    private static int  loopCount= DEFAULT_LOOP_COUNT;   
+    private long leaseDuration;
+    private long leaseWaitTime;
+    private long lookupWaitTime;
+    private ServiceItem[] srvcItems ;
+    private ServiceRegistration[] srvcRegs ;
+    private ServiceTemplate[] srvcIDTmpls;
+    private ServiceRegistrar proxy;
+    private int nInstances = 0;
+    private long leaseStartTime;
+    private long maxLeaseDuration;
+
+    /** Performs actions necessary to prepare for execution of the 
+     *  current  test.
+     *
+     *  Creates the lookup service. Loads and instantiates all service 
+     *  classes. Registers each service class instance with a specified 
+     *  lease duration. Retrieves the proxy to the lookup Registrar. Creates
+     *  an array of ServiceTemplate objects in which each element contains 
+     *  the service ID of one of the registered service items. Establishes 
+     *  an approximate service lease start time for each service item by 
+     *  retrieving the current system time.
+     *  @exception TestException will usually indicate an "unresolved"
+     *  condition because at this point the test has not yet begun.
+     */
+    public void setupQATest() throws TestException {
+	super.setupQATest();
+	Config conf = getConfig();
+	leaseDuration = conf.getFailureTime();
+	leaseWaitTime = leaseDuration*3/4;
+	lookupWaitTime = leaseDuration/2;
+
+        nInstances = super.getNInstances();
+
+	srvcItems = super.createServiceItems(TEST_SRVC_CLASSES);
+	srvcRegs = super.registerAll(leaseDuration);
+	proxy = super.getProxy();
+	
+	long maxExp = 0;
+	for(int i = 0; i < srvcRegs.length; i++) {
+	    Lease l = srvcRegs[i].getLease();
+	    long tempExp = l.getExpiration();
+	    if(tempExp > maxExp)
+		maxExp = tempExp;
+	}
+	
+	srvcIDTmpls = new ServiceTemplate[nInstances];
+	for(int i=0; i<srvcIDTmpls.length; i++) {
+	    srvcIDTmpls[i] = new ServiceTemplate(srvcRegs[i].getServiceID(),
+                                                 null,null);
+	}
+	leaseStartTime = TestUtils.getCurTime();
+	maxLeaseDuration = maxExp - leaseStartTime;
+    }
+
+    /** Executes the current  test.
+     *
+     *  Performs a simple lookup of each registered service item.
+     *  Verifies that the set of service items returned by the lookup 
+     *  operation equals the expected set of service items.
+     *  Waits a specified amount of time so as to guarantee that each
+     *  service lease expires.
+     *  Performs both a simple and a match lookup of each registered service
+     *  item.
+     *  For each lookup performed, verifies that a null service, as well as
+     *  zero matches, are returned.
+     *  @exception TestException usually indicates test failure
+     */
+
+    /*  The time-line diagram below shows the steps of this test:
+     *
+     *           |-------------------------------------------------------|
+     *           :         :         ^         
+     * |-------------------|         :         
+     * 0    ^   0.5        1         :        
+     *      :              :         :
+     *      :              :         :
+     *   Lookup          Lease    Lookup
+     *                  Expires
+     */
+    public void doQATest() throws TestException {
+	TestUtils.doLookup(srvcItems, srvcIDTmpls, proxy );
+	TestUtils.computeDurAndWait(leaseStartTime, maxLeaseDuration);
+        doLookupNoMatch();
+    }
+ 
+    /** Performs cleanup actions necessary to achieve a graceful exit of 
+     *  the current  test.
+     *  @exception TestException will usually indicate an "unresolved"
+     *  condition because at this point the test has completed.
+     */
+    public void cleanupQATest() throws TestException {
+	super.cleanupQATest();
+    }
+
+    /* Perform both a simple and a match lookup using the ServiceTemplate
+     * created during setup. Verifies that every simple lookup returns
+     * a null object; and every match lookup returns zero matches.
+     */
+    private void doLookupNoMatch() throws TestException {
+        Object serviceObj = null;
+        ServiceMatches matches = null;
+        for (int i=0; i<srvcIDTmpls.length; i++) {
+	    try {
+	        if(proxy.lookup(srvcIDTmpls[i]) != null) {
+                    throw new TestFailedException
+                               ("doLookupNoMatch: srvcIDTmpls["+i+"] != null");
+	        }
+	    } catch (RemoteException e) {
+                throw new TestFailedException
+                     ("doLookupNoMatch: RemoteException from single lookup",e);
+	    }
+	    try {
+                matches = proxy.lookup(srvcIDTmpls[i],Integer.MAX_VALUE);
+	    } catch (RemoteException e) {
+                throw new TestFailedException
+                   ("doLookupNoMatch: RemoteException from multiple lookup",e);
+	    }
+            if ( matches.totalMatches != 0) {
+                throw new TestFailedException
+                                        ("doLookupNoMatch: totalMatches != 0");
+	    }
+	}
+    }
+
+    public String getDescription() {
+	return "ServiceLeaseExpirationTest";
+    }   
+}

Propchange: river/tck/src/com/sun/jini/compat/test/ServiceLeaseExpirationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/UnicastRequestTest.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/UnicastRequestTest.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/UnicastRequestTest.java (added)
+++ river/tck/src/com/sun/jini/compat/test/UnicastRequestTest.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,172 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test;
+
+import java.rmi.RemoteException;
+
+import java.net.InetAddress;
+import java.net.DatagramPacket;
+import java.net.Socket;
+import java.net.ConnectException;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.StringWriter;
+import java.io.PrintWriter;
+import java.io.EOFException;
+import java.io.IOException;
+
+import java.util.List;
+
+import com.sun.jini.compat.harness.TestUtility;
+import com.sun.jini.compat.harness.Status;
+import com.sun.jini.compat.harness.BasicServiceAdmin;
+import com.sun.jini.compat.harness.BasicClientAdmin;
+import com.sun.jini.compat.harness.BasicAdmin;
+import com.sun.jini.compat.harness.Config;
+import com.sun.jini.compat.harness.DefaultTest;
+
+/**
+ * Tests whether a service or a client, having sent a multicast request 
+ * packet and obtained a return socket connection, replies with a 
+ * properly formatted unicast request packet on that socket.
+ */
+public class UnicastRequestTest extends DefaultTest {
+
+    BasicAdmin admin;
+    Socket sock;
+
+    /**
+     * Listens to the appropriate multicast group for a multicast 
+     * request. When it receives the packet it, decodes the port 
+     * information and gets the address the packet came
+     * from and makes a socket connection to that port and address. 
+     * It then proceeds to listen for a unicast request packet on 
+     * that socket. If it receives the packet, it decodes its protocol 
+     * version and checks that to make sure it is correct. If any of
+     * these steps fail, such as a packet is not received in time or 
+     * either of the packets improperly formatted, the service fails.
+     * 
+     * @param args Command line arguments passed through
+     * @return The status of this run (failed or passed
+     *         and a comment)
+     */
+    public Status run(String[] args) {
+	Config conf = getConfig();
+	admin = conf.getAdmin();
+
+	List results = null;
+	int timeout = conf.getFailureTime();
+	try {	    
+	    TestUtility.log(Config.ALL,"Test: starting program and "
+		+ "waiting up to " + timeout
+		+ " milliseconds for its first multicast request");
+	    results = TestUtility.startProductAndGetMulticastRequests(
+		timeout, 1, admin);
+	} catch (IOException ioe) {
+	    return Status.failed(Status.INDEF, "Failed to receive a "
+                + "multicast request packet within " + timeout 
+                + " milliseconds");
+	} catch (Exception e) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",e);
+            return Status.failed(Status.ENV,"Problem starting program or "
+                + "waiting for multicast request");
+        }
+	    
+	try {
+	    TestUtility.log(Config.ALL,"Test: parsing multicast request "
+		+ "packet");
+	    DatagramPacket pkt = (DatagramPacket) results.get(0);
+	    ByteArrayInputStream bais = new ByteArrayInputStream(pkt.getData());
+	    DataInputStream dis = new DataInputStream(bais);
+	    dis.readInt(); // protocol version
+	    int port = dis.readInt();
+	    InetAddress listenAddress = pkt.getAddress();
+	    try { 
+	        TestUtility.log(Config.ALL,"Test: opening socket to program " 
+		    + "at: " + listenAddress + ":" + port);
+	        sock = new Socket(listenAddress, port); 
+	        sock.setSoTimeout(timeout);
+	    } catch (Exception e) { 
+                TestUtility.log(Config.ERROR,"Test: caught exception",e);
+	        return Status.failed(Status.TEST, "Could not connect to "
+		    + "program response address: " 
+		    + listenAddress + ":" + port); 
+	    } 
+	} catch (IOException ioe) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",ioe);
+            return Status.failed(Status.ENV,"Could not decode "
+                + "incoming multicast request");
+        }
+
+
+	try {
+	    TestUtility.log(Config.ALL,"Test: checking unicast request packet");
+	    DataInputStream disUni = new DataInputStream(sock.getInputStream());
+	    int protoVersion = disUni.readInt();
+	    TestUtility.log(Config.ALL,"Test: unicast request contains "
+		+ "protocol version: " + protoVersion);
+	    if (protoVersion != 1) {
+		return Status.failed(Status.TEST, "Unicast request "
+		     + "should have protocol version 1");
+	    }
+	} catch (EOFException eofe) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",eofe);
+	    return Status.failed(Status.TEST, "Unicast request packet "
+		+ "ended unexpectedly");
+	} catch (IOException ioe) {
+            TestUtility.log(Config.ERROR,"Test: caught exception",ioe);
+	    return Status.failed(Status.TEST, "Unicast request packet "
+                + "improperly formatted");
+	}    
+
+	return Status.passed("OK");
+    }
+
+    public void tearDown() {
+        super.tearDown();
+
+	try {
+	    if (sock != null) {
+		sock.close();
+	    }
+	} catch (IOException ignore) {}
+
+        try {
+            if (admin != null) {
+		TestUtility.log(Config.ALL,"Test: stopping program");
+                admin.stop();
+            }
+        } catch (RemoteException ignore) {}
+    }
+
+    public String[] getCategories() {
+	return (new String[] { BasicClientAdmin.CATEGORY,
+			       BasicServiceAdmin.CATEGORY });
+    }
+
+    public Class[] getRequiredAdmins() {
+	return (new Class[] { BasicAdmin.class });
+    }
+
+    public String getDescription() {
+	return "UnicastRequestTest";
+    }
+
+}
+

Propchange: river/tck/src/com/sun/jini/compat/test/UnicastRequestTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/lookup/TestException.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/lookup/TestException.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/lookup/TestException.java (added)
+++ river/tck/src/com/sun/jini/compat/test/lookup/TestException.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,72 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test.lookup;
+
+/** Base class that represents all exceptional conditions that occur
+ *  during execution of any LDJ Kit lookup tests.
+ *  Whenever an exception is caught during such a test run, 
+ *  the exception will be wrapped in one the sub-classes of this class 
+ *  and then that sub-class will be thrown so as to indicate an unsuccessful 
+ *  run. The particular sub-class that is used depends on the nature of 
+ *  the exception that is caught.
+ *
+ *  @see java.lang.Exception
+ */
+public class TestException extends Exception {
+
+    static final long serialVersionUID = -4845233333262176756L;
+
+    /** @serial Holds a nested exception for more detail in a stack trace */
+    public Throwable nestedException;
+
+    /** Creates a TestException */
+    public TestException(){ 
+        super();
+    }
+
+    /** Creates a TestException with the given String
+     *  @param s String to display
+     */
+    public TestException(String s){
+        super(s);
+    }
+
+    /** Creates a TestException with the given String and the given
+     *  nested exception
+     *
+     *  @param s String to display
+     *  @param e nested exception detail
+     */
+    public TestException(String s,
+                           Throwable e){
+        super(s);
+        nestedException = e;
+    }
+
+    /** Returns exception String message; includes the String message from
+     *  the nested exception if there is one
+     */
+    public String getMessage(){
+        if (nestedException == null) {
+            return super.getMessage();
+	} else {
+            return super.getMessage() + "; nested exception is: \n\t"
+                                      + nestedException.toString();
+	}
+    }
+}

Propchange: river/tck/src/com/sun/jini/compat/test/lookup/TestException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/lookup/TestFailedException.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/lookup/TestFailedException.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/lookup/TestFailedException.java (added)
+++ river/tck/src/com/sun/jini/compat/test/lookup/TestFailedException.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,51 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test.lookup;
+
+/** Class that represents all failure conditions that occur during 
+ *  execution of any LDJ Kit lookup tests.
+ *  Whenever an exception is caught due to failure during a 
+ *  test run, the exception will be wrapped in this class and this 
+ *  class will be thrown so as to declare a failed test.
+ *
+ *  @see com.sun.jini.compat.test.lookup.TestException
+ */
+public class TestFailedException extends TestException {
+
+    /** Creates a TestFailedException */
+    public TestFailedException(){ 
+        super();
+    }
+
+    /** Creates a TestFailedException with the given String
+     *  @param s String to display
+     */
+    public TestFailedException(String s){
+        super(s);
+    }
+
+    /** Creates a TestFailedException with the given String and the given
+     *  nested exception
+     *  @param s String to display
+     *  @param e nested exception detail
+     */
+    public TestFailedException(String s,
+                                 Throwable e){
+        super(s,e);
+    }
+}

Propchange: river/tck/src/com/sun/jini/compat/test/lookup/TestFailedException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/lookup/TestImpl.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/lookup/TestImpl.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/lookup/TestImpl.java (added)
+++ river/tck/src/com/sun/jini/compat/test/lookup/TestImpl.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,243 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test.lookup;
+
+import java.util.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.rmi.RemoteException;
+
+import com.sun.jini.compat.test.lookup.TestException;
+
+import com.sun.jini.compat.harness.SysConfig;
+import com.sun.jini.compat.harness.Config;
+import com.sun.jini.compat.harness.DefaultTest;
+import com.sun.jini.compat.harness.Status;
+import com.sun.jini.compat.harness.BasicLookupAdmin;
+
+/** Besides providing an implementation of the QATest interface, this 
+ *  class provides an abstract base class for the LDJ Kit lookup tests.
+ *  @see com.sun.jini.test.lookup.QATest
+ */
+public abstract class TestImpl extends DefaultTest {
+
+    /** current OS's file separator */
+    public static String separator = File.separator;
+    /** Object used to enable the configuration of the current QA test
+     * @see com.sun.jini.test.util.SysConfig
+     */
+    public SysConfig sysConfig;
+
+    /** path and directory name for logging persistent state */
+    protected static String persistentLogDir;
+    /** new path and directory name when current directory is to be changed */
+    protected static String newPersistentLogDir;
+
+    /** The default outputRoot */
+    private final static String DEF_OUTPUT_ROOT = ".";
+    /** The basename of the directory for logging state for persistence */
+    private final static String PERSISTENT_LOG_DIR = "RegistrarLog";
+    /** The basename to use when changing the persistence directory */
+    private final static String NEW_PERSISTENT_LOG_DIR = "NewRegistrarLog";
+
+    /** root directory where the report sub-directory should be created */
+    private String outputRoot;
+    /** name of report file to generate */
+    private String reportFile;
+    /** base class name (no package) of the current class being tested */
+    private String baseClassName;
+    /** number of tests to run when this QA test is executed */
+    private int nTestRuns = 1;
+    /** report file stream object */
+    private FileOutputStream fo;
+    /** report file printer */
+    private PrintWriter pw;
+    
+    /** Perform general-purpose setup actions necessary to prepare for 
+     *  execution of the current QA test.
+     *  @exception QATestException will usually indicate an "unresolved"
+     *  condition because at this point the test has not yet begun.
+     */
+    public abstract void setupQATest() throws TestException;
+
+    /** Execute the current QA test. 
+     *  @exception QATestException will usually indicate a failure
+     *  since the exception occurs during the actual test run.
+     */
+    public abstract void doQATest() throws TestException;
+
+    /** Perform general-purpose cleanup actions necessary to achieve a 
+     *  graceful exit of the current QA test.
+     *  @exception QATestException will usually indicate an "unresolved"
+     *  condition because at this point the test has completed.
+     */
+    public abstract void cleanupQATest() throws TestException;
+
+    /* Class constructor. */
+    public TestImpl() {
+    }
+
+    /**
+     * To support both TestImpl's and Test's sysConfig handling
+     */
+    public void setConfig(Config tCon) {
+	super.setConfig(tCon);
+	sysConfig = tCon.getSysConfig();
+    }
+
+    /** Performs high-level, general-purpose setup actions necessary to 
+     *  prepare for execution of the current QA test.
+     *
+     *  This method parses the argument list to retrieve the number of
+     *  times to execute the current test and the name of the file to which
+     *  report information will be written. After processing the appropriate
+     *  data in the argument list, the report file is initialized.
+     *  @param args command line arguments for the current QA test
+     *  @exception QATestException will usually indicate an "unresolved"
+     *  condition because at this point the test has not yet begun.
+     */
+    public void setup(List args) throws TestException {
+	nTestRuns = 1;
+
+        persistentLogDir    = "./"+PERSISTENT_LOG_DIR;
+        newPersistentLogDir = "./"+NEW_PERSISTENT_LOG_DIR;
+    
+        String className = this.getClass().getName();
+        int lastDotIndx = className.lastIndexOf('.');
+        baseClassName = className.substring(1+lastDotIndx);
+    }
+
+    /**
+     * Calls setup(List args) with an empty list of args.
+     */
+    public void setup(PrintStream log) throws Exception{
+	setup(new Vector());
+    }
+
+    /**
+     * Overloads the setup method from Test.  It calls setup(List l)
+     * with a null argument and setupQATest.
+     */
+    public void setup(String[] args) throws Exception {
+	setup((Vector)null);
+	setupQATest();
+    }
+    
+    /**
+     * Overloads the tearDown method from Test.
+     */
+    public void tearDown() {
+	try {
+	    cleanupQATest();
+	} catch(Exception e) {}
+    }
+
+    /** Executes the current LDJ Kit test.
+     *  @exception TestException  will usually indicate a failure
+     *  since the exception occurs during the actual test run.
+     */
+    public void go() throws TestException {
+	doQATest();
+    }
+    
+    /**
+     * Runs the test.
+     */
+    public Status run(String[] args) {
+	try {
+	    go();
+	} catch(TestFailedException tfe) {
+	    return Status.failed(Status.TEST, tfe.getMessage());
+	} catch(TestException te) {
+	    return Status.failed(Status.ENV, te.getMessage());
+	}
+	return Status.passed("OK");
+    }
+
+    /** Performs high-level, general-purpose cleanup actions necessary to 
+     *  achieve a graceful exit of the current QA test.
+     *  @exception QATestException will usually indicate an "unresolved"
+     *  condition because at this point the test has completed.
+     */
+    public void cleanup() throws TestException {
+	cleanupQATest();
+    }
+
+    /** Write final results and close the report file */
+    public void generateReport() {
+    }
+
+    /** Write final results and close the report file 
+     *  @param e The QATestException for reporting stack trace
+     */
+    public void generateReport(TestException e) {
+    }
+
+    /** Write to the report file
+     *  @param str String containing information to write to the report file
+     */
+    public void writeToReport(String str) {
+    }
+
+    /** Returns the base class name of the class currently being tested 
+     *  @return String
+     */
+    public String getBaseClassName() {
+	return baseClassName;
+    }
+
+    /** Returns the number of tests that the current QA test should run.
+     *  @return int
+     */
+    public int getNTestRuns() {
+	return nTestRuns;
+    }
+
+    /** Sets the number of tests that the current QA test should run
+     *  @param nTestRuns number of test runs
+     */
+    public void setNTestRuns(int nTestRuns) {
+	if (nTestRuns <= 0) {
+	    throw new IllegalArgumentException(
+		"setNTestRuns(" + nTestRuns + ")");
+	}
+	this.nTestRuns = nTestRuns;
+    }
+
+    /** Returns the name of the report file that the current QA test should 
+     *  generate.
+     *  @return String
+     */
+    public String getReportFile() {
+	return reportFile;
+    }
+
+    /** Sets the name of the report file that the current QA test should 
+     *  generate.
+     *  @param reportFile the name of the report file
+     */
+    public void setReportFile(String reportFile) {
+	this.reportFile = reportFile;
+    }
+}
+
+

Propchange: river/tck/src/com/sun/jini/compat/test/lookup/TestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: river/tck/src/com/sun/jini/compat/test/lookup/TestInvestigateException.java
URL: http://svn.apache.org/viewvc/river/tck/src/com/sun/jini/compat/test/lookup/TestInvestigateException.java?rev=1234278&view=auto
==============================================================================
--- river/tck/src/com/sun/jini/compat/test/lookup/TestInvestigateException.java (added)
+++ river/tck/src/com/sun/jini/compat/test/lookup/TestInvestigateException.java Sat Jan 21 07:28:27 2012
@@ -0,0 +1,58 @@
+/*
+ * 
+ * Copyright 2005 Sun Microsystems, Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ */
+package com.sun.jini.compat.test.lookup;
+
+import com.sun.jini.compat.test.lookup.TestException;
+
+/** Class that represents conditions indicating that failure occurred 
+ *  after successful completion of any LDJ Kit lookup tests.
+ *  Such a condition will result in the test run
+ *  being labelled as "passed with comments". A typical example of a
+ *  "passed with comments" condition during a run of LDJ Kit lookup tests
+ *  would be when an exception occurs during test clean up; this might be 
+ *  due to network failure, problems in the Activation daemon, etc. In 
+ *  this case, the test has succeeded but was not able to exit gracefully.
+ *  Whenever such a condition occurs during a test run, this exception
+ *  will be thrown.
+ *
+ *  @see com.sun.jini.compat.test.lookup.TestException
+ */
+public class TestInvestigateException extends TestException {
+
+    /** Creates a TestInvestigateException */
+    public TestInvestigateException(){ 
+        super();
+    }
+
+    /** Creates a TestInvestigateException with the given String 
+     *  @param s String to display
+     */
+    public TestInvestigateException(String s){
+        super(s);
+    }
+
+    /** Creates a TestInvestigateException with the given String and the
+     *  given nested exception
+     *  @param s String to display
+     *  @param e nested exception detail
+     */
+    public TestInvestigateException(String s,
+                                      Throwable e){
+        super(s,e);
+    }
+}

Propchange: river/tck/src/com/sun/jini/compat/test/lookup/TestInvestigateException.java
------------------------------------------------------------------------------
    svn:eol-style = native