Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-04-24 14:39:11 -0400
committerStephan Herrmann2010-04-24 14:39:11 -0400
commit5bae42844056473de4fd05de3e5135dc1770bb4d (patch)
tree2301b54bc1bf97ae61f6797684cab273a257ebad /testplugins/org.eclipse.jdt.ui.tests
parent3ce98384823e200d4fea42c39deb6fa38fe34db2 (diff)
downloadorg.eclipse.objectteams-5bae42844056473de4fd05de3e5135dc1770bb4d.tar.gz
org.eclipse.objectteams-5bae42844056473de4fd05de3e5135dc1770bb4d.tar.xz
org.eclipse.objectteams-5bae42844056473de4fd05de3e5135dc1770bb4d.zip
Update to v20100423-0800 to match jdt.core v_A46
Diffstat (limited to 'testplugins/org.eclipse.jdt.ui.tests')
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java11
-rw-r--r--testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java25
2 files changed, 19 insertions, 17 deletions
diff --git a/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java b/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
index c6b03ee0e..d95de3bcd 100644
--- a/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
+++ b/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Mateusz Matela and others.
+ * Copyright (c) 2008, 2010 Mateusz Matela 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
@@ -55,6 +55,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
+
public class GenerateToStringTest extends SourceTestCase {
static final Class THIS= GenerateToStringTest.class;
@@ -1706,8 +1707,8 @@ public class GenerateToStringTest extends SourceTestCase {
+ " public String toString() {\r\n"
+ " final int maxLen = 10;\r\n"
+ " StringBuffer buffer = new StringBuffer();\r\n"
- + " buffer.append(\"A [AArray=\").append(AArray != null ? arrayToString(AArray, AArray.length, maxLen) : null).append(\", aBool=\").append(aBool).append(\", anA=\").append(anA).append(\", floatArray=\").append(floatArray != null ? arrayToString(floatArray, floatArray.length, maxLen) : null).append(\", hashMap=\").append(hashMap != null ? toString(hashMap.entrySet(), maxLen) : null).append(\", intArray=\").append(intArray != null ? arrayToString(intArray, intArray.length, maxLen) : null).append(\", integerCollection=\").append(integerCollection != null ? toString(integerCollection, maxLen) : null).append(\", list=\").append(list != null ? toString(list, maxLen) : null).append(\", object=\").append(object).append(\", stringArray=\").append(stringArray != null ? arrayToString(stringArray, stringArray.length, maxLen) : null).append(\", wildCollection=\").append(wildCollection != null ? toString(wildCollection, maxLen) : null).append(\", charArrayMethod()=\").append(\r\n"
- + " charArrayMethod() != null ? arrayToString(charArrayMethod(), charArrayMethod().length, maxLen) : null).append(\", floatArrayMethod()=\").append(floatArrayMethod() != null ? arrayToString(floatArrayMethod(), floatArrayMethod().length, maxLen) : null).append(\"]\");\r\n"
+ + " buffer.append(\"A [AArray=\").append(AArray != null ? arrayToString(AArray, AArray.length, maxLen) : null).append(\", aBool=\").append(aBool).append(\", anA=\").append(anA).append(\", floatArray=\").append(floatArray != null ? arrayToString(floatArray, floatArray.length, maxLen) : null).append(\", hashMap=\").append(hashMap != null ? toString(hashMap.entrySet(), maxLen) : null).append(\", intArray=\").append(intArray != null ? arrayToString(intArray, intArray.length, maxLen) : null).append(\", integerCollection=\").append(integerCollection != null ? toString(integerCollection, maxLen) : null).append(\", list=\").append(list != null ? toString(list, maxLen) : null).append(\", object=\").append(object).append(\", stringArray=\").append(stringArray != null ? arrayToString(stringArray, stringArray.length, maxLen) : null).append(\", wildCollection=\").append(wildCollection != null ? toString(wildCollection, maxLen) : null).append(\", charArrayMethod()=\")\r\n"
+ + " .append(charArrayMethod() != null ? arrayToString(charArrayMethod(), charArrayMethod().length, maxLen) : null).append(\", floatArrayMethod()=\").append(floatArrayMethod() != null ? arrayToString(floatArrayMethod(), floatArrayMethod().length, maxLen) : null).append(\"]\");\r\n"
+ " return buffer.toString();\r\n" + " }\r\n" + " private String toString(Collection collection, int maxLen) {\r\n" + " StringBuffer buffer = new StringBuffer();\r\n"
+ " buffer.append(\"[\");\r\n" + " int i = 0;\r\n" + " for (Iterator iterator = collection.iterator(); iterator.hasNext() && i < maxLen; i++) {\r\n" + " if (i > 0) {\r\n"
+ " buffer.append(\", \");\r\n" + " }\r\n" + " buffer.append(iterator.next());\r\n" + " }\r\n" + " buffer.append(\"]\");\r\n" + " return buffer.toString();\r\n" + " }\r\n"
@@ -2018,8 +2019,8 @@ public class GenerateToStringTest extends SourceTestCase {
+ " @Override\r\n"
+ " public String toString() {\r\n"
+ " final int maxLen = 10;\r\n"
- + " return String.format(\"A [AArray=%s, aBool=%s, anA=%s, floatArray=%s, hashMap=%s, intArray=%s, integerCollection=%s, list=%s, object=%s, stringArray=%s, wildCollection=%s, charArrayMethod()=%s, floatArrayMethod()=%s]\", AArray != null ? Arrays.asList(AArray).subList(0, Math.min(AArray.length, maxLen)) : null, aBool, anA, floatArray != null ? Arrays.toString(Arrays.copyOf(floatArray, Math.min(floatArray.length, maxLen))) : null, hashMap != null ? toString(hashMap.entrySet(), maxLen) : null, intArray != null ? Arrays.toString(Arrays.copyOf(intArray, Math.min(intArray.length, maxLen))) : null, integerCollection != null ? toString(integerCollection, maxLen) : null, list != null ? toString(list, maxLen) : null, object, stringArray != null ? Arrays.asList(stringArray).subList(0, Math.min(stringArray.length, maxLen)) : null, wildCollection != null ? toString(wildCollection, maxLen) : null, charArrayMethod() != null ? Arrays.toString(Arrays.copyOf(charArrayMethod(), Math.min(\r\n"
- + " charArrayMethod().length, maxLen))) : null, floatArrayMethod() != null ? Arrays.toString(Arrays.copyOf(floatArrayMethod(), Math.min(floatArrayMethod().length, maxLen))) : null);\r\n"
+ + " return String.format(\"A [AArray=%s, aBool=%s, anA=%s, floatArray=%s, hashMap=%s, intArray=%s, integerCollection=%s, list=%s, object=%s, stringArray=%s, wildCollection=%s, charArrayMethod()=%s, floatArrayMethod()=%s]\", AArray != null ? Arrays.asList(AArray).subList(0, Math.min(AArray.length, maxLen)) : null, aBool, anA, floatArray != null ? Arrays.toString(Arrays.copyOf(floatArray, Math.min(floatArray.length, maxLen))) : null, hashMap != null ? toString(hashMap.entrySet(), maxLen) : null, intArray != null ? Arrays.toString(Arrays.copyOf(intArray, Math.min(intArray.length, maxLen))) : null, integerCollection != null ? toString(integerCollection, maxLen) : null, list != null ? toString(list, maxLen) : null, object, stringArray != null ? Arrays.asList(stringArray).subList(0, Math.min(stringArray.length, maxLen)) : null, wildCollection != null ? toString(wildCollection, maxLen) : null,\r\n"
+ + " charArrayMethod() != null ? Arrays.toString(Arrays.copyOf(charArrayMethod(), Math.min(charArrayMethod().length, maxLen))) : null, floatArrayMethod() != null ? Arrays.toString(Arrays.copyOf(floatArrayMethod(), Math.min(floatArrayMethod().length, maxLen))) : null);\r\n"
+ " }\r\n" + " private String toString(Collection<?> collection, int maxLen) {\r\n" + " StringBuilder builder = new StringBuilder();\r\n" + " builder.append(\"[\");\r\n"
+ " int i = 0;\r\n" + " for (Iterator<?> iterator = collection.iterator(); iterator.hasNext() && i < maxLen; i++) {\r\n" + " if (i > 0) {\r\n" + " builder.append(\", \");\r\n"
+ " }\r\n" + " builder.append(iterator.next());\r\n" + " }\r\n" + " builder.append(\"]\");\r\n" + " return builder.toString();\r\n" + " }\r\n" + " \r\n" + "}\r\n" + "";
diff --git a/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java b/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
index 0a4f72a3e..18ea650f5 100644
--- a/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
+++ b/testplugins/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java
@@ -38,6 +38,7 @@ import org.eclipse.jdt.internal.corext.fix.CleanUpConstants;
import org.eclipse.jdt.ui.JavaElementLabels;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
+
public class CleanUpStressTest extends CleanUpTestCase {
private static final String SRC_CONTAINER= "src";
@@ -233,8 +234,8 @@ public class CleanUpStressTest extends CleanUpTestCase {
buf.append(" }\n");
buf.append("\n");
buf.append(" public static void savePreferences() throws IOException {\n");
- buf.append(" final FileOutputStream fos = new FileOutputStream(BaseTestRunner\n");
- buf.append(" .getPreferencesFile());\n");
+ buf.append(" final FileOutputStream fos = new FileOutputStream(\n");
+ buf.append(" BaseTestRunner.getPreferencesFile());\n");
buf.append(" try {\n");
buf.append(" BaseTestRunner.getPreferences().store(fos, \"\"); //$NON-NLS-1$\n");
buf.append(" } finally {\n");
@@ -492,8 +493,8 @@ public class CleanUpStressTest extends CleanUpTestCase {
buf.append(" }\n");
buf.append("\n");
buf.append(" public void testFilter() {\n");
- buf.append(" Assert.assertEquals(this.fFiltered, BaseTestRunner\n");
- buf.append(" .getFilteredTrace(this.fUnfiltered));\n");
+ buf.append(" Assert.assertEquals(this.fFiltered,\n");
+ buf.append(" BaseTestRunner.getFilteredTrace(this.fUnfiltered));\n");
buf.append(" }\n");
buf.append("}");
fExpectedChangesAllTests.put("junit.tests.runner.StackFilterTest.java", buf.toString());
@@ -3094,8 +3095,8 @@ public class CleanUpStressTest extends CleanUpTestCase {
buf.append(" public ClassLoaderTest() {\n");
buf.append(" }\n");
buf.append(" private boolean isTestCaseClassLoader(final ClassLoader cl) {\n");
- buf.append(" return ((cl != null) && cl.getClass().getName().equals(\n");
- buf.append(" junit.runner.TestCaseClassLoader.class.getName()));\n");
+ buf.append(" return ((cl != null) && cl.getClass().getName()\n");
+ buf.append(" .equals(junit.runner.TestCaseClassLoader.class.getName()));\n");
buf.append(" }\n");
buf.append(" public void verify() {\n");
buf.append(" this.verifyApplicationClassLoadedByTestLoader();\n");
@@ -3410,8 +3411,8 @@ public class CleanUpStressTest extends CleanUpTestCase {
buf.append("\n");
buf.append("public class LoadedFromJar extends Assert {\n");
buf.append(" private boolean isTestCaseClassLoader(final ClassLoader cl) {\n");
- buf.append(" return ((cl != null) && cl.getClass().getName().equals(\n");
- buf.append(" junit.runner.TestCaseClassLoader.class.getName()));\n");
+ buf.append(" return ((cl != null) && cl.getClass().getName()\n");
+ buf.append(" .equals(junit.runner.TestCaseClassLoader.class.getName()));\n");
buf.append(" }\n");
buf.append(" public void verify() {\n");
buf.append(" this.verifyApplicationClassLoadedByTestLoader();\n");
@@ -4167,11 +4168,11 @@ public class CleanUpStressTest extends CleanUpTestCase {
buf.append(" }\n");
buf.append(" Assert.assertTrue((p.waitFor() == 0) == success);\n");
buf.append(" if (success) {\n");
- buf.append(" Assert.assertEquals(junit.textui.TestRunner.SUCCESS_EXIT, p\n");
- buf.append(" .exitValue());\n");
+ buf.append(" Assert.assertEquals(junit.textui.TestRunner.SUCCESS_EXIT,\n");
+ buf.append(" p.exitValue());\n");
buf.append(" } else {\n");
- buf.append(" Assert.assertEquals(junit.textui.TestRunner.FAILURE_EXIT, p\n");
- buf.append(" .exitValue());\n");
+ buf.append(" Assert.assertEquals(junit.textui.TestRunner.FAILURE_EXIT,\n");
+ buf.append(" p.exitValue());\n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("\n");

Back to the top