diff options
author | Dani Megert | 2014-05-22 16:24:58 +0000 |
---|---|---|
committer | Dani Megert | 2014-05-22 16:24:58 +0000 |
commit | a59514bdede8ac8d9eeade9287a87e4c90792124 (patch) | |
tree | 55813f7ec9f7e4b23c3fd6105af3c6692403b14d | |
parent | 747fb42f4bc1f71c2bb6fc16ceffec0a8cf788d9 (diff) | |
download | eclipse.jdt.debug-a59514bdede8ac8d9eeade9287a87e4c90792124.tar.gz eclipse.jdt.debug-a59514bdede8ac8d9eeade9287a87e4c90792124.tar.xz eclipse.jdt.debug-a59514bdede8ac8d9eeade9287a87e4c90792124.zip |
Fixed tests for bug 434695: Hot Code Replace drops some frames in case of anonymous classesR4_4M20140820-1200M20140820-0800M20140813-0800M20140806-0900M20140731-1200M20140730-0800M20140723-0800M20140716-0800M20140709-0800I20140606-1215I20140605-1635I20140604-2000I20140603-2300I20140603-2000I20140602-2000I20140601-2000I20140531-1500I20140530-2000I20140528-2000I20140528-0930I20140528-0830I20140528-0800I20140528-0115I20140527-2300I20140527-2000I20140526-2000I20140525-2000I20140524-1500I20140523-2000I20140522-1330I20140522-1230
-rw-r--r-- | org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java | 8 | ||||
-rw-r--r-- | org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java | 15 |
2 files changed, 12 insertions, 11 deletions
diff --git a/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java b/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java index 92ae2c417..c5ceacc46 100644 --- a/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java +++ b/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) May 24, 2013 IBM Corporation and others. + * Copyright (c) May 24, 2013, 2014 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 @@ -21,7 +21,7 @@ public class HcrClass3 { String s = new String("Constructor"); Anon aclass = new Anon() { public void run() { - String s = new String("Anon#run()"); + String s = new String("TEST_RUN3"); } }; aclass.run(); @@ -31,7 +31,7 @@ public class HcrClass3 { String s = new String("HcrClass3#run()"); Anon aclass = new Anon() { public void run() { - String s = new String("Anon#run()"); + String s = new String("TEST_RUN1"); } }; aclass.run(); @@ -41,7 +41,7 @@ public class HcrClass3 { String s = new String("HcrClass3#run2()"); Anon aclass = new Anon() { public void run() { - String s = new String("Anon#run()"); + String s = new String("TEST_RUN2"); } }; aclass.run(); diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java index ca79304e0..c4fe44ae4 100644 --- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java +++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2014 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 @@ -477,15 +477,16 @@ public class HcrTests extends AbstractDebugTest { assertTrue("HcrClass3.java does not exist", cu.exists()); IBuffer buffer = cu.getBuffer(); String contents = buffer.getContents(); - int index = contents.indexOf("\"Anon#run()\""); + int index = contents.indexOf("\"TEST_RUN1\""); assertTrue("Could not find code to replace", index > 0); - String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12); + String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11); buffer.setContents(newCode); DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND); cu.commitWorkingCopy(true, null); waitForBuild(); thread = (IJavaThread) waiter.waitForEvent(); + assertNotNull("Thread did not suspend after HCR", thread); assertTrue("Listener should have been notified", listener.waitNotification()); assertNotNull("HCR should have not failed", listener.target); assertTrue("the thread should be suspended again after the HCR", thread.isSuspended()); @@ -529,9 +530,9 @@ public class HcrTests extends AbstractDebugTest { assertTrue("HcrClass3.java does not exist", cu.exists()); IBuffer buffer = cu.getBuffer(); String contents = buffer.getContents(); - int index = contents.indexOf("\"Anon#run()\""); + int index = contents.indexOf("\"TEST_RUN2\""); assertTrue("Could not find code to replace", index > 0); - String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12); + String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11); buffer.setContents(newCode); DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND); @@ -581,9 +582,9 @@ public class HcrTests extends AbstractDebugTest { assertTrue("HcrClass3.java does not exist", cu.exists()); IBuffer buffer = cu.getBuffer(); String contents = buffer.getContents(); - int index = contents.indexOf("\"Anon#run()\""); + int index = contents.indexOf("\"TEST_RUN3\""); assertTrue("Could not find code to replace", index > 0); - String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12); + String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11); buffer.setContents(newCode); DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND); |