[230291] remove dead code
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
index 0d3c7cd..73911b3 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
@@ -5387,30 +5387,7 @@
}
}
- /*
- * Ensures that bindings are created when reconciling an external working copy.
- */
- public void test0578() throws CoreException {
- IJavaScriptUnit workingCopy = null;
- try {
- IIncludePathEntry[] classpath = new IIncludePathEntry[] {JavaScriptCore.newLibraryEntry(getConverterJCLPath(), null, null)};
- workingCopy = newExternalWorkingCopy("External.js", classpath, new ProblemRequestor(), "");
-
- String contents =
- "public class External {\n"+
- " /*start*/String foo(){\n"+
- " return \"\";\n" +
- " }/*end*/\n"+
- "}\n";
- IBinding methodBinding = resolveBindings(contents, workingCopy)[0];
- assertBindingEquals(
- "LExternal;.foo()Ljava/lang/String;",
- methodBinding);
- } finally {
- if (workingCopy != null)
- workingCopy.discardWorkingCopy();
- }
- }
+
/*
* Ensures that the start position of an argument that has a previous sibbling with a comment is correct
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
index eaffc07..9ba4940 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
@@ -5450,20 +5450,20 @@
});
}
- /**
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77984
- * @deprecated
- */
- public void test0579() throws JavaScriptModelException {
- IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0579", "ParserTask.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ASTNode result = AST.parseCompilationUnit(sourceUnit, true);
- assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
- JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
- ASTNode node = getASTNode(compilationUnit, 0);
- assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
- TypeDeclaration typeDeclaration = (TypeDeclaration) node;
- assertEquals("Wrong number of body declarations", 3, typeDeclaration.bodyDeclarations().size());
- }
+// /**
+// * https://bugs.eclipse.org/bugs/show_bug.cgi?id=77984
+// * @deprecated
+// */
+// public void test0579() throws JavaScriptModelException {
+// IJavaScriptUnit sourceUnit = getCompilationUnit("Converter", "src", "test0579", "ParserTask.js"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+// ASTNode result = AST.parseCompilationUnit(sourceUnit, true);
+// assertEquals("not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType()); //$NON-NLS-1$
+// JavaScriptUnit compilationUnit = (JavaScriptUnit) result;
+// ASTNode node = getASTNode(compilationUnit, 0);
+// assertEquals("not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); //$NON-NLS-1$
+// TypeDeclaration typeDeclaration = (TypeDeclaration) node;
+// assertEquals("Wrong number of body declarations", 3, typeDeclaration.bodyDeclarations().size());
+// }
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=79953
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
index 7686aed..c85f9d5 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
@@ -21,10 +21,10 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.jsdt.core.IClassFile;
+import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IMember;
-import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.core.ISourceRange;
@@ -34,7 +34,6 @@
import org.eclipse.wst.jsdt.core.dom.AST;
import org.eclipse.wst.jsdt.core.dom.ASTNode;
import org.eclipse.wst.jsdt.core.dom.ASTParser;
-import org.eclipse.wst.jsdt.internal.core.JarPackageFragmentRoot;
/**
* TO DO:
@@ -719,66 +718,66 @@
}
}
-/**
- * Attaches a source zip to a jar. The source zip has
- * a nested root structure and exists as a resource. Tests that
- * the attachment is persisted as a server property for the jar.
- */
-public void testRootPath() throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("AttachSourceTests");
- IFile jar = (IFile) project.getProject().findMember("attach2.jar");
- IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
- JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
- root.attachSource(srcZip.getFullPath(), new Path("src/nested"), null);
-
- IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
- assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
- root.close();
- cf = root.getPackageFragment("x.y").getClassFile("B.class");
- assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
-
- IPath rootSAPath= root.getSourceAttachmentRootPath();
- assertEquals("Unexpected source attachment root path for " + root.getPath(), "src/nested", rootSAPath.toString());
-
- IPath saPath= root.getSourceAttachmentPath();
- assertEquals("Unexpected source attachment path for " + root.getPath(), "/AttachSourceTests/attach2src.zip", saPath.toString());
-
- root.close();
-}
-/**
- * Attaches a source zip to a jar specifying an invalid root path.
- * Ensures that the root path is just used as a hint, and that the source is still retrieved.
- */
-public void testRootPath2() throws JavaScriptModelException {
- IJavaScriptProject project = getJavaProject("AttachSourceTests");
- IFile jar = (IFile) project.getProject().findMember("attach2.jar");
- IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
- JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
- root.attachSource(srcZip.getFullPath(), new Path(""), null);
-
- IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
- assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
- root.close();
-}
-/**
- * Attaches a sa source folder can be attached to a lib folder specifying an invalid root path.
- * Ensures that the root path is just used as a hint, and that the source is still retrieved.
- */
-public void testRootPath3() throws JavaScriptModelException {
- IPackageFragmentRoot root = this.getPackageFragmentRoot("/AttachSourceTests/lib");
- this.attachSource(root, "/AttachSourceTests/srcLib", "invalid");
-
- IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
- assertSourceEquals(
- "Unexpected source for class file",
- "package p;\n" +
- "public class X {\n" +
- " public void foo() {\n" +
- " }\n" +
- "}",
- cf.getSource());
- root.close();
-}
+///**
+// * Attaches a source zip to a jar. The source zip has
+// * a nested root structure and exists as a resource. Tests that
+// * the attachment is persisted as a server property for the jar.
+// */
+//public void testRootPath() throws JavaScriptModelException {
+// IJavaScriptProject project = getJavaProject("AttachSourceTests");
+// IFile jar = (IFile) project.getProject().findMember("attach2.jar");
+// IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
+// JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
+// root.attachSource(srcZip.getFullPath(), new Path("src/nested"), null);
+//
+// IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
+// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
+// root.close();
+// cf = root.getPackageFragment("x.y").getClassFile("B.class");
+// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
+//
+// IPath rootSAPath= root.getSourceAttachmentRootPath();
+// assertEquals("Unexpected source attachment root path for " + root.getPath(), "src/nested", rootSAPath.toString());
+//
+// IPath saPath= root.getSourceAttachmentPath();
+// assertEquals("Unexpected source attachment path for " + root.getPath(), "/AttachSourceTests/attach2src.zip", saPath.toString());
+//
+// root.close();
+//}
+///**
+// * Attaches a source zip to a jar specifying an invalid root path.
+// * Ensures that the root path is just used as a hint, and that the source is still retrieved.
+// */
+//public void testRootPath2() throws JavaScriptModelException {
+// IJavaScriptProject project = getJavaProject("AttachSourceTests");
+// IFile jar = (IFile) project.getProject().findMember("attach2.jar");
+// IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
+// JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
+// root.attachSource(srcZip.getFullPath(), new Path(""), null);
+//
+// IClassFile cf = root.getPackageFragment("x.y").getClassFile("B.class");
+// assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
+// root.close();
+//}
+///**
+// * Attaches a sa source folder can be attached to a lib folder specifying an invalid root path.
+// * Ensures that the root path is just used as a hint, and that the source is still retrieved.
+// */
+//public void testRootPath3() throws JavaScriptModelException {
+// IPackageFragmentRoot root = this.getPackageFragmentRoot("/AttachSourceTests/lib");
+// this.attachSource(root, "/AttachSourceTests/srcLib", "invalid");
+//
+// IClassFile cf = root.getPackageFragment("p").getClassFile("X.class");
+// assertSourceEquals(
+// "Unexpected source for class file",
+// "package p;\n" +
+// "public class X {\n" +
+// " public void foo() {\n" +
+// " }\n" +
+// "}",
+// cf.getSource());
+// root.close();
+//}
/**
* Attach a jar with a source attachement that doesn't contain the source folders
*/
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
index d290a77..08354ad 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
@@ -537,20 +537,20 @@
"U:TT;\n",
type.getTypeParameterSignatures());
}
-
-/**
- * Ensure that the type parameter signatures of a binary method are correct.
- * @deprecated
- */
-public void testParameterTypeSignatures6() throws JavaScriptModelException {
- IType type = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType();
- IFunction method = type.getFunction("foo", new String[] {"TK;", "TV;"});
- assertStringsEqual(
- "Unexpected type parameters",
- "K:Ljava.lang.Object;\n" +
- "V:Ljava.lang.Object;\n",
- method.getTypeParameterSignatures());
-}
+//
+///**
+// * Ensure that the type parameter signatures of a binary method are correct.
+// * @deprecated
+// */
+//public void testParameterTypeSignatures6() throws JavaScriptModelException {
+// IType type = this.jarRoot.getPackageFragment("generic").getClassFile("X.class").getType();
+// IFunction method = type.getFunction("foo", new String[] {"TK;", "TV;"});
+// assertStringsEqual(
+// "Unexpected type parameters",
+// "K:Ljava.lang.Object;\n" +
+// "V:Ljava.lang.Object;\n",
+// method.getTypeParameterSignatures());
+//}
/*
* Ensures that the raw parameter names of a binary method with source attached are correct.
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java
index 89884bb..7cb0b49 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java
@@ -156,41 +156,41 @@
public void testInvalidImportDeclaration3() {
assertEquals("import not reconized as invalid; empty string", IStatus.ERROR, validate("", IMPORT_DECLARATION));
}
- /**
- * Test for package fragment root overlap
- * @deprecated isOverlappingRoots is deprecated
- */
- public void testPackageFragmentRootOverlap() throws Exception {
- try {
- IJavaScriptProject project = this.createJavaProject("P1", new String[] {"src"}, new String[] {"/P1/jclMin.jar"}, "bin");
-
- // ensure the external JCL is copied
- setupExternalJCL("jclMin");
-
- this.copy(new java.io.File(getExternalJCLPathString()), new java.io.File(getWorkspaceRoot().getLocation().toOSString() + java.io.File.separator + "P1" + java.io.File.separator + "jclMin.jar"));
- project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
-
- IPackageFragmentRoot p1Zip= getPackageFragmentRoot("P1", "jclMin.jar");
- IPackageFragmentRoot p1Src= getPackageFragmentRoot("P1", "src");
-
- assertTrue("zip should not overlap source root",
- !JavaScriptConventions.isOverlappingRoots(p1Zip.getUnderlyingResource().getFullPath(), p1Src.getUnderlyingResource().getFullPath()));
-
- this.createJavaProject("P2", new String[] {"src"}, "bin");
-
- IPackageFragmentRoot p2Src= getPackageFragmentRoot("P2", "src");
- assertTrue("source roots in different projects should not overlap ",
- !JavaScriptConventions.isOverlappingRoots(p1Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
-
- assertTrue("The same root should overlap", JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
-
- assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), null));
- assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(null, null));
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
- }
+// /**
+// * Test for package fragment root overlap
+// * @deprecated isOverlappingRoots is deprecated
+// */
+// public void testPackageFragmentRootOverlap() throws Exception {
+// try {
+// IJavaScriptProject project = this.createJavaProject("P1", new String[] {"src"}, new String[] {"/P1/jclMin.jar"}, "bin");
+//
+// // ensure the external JCL is copied
+// setupExternalJCL("jclMin");
+//
+// this.copy(new java.io.File(getExternalJCLPathString()), new java.io.File(getWorkspaceRoot().getLocation().toOSString() + java.io.File.separator + "P1" + java.io.File.separator + "jclMin.jar"));
+// project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+//
+// IPackageFragmentRoot p1Zip= getPackageFragmentRoot("P1", "jclMin.jar");
+// IPackageFragmentRoot p1Src= getPackageFragmentRoot("P1", "src");
+//
+// assertTrue("zip should not overlap source root",
+// !JavaScriptConventions.isOverlappingRoots(p1Zip.getUnderlyingResource().getFullPath(), p1Src.getUnderlyingResource().getFullPath()));
+//
+// this.createJavaProject("P2", new String[] {"src"}, "bin");
+//
+// IPackageFragmentRoot p2Src= getPackageFragmentRoot("P2", "src");
+// assertTrue("source roots in different projects should not overlap ",
+// !JavaScriptConventions.isOverlappingRoots(p1Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
+//
+// assertTrue("The same root should overlap", JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), p2Src.getUnderlyingResource().getFullPath()));
+//
+// assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(p2Src.getUnderlyingResource().getFullPath(), null));
+// assertTrue("isOverLappingRoot does not handle null arguments", !JavaScriptConventions.isOverlappingRoots(null, null));
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// }
+// }
/**
* @see JavaScriptConventions
*/
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java
index ed8f8a9..2ecd1d4 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaModelTests.java
@@ -518,47 +518,6 @@
JavaScriptCore.initializeAfterLoad(null);
}
-/**
- * Ensures that a registered pre-processing resource changed listener is correctly called.
- * @deprecated since using deprecated API
- */
-public void testPreProcessingResourceChangedListener01() throws CoreException {
- final int[] eventType = new int[] {0};
- IResourceChangeListener listener = new IResourceChangeListener(){
- public void resourceChanged(IResourceChangeEvent event) {
- eventType[0] |= event.getType();
- }
- };
- try {
- JavaScriptCore.addPreProcessingResourceChangedListener(listener);
- createProject("Test");
- assertEquals("Unexpected event type", IResourceChangeEvent.POST_CHANGE, eventType[0]);
- } finally {
- JavaScriptCore.removePreProcessingResourceChangedListener(listener);
- deleteProject("Test");
- }
-}
-
-/*
- * Ensures that a registered PRE_BUILD pre-processing resource changed listener is correctly called.
- */
-public void testPreProcessingResourceChangedListener02() throws CoreException {
- final int[] eventType = new int[] {0};
- IResourceChangeListener listener = new IResourceChangeListener(){
- public void resourceChanged(IResourceChangeEvent event) {
- eventType[0] |= event.getType();
- }
- };
- try {
- JavaScriptCore.addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.PRE_BUILD);
- createProject("Test");
- waitForAutoBuild();
- assertEquals("Unexpected event type", IResourceChangeEvent.PRE_BUILD, eventType[0]);
- } finally {
- JavaScriptCore.removePreProcessingResourceChangedListener(listener);
- deleteProject("Test");
- }
-}
/*
* Ensures that a registered POST_BUILD pre-processing resource changed listener is correctly called.
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java
index 8fbbb4f..696a6df 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java
@@ -1081,65 +1081,6 @@
}
}
/*
- * Ensures that an external working copy can be reconciled with no error.
- */
-public void testExternal1() throws CoreException {
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- this.problemRequestor = new ProblemRequestor();
- IIncludePathEntry[] classpath = new IIncludePathEntry[] {JavaScriptCore.newLibraryEntry(getExternalJCLPath(), null, null)};
- this.workingCopy = newExternalWorkingCopy("External.js", classpath, this.problemRequestor,
- "public class External {\n"+
- " String foo(){\n"+
- " return \"\";\n" +
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null/*no owner*/, null);
-
- assertProblems(
- "Unexpected problems",
- "----------\n" +
- "----------\n"
- );
-}
-
-/*
- * Ensures that an external working copy with a container classpath entry can be reconciled with no exception.
- * (regression test for bug 148970 Exceptions opening external Java file)
- */
-public void testExternal2() throws CoreException {
- class LogListener implements ILogListener {
- IStatus log;
- public void logging(IStatus status, String plugin) {
- this.log = status;
- }
- }
- LogListener listener = new LogListener();
- try {
- Platform.addLogListener(listener);
- this.workingCopy.discardWorkingCopy(); // don't use the one created in setUp()
- this.workingCopy = null;
- this.problemRequestor = new ProblemRequestor();
- ContainerInitializer.setInitializer(new ClasspathInitializerTests.DefaultContainerInitializer(new String[] {" ", getExternalJCLPathString()}));
- IIncludePathEntry[] classpath = new IIncludePathEntry[] {
- JavaScriptCore.newContainerEntry(new Path("org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"))
- };
- this.workingCopy = newExternalWorkingCopy("External.js", classpath, this.problemRequestor,
- "public class External {\n"+
- " String foo(){\n"+
- " return \"\";\n" +
- " }\n"+
- "}\n"
- );
- this.workingCopy.reconcile(IJavaScriptUnit.NO_AST, false, null/*no owner*/, null);
- assertEquals("Should not get any exception in log", null, listener.log);
- } finally {
- Platform.removeLogListener(listener);
- }
-}
-
-/*
* Ensures that included part of prereq project are visible
*/
public void testIncludePartOfAnotherProject1() throws CoreException {
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SortCompilationUnitElementsTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SortCompilationUnitElementsTests.java
index af09435..d7d5f41 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SortCompilationUnitElementsTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/SortCompilationUnitElementsTests.java
@@ -14,8 +14,13 @@
import java.util.Comparator;
import junit.framework.Test;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.TextEdit;
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
import org.eclipse.wst.jsdt.core.dom.AST;
@@ -23,13 +28,8 @@
import org.eclipse.wst.jsdt.core.dom.ASTParser;
import org.eclipse.wst.jsdt.core.dom.BodyDeclaration;
import org.eclipse.wst.jsdt.core.dom.EnumConstantDeclaration;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
import org.eclipse.wst.jsdt.core.util.JavaScriptUnitSorter;
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.MalformedTreeException;
-import org.eclipse.text.edits.TextEdit;
/**
*
@@ -64,46 +64,46 @@
this.sortUnit(apiLevel, unit, expectedResult, testPositions, new DefaultJavaElementComparator(1,2,3,4,5,6,7,8,9));
}
/** @deprecated */
-private void oldAPISortUnit(IJavaScriptUnit unit, String expectedResult, boolean testPositions, Comparator comparator) throws CoreException {
- String initialSource = unit.getSource();
- int[] positions = null;
- int[] initialPositions = null;
- ArrayList arrayList = new ArrayList();
- if (testPositions) {
- for (int i = 0; i < initialSource.length(); i++) {
- if (!Character.isWhitespace(initialSource.charAt(i))) {
- arrayList.add(new Integer(i));
- }
- }
- final int length = arrayList.size();
- positions = new int[length];
- for (int i = 0; i < length; i++) {
- positions[i] = ((Integer) arrayList.get(i)).intValue();
- }
- initialPositions = new int[length];
- System.arraycopy(positions, 0, initialPositions, 0, length);
- }
- IJavaScriptUnit copy = unit.getWorkingCopy(null);
- JavaScriptUnitSorter.sort(copy , positions, comparator, 0, new NullProgressMonitor());
- String sortedSource = copy.getBuffer().getContents();
- assertEquals("Different output", expectedResult, sortedSource); //$NON-NLS-1$
- final int expectedResultLength = expectedResult.length();
- if (testPositions) {
- for (int i = 0, max = positions.length; i < max; i++) {
- char mappedChar = ' ';
- char initial = initialSource.charAt(initialPositions[i]);
- try {
- mappedChar = expectedResult.charAt(positions[i]);
- if (mappedChar != initial) {
- System.out.println("wrong mapped positions: " + initialPositions[i] + " <-> " + positions[i] + ": expected " + initial + " but was " + mappedChar); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("wrong mapped positions: " + initialPositions[i] + " <-> " + positions[i], initial, mappedChar); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch(StringIndexOutOfBoundsException e) {
- System.out.println("Out of bounds : (length = " + expectedResultLength + ") " + positions[i]);
- }
- }
- }
-}
+//private void oldAPISortUnit(IJavaScriptUnit unit, String expectedResult, boolean testPositions, Comparator comparator) throws CoreException {
+// String initialSource = unit.getSource();
+// int[] positions = null;
+// int[] initialPositions = null;
+// ArrayList arrayList = new ArrayList();
+// if (testPositions) {
+// for (int i = 0; i < initialSource.length(); i++) {
+// if (!Character.isWhitespace(initialSource.charAt(i))) {
+// arrayList.add(new Integer(i));
+// }
+// }
+// final int length = arrayList.size();
+// positions = new int[length];
+// for (int i = 0; i < length; i++) {
+// positions[i] = ((Integer) arrayList.get(i)).intValue();
+// }
+// initialPositions = new int[length];
+// System.arraycopy(positions, 0, initialPositions, 0, length);
+// }
+// IJavaScriptUnit copy = unit.getWorkingCopy(null);
+// JavaScriptUnitSorter.sort(copy , positions, comparator, 0, new NullProgressMonitor());
+// String sortedSource = copy.getBuffer().getContents();
+// assertEquals("Different output", expectedResult, sortedSource); //$NON-NLS-1$
+// final int expectedResultLength = expectedResult.length();
+// if (testPositions) {
+// for (int i = 0, max = positions.length; i < max; i++) {
+// char mappedChar = ' ';
+// char initial = initialSource.charAt(initialPositions[i]);
+// try {
+// mappedChar = expectedResult.charAt(positions[i]);
+// if (mappedChar != initial) {
+// System.out.println("wrong mapped positions: " + initialPositions[i] + " <-> " + positions[i] + ": expected " + initial + " but was " + mappedChar); //$NON-NLS-1$ //$NON-NLS-2$
+// assertEquals("wrong mapped positions: " + initialPositions[i] + " <-> " + positions[i], initial, mappedChar); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+// } catch(StringIndexOutOfBoundsException e) {
+// System.out.println("Out of bounds : (length = " + expectedResultLength + ") " + positions[i]);
+// }
+// }
+// }
+//}
private void sortUnit(int apiLevel, IJavaScriptUnit unit, String expectedResult, boolean testPositions, Comparator comparator) throws CoreException {
String initialSource = unit.getSource();
@@ -1841,46 +1841,46 @@
this.deleteFile("/P/src/X.js");
}
}
-//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101453
-/** @deprecated */
-public void test028() throws CoreException {
- try {
- this.createFile(
- "/P/src/X.js",
- "public final class X\n" +
- "{\n" +
- "/** JavaDoc comment2 */\n" +
- "int j;\n" +
- "/** JavaDoc comment1 */\n" +
- "int i;\n" +
- "}"
- );
- String expectedResult =
- "public final class X\n" +
- "{\n" +
- "/** JavaDoc comment1 */\n" +
- "int i;\n" +
- "/** JavaDoc comment2 */\n" +
- "int j;\n" +
- "}";
- oldAPISortUnit(this.getCompilationUnit("/P/src/X.js"), expectedResult, false, new Comparator() {
- public int compare(Object o1, Object o2) {
- BodyDeclaration bodyDeclaration1 = (BodyDeclaration) o1;
- BodyDeclaration bodyDeclaration2 = (BodyDeclaration) o2;
- JSdoc javadoc1 = bodyDeclaration1.getJavadoc();
- JSdoc javadoc2 = bodyDeclaration2.getJavadoc();
- if (javadoc1 != null && javadoc2 != null) {
- return javadoc1.getComment().compareTo(javadoc2.getComment());
- }
- final int sourceStart1 = ((Integer) bodyDeclaration1.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
- final int sourceStart2 = ((Integer) bodyDeclaration2.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
- return sourceStart1 - sourceStart2;
- }
- });
- } finally {
- this.deleteFile("/P/src/X.js");
- }
-}
+////https://bugs.eclipse.org/bugs/show_bug.cgi?id=101453
+///** @deprecated */
+//public void test028() throws CoreException {
+// try {
+// this.createFile(
+// "/P/src/X.js",
+// "public final class X\n" +
+// "{\n" +
+// "/** JavaDoc comment2 */\n" +
+// "int j;\n" +
+// "/** JavaDoc comment1 */\n" +
+// "int i;\n" +
+// "}"
+// );
+// String expectedResult =
+// "public final class X\n" +
+// "{\n" +
+// "/** JavaDoc comment1 */\n" +
+// "int i;\n" +
+// "/** JavaDoc comment2 */\n" +
+// "int j;\n" +
+// "}";
+// oldAPISortUnit(this.getCompilationUnit("/P/src/X.js"), expectedResult, false, new Comparator() {
+// public int compare(Object o1, Object o2) {
+// BodyDeclaration bodyDeclaration1 = (BodyDeclaration) o1;
+// BodyDeclaration bodyDeclaration2 = (BodyDeclaration) o2;
+// JSdoc javadoc1 = bodyDeclaration1.getJavadoc();
+// JSdoc javadoc2 = bodyDeclaration2.getJavadoc();
+// if (javadoc1 != null && javadoc2 != null) {
+// return javadoc1.getComment().compareTo(javadoc2.getComment());
+// }
+// final int sourceStart1 = ((Integer) bodyDeclaration1.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
+// final int sourceStart2 = ((Integer) bodyDeclaration2.getProperty(JavaScriptUnitSorter.RELATIVE_ORDER)).intValue();
+// return sourceStart1 - sourceStart2;
+// }
+// });
+// } finally {
+// this.deleteFile("/P/src/X.js");
+// }
+//}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=101885
public void test029() throws CoreException {
try {
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyOwnerTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyOwnerTests.java
index 7490189..55c288c 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyOwnerTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyOwnerTests.java
@@ -1016,25 +1016,6 @@
TypeDeclaration type = (TypeDeclaration) ast.types().get(0);
assertNull("Unexpected binding", type.resolveBinding());
}
-
- /*
- * Ensures that a new working copy with no resource can be committed (its buffer is saved).
- */
- public void testNewWorkingCopy08() throws CoreException {
- WorkingCopyOwner owner = new WorkingCopyOwner() {
- public IBuffer createBuffer(IJavaScriptUnit wc) {
- IBuffer buffer = new TestBuffer(wc);
- buffer.setContents(
- "public class X {\n" +
- "}"
- );
- return buffer;
- }
- };
- this.workingCopy = owner.newWorkingCopy("X.js", null/*no classpath*/, null/*no problem requestor*/, null/*no progress monitor*/);
- this.workingCopy.commitWorkingCopy(true, null);
- assertFalse("Should not have unsaved changes", this.workingCopy.hasUnsavedChanges());
- }
/*
* Ensures that a Java project named " " doesn't exist if a working copy with no resource is created.