You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by az...@apache.org on 2007/11/13 14:53:28 UTC
svn commit: r594538 - in
/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes:
ObjectSerializationTest.java TestDO.java
Author: azeez
Date: Tue Nov 13 05:53:27 2007
New Revision: 594538
URL: http://svn.apache.org/viewvc?rev=594538&view=rev
Log:
Assing a test
Added:
webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/TestDO.java
Modified:
webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/ObjectSerializationTest.java
Modified: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/ObjectSerializationTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/ObjectSerializationTest.java?rev=594538&r1=594537&r2=594538&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/ObjectSerializationTest.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/ObjectSerializationTest.java Tue Nov 13 05:53:27 2007
@@ -16,28 +16,38 @@
package org.apache.axis2.clustering.tribes;
import junit.framework.TestCase;
+import org.apache.axis2.clustering.control.AckCommand;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
-
-import org.apache.axis2.clustering.control.AckCommand;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
/**
*
*/
public class ObjectSerializationTest extends TestCase {
- public void testSerialization(){
+ public void testSerialization() {
AckCommand ackCommand = new AckCommand("uuid");
ackCommand.setMemberId("123456");
AckCommand ackCommand2 = (AckCommand) copy(ackCommand);
- assertFalse(ackCommand.equals(ackCommand2));
+ assertNotNull(ackCommand2);
+ assertFalse(ackCommand.equals(ackCommand2));
assertEquals(ackCommand.getUniqueId(), ackCommand2.getUniqueId());
+ }
+
+ public void testSerialization2() {
+ TestDO testDO = new TestDO("name", "value");
+ TestDO testDO2 = (TestDO) copy(testDO);
+
+ assertNotNull(testDO2);
+ assertFalse(testDO.equals(testDO2));
+ assertEquals(testDO.getName(), testDO2.getName());
+ assertEquals(testDO.getValue(), testDO2.getValue());
}
/**
Added: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/TestDO.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/TestDO.java?rev=594538&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/TestDO.java (added)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/tribes/TestDO.java Tue Nov 13 05:53:27 2007
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * 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 org.apache.axis2.clustering.tribes;
+
+import java.io.Serializable;
+
+/**
+ *
+ */
+public class TestDO implements Serializable {
+ private String name;
+ private String value;
+
+ public TestDO(String name, String value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org