5266N/A * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The AppleUserImpl class implements the behavior of the remote 0N/A * "apple user" objects exported by the server. The application server 0N/A * passes each of its remote "apple" objects to an apple user, and an 0N/A * AppleUserThread is created for each apple. 0N/A * Allows the other server process to indicate that it is ready 0N/A * to start "juicing". 0N/A * Allows the other server process to report an exception to this 0N/A * process and thereby terminate the test. 0N/A * "Use" supplied apple object. Create an AppleUserThread to 0N/A * The AppleUserThread class repeatedly invokes calls on its associated 0N/A * Apple object to stress the RMI system. 0N/A do {
// loop until stopTime is reached 0N/A * Notify apple with some apple events. This tests 0N/A * serialization of arrays. 0N/A * Request a new orange object be created in 0N/A * the application server. 0N/A * Create a large message of random ints to pass to orange. 0N/A * Invoke recursive call on the orange. Base case 0N/A * of recursion inverts messgage. 0N/A * Verify message was properly inverted and not corrupted 0N/A * through all the recursive method invocations. 0N/A "ERROR: CORRUPTED RESPONSE: " +
0N/A "wrong length of returned array " +
"(should be " +
0N/A "ERROR: CORRUPTED RESPONSE: " +
0N/A " of returned array (should be " +
0N/A "-seconds <seconds>]");
0N/A //TestLibrary.bomb("Bad argument"); 0N/A * Entry point for the "juicer" server process. Create and export 0N/A * an apple user implementation in an rmiregistry running on localhost. 0N/A //TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager"); 0N/A // parse command line args 0N/A //TestLibrary.bomb("Failed to create AppleUser", e); 0N/A // create new registry and bind new AppleUserImpl in registry 0N/A //TestLibrary.bomb("Failed to bind AppleUser", e); 0N/A //TestLibrary.bomb("Failed to bind AppleUser", e); 0N/A // start the other server if available 0N/A // assume the other server is running in a separate process 0N/A "started in separate process");
0N/A //TestLibrary.bomb("Could not instantiate server", ie); 0N/A // wait for other server to call startTest method 0N/A "process to start");
0N/A //TestLibrary.bomb("AppleUserImpl interrupted", ie); 0N/A // wait for exception to be reported or first thread to complete 0N/A "test to complete or exception to be thrown");
0N/A //TestLibrary.bomb("juicer server reported an exception", status); 0N/A //TestLibrary.bomb("unexpected exception", e);