Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 53379 Details for
Bug 101476
"Serializable class without serialVersionUID" setting and writeReplace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression tests
patch_101476_tests.txt (text/plain), 6.01 KB, created by
Olivier Thomann
on 2006-11-07 11:14:13 EST
(
hide
)
Description:
Regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2006-11-07 11:14:13 EST
Size:
6.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java,v >retrieving revision 1.66 >diff -u -r1.66 TestAll.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 11 Oct 2006 09:15:32 -0000 1.66 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java 7 Nov 2006 16:17:44 -0000 >@@ -60,6 +60,7 @@ > standardTests.add(InnerEmulationTest.class); > standardTests.add(SuperTypeTest.class); > standardTests.add(ForStatementTest.class); >+ standardTests.add(SerialVersionUIDTests.class); > > // add all javadoc tests > for (int i=0, l=JavadocTest.ALL_CLASSES.size(); i<l; i++) { >Index: src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java >=================================================================== >RCS file: src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java >diff -N src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/SerialVersionUIDTests.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,138 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+/* >+ * Here we focus on various aspects of the runtime behavior of the generated >+ * code. >+ */ >+package org.eclipse.jdt.core.tests.compiler.regression; >+ >+import java.util.Map; >+ >+import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; >+ >+import junit.framework.Test; >+ >+public class SerialVersionUIDTests extends AbstractRegressionTest { >+ >+public SerialVersionUIDTests(String name) { >+ super(name); >+} >+// Static initializer to specify tests subset using TESTS_* static variables >+// All specified tests which does not belong to the class are skipped... >+// Only the highest compliance level is run; add the VM argument >+// -Dcompliance=1.4 (for example) to lower it if needed >+static { >+// TESTS_NAMES = new String[] { "test0001" }; >+// TESTS_NUMBERS = new int[] { 1 }; >+// TESTS_RANGE = new int[] { 1, -1 }; >+} >+public static Test suite() { >+ return buildAllCompliancesTestSuite(testClass()); >+} >+public static Class testClass() { >+ return SerialVersionUIDTests.class; >+} >+protected Map getCompilerOptions() { >+ Map options = super.getCompilerOptions(); >+ options.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.ERROR); >+ return options; >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test001() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "import java.io.Serializable;\n" + >+ "\n" + >+ "public class X implements Serializable {\n" + >+ " private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException {}\n" + >+ " private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException {}\n" + >+ "}" >+ }, >+ "" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test002() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X implements java.io.Externalizable {\n" + >+ " public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {}\n" + >+ " public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException {}\n" + >+ "}" >+ }, >+ "" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test003() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements java.io.Serializable {\n" + >+ " private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException {}\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X implements java.io.Serializable {\n" + >+ " ^\n" + >+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test004() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements java.io.Serializable {\n" + >+ " private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException {}\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X implements java.io.Serializable {\n" + >+ " ^\n" + >+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test005() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X implements java.io.Serializable {\n" + >+ "}" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 1)\n" + >+ " public class X implements java.io.Serializable {\n" + >+ " ^\n" + >+ "The serializable class X does not declare a static final serialVersionUID field of type long\n" + >+ "----------\n" >+ ); >+} >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101476 >+public void test006() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X implements java.io.Serializable {\n" + >+ " Object writeReplace() throws java.io.ObjectStreamException { return null;}\n" + >+ "}" >+ }, >+ "" >+ ); >+} >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 101476
:
53377
| 53379