Skip to content

Commit

Permalink
Fix UnresolvedMethodsQuickFixTest
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed Nov 16, 2023
1 parent d8d2f84 commit 7ccd9cc
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.core.manipulation.CodeTemplateContextType;
import org.eclipse.jdt.internal.core.manipulation.StubUtility;
import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager;
import org.junit.Before;
import org.junit.Ignore;
Expand All @@ -42,6 +44,10 @@ public void setup() throws Exception {

fJProject1.setOptions(options);

StubUtility.setCodeTemplate(CodeTemplateContextType.CATCHBLOCK_ID, "", null);
StubUtility.setCodeTemplate(CodeTemplateContextType.CONSTRUCTORSTUB_ID, "", null);
StubUtility.setCodeTemplate(CodeTemplateContextType.METHODSTUB_ID, "", null);

fSourceFolder = fJProject1.getPackageFragmentRoot(fJProject1.getProject().getFolder("src"));
}

Expand Down Expand Up @@ -2631,9 +2637,9 @@ public void testParameterMismatchMoreArguments3() throws Exception {
buf.append("\n");
buf.append("public class X {\n");
buf.append(" /**\n");
buf.append(" * @param emptySet\n");
buf.append(" * @param emptySet \n");
buf.append(" * @param i The int value\n");
buf.append(" * @param k\n");
buf.append(" * @param k \n");
buf.append(" */\n");
buf.append(" public void xoo(Set emptySet, int i, int k) {\n");
buf.append(" int j= 0;\n");
Expand Down Expand Up @@ -2870,7 +2876,6 @@ public void testConstructorInvocationMoreArguments() throws Exception {
buf.append(" this(new Vector());\n");
buf.append(" }\n");
buf.append(" public E(Vector vector) {\n");
buf.append(" //TODO Auto-generated constructor stub\n");
buf.append(" }\n");
buf.append("}\n");
Expected e3 = new Expected("Create constructor 'E(Vector)'", buf.toString());
Expand Down Expand Up @@ -2917,7 +2922,7 @@ public void testConstructorInvocationMoreArguments2() throws Exception {
buf.append("public class E {\n");
buf.append(" /**\n");
buf.append(" * My favourite constructor.\n");
buf.append(" * @param vector\n");
buf.append(" * @param vector \n");
buf.append(" */\n");
buf.append(" public E(Vector vector) {\n");
buf.append(" }\n");
Expand All @@ -2940,7 +2945,6 @@ public void testConstructorInvocationMoreArguments2() throws Exception {
buf.append(" this(new Vector());\n");
buf.append(" }\n");
buf.append(" public E(Vector vector) {\n");
buf.append(" //TODO Auto-generated constructor stub\n");
buf.append(" }\n");
buf.append("}\n");
Expected e3 = new Expected("Create constructor 'E(Vector)'", buf.toString());
Expand Down Expand Up @@ -3248,7 +3252,6 @@ public void testSuperConstructor() throws Exception {
buf.append("public class A {\n");
buf.append("\n");
buf.append(" public A(int i) {\n");
buf.append(" //TODO Auto-generated constructor stub\n");
buf.append(" }\n");
buf.append("}\n");
Expected e2 = new Expected("Create constructor 'A(int)'", buf.toString());
Expand Down Expand Up @@ -3476,7 +3479,6 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti
buf.append(" }\n");
buf.append("\n");
buf.append(" public A(int i, String valueOf, boolean b) {\n");
buf.append(" //TODO Auto-generated constructor stub\n");
buf.append(" }\n");
buf.append("}\n");
Expected e3 = new Expected("Create constructor 'A<T>(int, String, boolean)'", buf.toString());
Expand Down Expand Up @@ -3528,7 +3530,6 @@ public void testClassInstanceCreationLessArguments() throws Exception {
buf.append(" }\n");
buf.append("\n");
buf.append(" public A() {\n");
buf.append(" //TODO Auto-generated constructor stub\n");
buf.append(" }\n");
buf.append("}\n");
Expected e3 = new Expected("Create constructor 'A()'", buf.toString());
Expand Down

0 comments on commit 7ccd9cc

Please sign in to comment.