本文整理汇总了Java中java.rmi.server.ServerCloneException类的典型用法代码示例。如果您正苦于以下问题:Java ServerCloneException类的具体用法?Java ServerCloneException怎么用?Java ServerCloneException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerCloneException类属于java.rmi.server包,在下文中一共展示了ServerCloneException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
Exception t = new RuntimeException();
String foo = "foo";
String fooMsg = "foo; nested exception is: \n\t" + t;
test(new RemoteException(), null, null);
test(new RemoteException(foo), foo, null);
test(new RemoteException(foo, t), fooMsg, t);
test(new ActivationException(), null, null);
test(new ActivationException(foo), foo, null);
test(new ActivationException(foo, t), fooMsg, t);
test(new ServerCloneException(foo), foo, null);
test(new ServerCloneException(foo, t), fooMsg, t);
}
示例2: setUp
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
/**
* Sets up the fixture, for example, open a network connection. This method
* is called before a test is executed.
*/
@Override
protected void setUp() {
errorMessage = "Clone Error";
causeMessage = "Caused Exception";
cause = new ServerCloneException(causeMessage);
}
示例3: test_Constructor_String
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
/**
* @tests java.rmi.server.ServerCloneException#ServerCloneException(String)
*/
public void test_Constructor_String() {
ServerCloneException e = new ServerCloneException(errorMessage);
assertEquals(errorMessage, e.getMessage());
assertNull(e.detail);
try {
e.initCause(e);
fail("No expected IllegalStateException");
} catch (IllegalStateException exception) {
// expected
}
}
示例4: assertDeserialized
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
public void assertDeserialized(Serializable initial,
Serializable deserialized) {
SerializationTest.THROWABLE_COMPARATOR.assertDeserialized(initial, deserialized);
ServerCloneException initEx = (ServerCloneException) initial;
ServerCloneException desrEx = (ServerCloneException) deserialized;
assertEquals(initEx.getMessage(), desrEx.getMessage());
assertEquals(initEx.getCause().getMessage(), desrEx.getCause().getMessage());
}
示例5: test_Constructor_String_Exception
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
/**
* @tests java.rmi.server.ServerCloneException#ServerCloneException(String,Exception)
*/
public void test_Constructor_String_Exception() {
ServerCloneException e = new ServerCloneException(errorMessage, cause);
assertEquals(cause.getMessage(), e.getCause().getMessage());
assertEquals(cause.getMessage(), e.detail.getMessage());
}
示例6: testSerializationSelf
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
/**
* @tests serialization/deserialization.
*/
public void testSerializationSelf() throws Exception {
SerializationTest.verifySelf(new ServerCloneException(errorMessage, cause), comparator);
}
示例7: testSerializationCompatibility
import java.rmi.server.ServerCloneException; //导入依赖的package包/类
/**
* @tests serialization/deserialization compatibility with RI.
*/
public void testSerializationCompatibility() throws Exception {
SerializationTest.verifyGolden(this, new ServerCloneException(errorMessage, cause), comparator);
}