/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5016705
* @summary Tests the use of the RMIExporter class.
* @author Luis-Miguel Alventosa
* @run clean RMIExporterTest
* @run build RMIExporterTest
* @run main RMIExporterTest
*/
public class RMIExporterTest {
public boolean rmiServerExported = false;
public boolean rmiServerUnexported = false;
public boolean rmiConnectionExported = false;
public boolean rmiConnectionUnexported = false;
int port,
throws RemoteException {
"Remote = " + obj);
"javax.management.remote.rmi.RMIJRMPServerImpl"))
rmiServerExported = true;
"javax.management.remote.rmi.RMIConnectionImpl"))
rmiConnectionExported = true;
}
throws NoSuchObjectException {
"Remote = " + obj);
"javax.management.remote.rmi.RMIJRMPServerImpl"))
rmiServerUnexported = true;
"javax.management.remote.rmi.RMIConnectionImpl"))
rmiConnectionUnexported = true;
}
}
try {
// Instantiate the MBean server
//
// Initialize environment map to be passed to the connector server
//
// Create an RMI connector server
//
// Create an RMI connector client
//
// Close RMI connector client
//
// Stop RMI connector server
//
// Check if remote objects were exported/unexported successfully
//
int errorCount = 0;
if (exporter.rmiServerExported) {
} else {
errorCount++;
}
if (exporter.rmiServerUnexported) {
} else {
errorCount++;
}
if (exporter.rmiConnectionExported) {
} else {
errorCount++;
}
if (exporter.rmiConnectionUnexported) {
} else {
errorCount++;
}
if (errorCount > 0) {
} else {
}
} catch (Exception e) {
e.printStackTrace();
}
}
}