Commits

Anonymous committed 389f45a

Fixed xml tests and added serialVersionUID to TestObject to make deserializing it work

git-svn-id: http://svn.opensymphony.com/svn/propertyset/trunk@165bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

Comments (0)

Files changed (3)

src/test/com/opensymphony/module/propertyset/AbstractPropertySetTest.java

  * User: bbulger
  * Date: May 22, 2004
  */
-public class AbstractPropertySetTest extends TestCase {
+public abstract class AbstractPropertySetTest extends TestCase {
     //~ Instance fields ////////////////////////////////////////////////////////
 
     protected PropertySet ps;

src/test/com/opensymphony/module/propertyset/TestObject.java

     //~ Instance fields ////////////////////////////////////////////////////////
 
     private long id;
+    private static final long serialVersionUID = 261939103282846342L;
 
-    //~ Constructors ///////////////////////////////////////////////////////////
+  //~ Constructors ///////////////////////////////////////////////////////////
 
     public TestObject(long id) {
         this.id = id;
             return true;
         }
 
+      if(obj == null) {
+        return false;
+      }
         if (this.getClass() != obj.getClass()) {
             return false;
         }

src/test/com/opensymphony/module/propertyset/memory/SerializablePropertySetTest.java

 package com.opensymphony.module.propertyset.memory;
 
 import com.opensymphony.module.propertyset.AbstractPropertySetTest;
-import com.opensymphony.module.propertyset.IllegalPropertyException;
-
-import javax.xml.parsers.ParserConfigurationException;
-
 
 /**
  * User: bbulger
 public class SerializablePropertySetTest extends AbstractPropertySetTest {
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void testGetTypeForXml() throws ParserConfigurationException {
-        try {
-            super.testGetTypeForXml();
-            fail("Document is not serializable.");
-        } catch (IllegalPropertyException e) {
-            // success
-        }
-    }
-
-    public void testSetAsActualTypeGetAsActualTypeForXml() throws ParserConfigurationException {
-        try {
-            super.testSetAsActualTypeGetAsActualTypeForXml();
-            fail("Document is not serializable.");
-        } catch (IllegalPropertyException e) {
-            // success
-        }
-    }
-
-    public void testSetXmlGetXml() throws ParserConfigurationException {
-        try {
-            super.testSetXmlGetXml();
-            fail("Document is not serializable.");
-        } catch (IllegalPropertyException e) {
-            // success
-        }
-    }
-
     protected void setUp() throws Exception {
         super.setUp();
         ps = new SerializablePropertySet();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.