/*
* 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 4720528
* @summary synopsis: (spec) ActivationSystem.activeGroup spec should be
* relaxed (duplicate call to activeGroup with same instantiator and
* incarnation should not throw ActivationException; it should succeed)
* @author Ann Wollrath
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
* @run main/othervm/policy=security.policy/timeout=480 IdempotentActiveGroup
*/
public class IdempotentActiveGroup {
try {
inst1 = new FakeInstantiator();
inst2 = new FakeInstantiator();
try {
throw new RuntimeException(
"TEST FAILED: activeGroup with unequal groups succeeded!");
} catch (ActivationException expected) {
}
try {
} catch (ActivationException unexpected) {
throw new RuntimeException(
"TEST FAILED: activeGroup with equal groups failed!",
}
} catch (Exception e) {
} finally {
try {
}
}
} catch (NoSuchObjectException unexpected) {
throw new AssertionError(unexpected);
}
}
}
private static class FakeInstantiator
extends UnicastRemoteObject
implements ActivationInstantiator
{
{
throw new AssertionError();
}
}
}