Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

This commit was manufactured by cvs2svn to create tag 'v200809102023'.

  • Loading branch information...
commit b54a846b163fa8891394b9a341b8cc232f403661 1 parent 9dcdbe2
nitind authored
Showing with 0 additions and 92,397 deletions.
  1. +0 −7 tests/org.eclipse.wst.jsdt.core.tests.model/.classpath
  2. +0 −2  tests/org.eclipse.wst.jsdt.core.tests.model/.cvsignore
  3. +0 −28 tests/org.eclipse.wst.jsdt.core.tests.model/.project
  4. +0 −4 tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs
  5. +0 −7 tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs
  6. +0 −24 tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF
  7. +0 −28 tests/org.eclipse.wst.jsdt.core.tests.model/about.html
  8. +0 −18 tests/org.eclipse.wst.jsdt.core.tests.model/build.properties
  9. +0 −19 tests/org.eclipse.wst.jsdt.core.tests.model/plugin.properties
  10. +0 −67 tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml
  11. +0 −32 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunBuilderTests.java
  12. +0 −60 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java
  13. +0 −32 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunDOMTests.java
  14. +0 −61 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunFormatterTests.java
  15. +0 −34 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunJDTCoreTests.java
  16. +0 −32 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunModelTests.java
  17. +0 −6,174 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverter15Test.java
  18. +0 −9,798 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java
  19. +0 −525 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java
  20. +0 −3,413 .../org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java
  21. +0 −954 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java
  22. +0 −9,960 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java
  23. +0 −5,462 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
  24. +0 −8,701 ...s/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
  25. +0 −1,202 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java
  26. +0 −1,459 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTModelBridgeTests.java
  27. +0 −260 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTNodesCollectorVisitor.java
  28. +0 −116 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTParserTest.java
  29. +0 −152 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTPositionsTest.java
  30. +0 −348 ...rg.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTStructuralPropertyTest.java
  31. +0 −7,681 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTTest.java
  32. +0 −2,071 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTVisitorTest.java
  33. +0 −502 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/AbstractASTTests.java
  34. +0 −2,058 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BatchASTCreationTests.java
  35. +0 −448 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/BindingsCollectorVisitor.java
  36. +0 −787 .../org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/CompatibilityRulesTests.java
  37. +0 −612 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ConverterTestSetup.java
  38. +0 −29 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/GetKeyVisitor.java
  39. +0 −430 ...g.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ProfilingASTConvertionTest.java
  40. +0 −69 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunAllTests.java
  41. +0 −67 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/RunConverterTests.java
  42. +0 −289 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/SampleASTs.java
  43. +0 −155 ...wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/DecodeCodeFormatterPreferences.java
  44. +0 −9,222 ...lipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java
  45. +0 −193 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentFormatterUtil.java
  46. +0 −114 ...clipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentTestCase.java
  47. +0 −31 ...ipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/CommentsTestSuite.java
  48. +0 −703 ...clipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/JavaDocTestCase.java
  49. +0 −217 ...ipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/MultiLineTestCase.java
  50. +0 −225 ...pse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/comment/SingleLineTestCase.java
  51. +0 −167 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelCompletionTests.java
  52. +0 −2,358 ...org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaModelTests.java
  53. +0 −116 ...pse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchGenericTests.java
  54. +0 −631 ...rg.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavaSearchTests.java
  55. +0 −500 ...wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AbstractJavadocCompletionModelTest.java
  56. +0 −1,036 ...rg.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AccessRestrictionsTests.java
  57. +0 −251 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AllJavaModelTests.java
  58. +0 −1,141 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachSourceTests.java
  59. +0 −509 ...s/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/AttachedJavadocTests.java
  60. +0 −495 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BindingKeyTests.java
  61. +0 −544 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/BufferTests.java
  62. +0 −31 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CancelCounter.java
  63. +0 −34 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/Canceler.java
  64. +0 −936 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassFileTests.java
  65. +0 −1,169 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClassNameTests.java
  66. +0 −1,320 ....eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathInitializerTests.java
  67. +0 −3,929 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ClasspathTests.java
  68. +0 −801 tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java
  69. +0 −118 ...lipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTestsRequestor.java
  70. +0 −1,429 ...s/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java
Sorry, we could not display the entire diff because too many files (4,076) changed.
View
7 tests/org.eclipse.wst.jsdt.core.tests.model/.classpath
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
2  tests/org.eclipse.wst.jsdt.core.tests.model/.cvsignore
@@ -1,2 +0,0 @@
-build.xml
-javaCompiler...args
View
28 tests/org.eclipse.wst.jsdt.core.tests.model/.project
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.jsdt.core.tests.model</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
4 tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.core.resources.prefs
@@ -1,4 +0,0 @@
-#Mon Jan 28 15:47:49 CST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
-instance/org.eclipse.core.net/org.eclipse.core.net.hasMigrated=true
View
7 tests/org.eclipse.wst.jsdt.core.tests.model/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +0,0 @@
-#Tue Apr 17 15:48:57 CDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
View
24 tests/org.eclipse.wst.jsdt.core.tests.model/META-INF/MANIFEST.MF
@@ -1,24 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.wst.jsdt.core.tests.model; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.jsdt.core.tests,
- org.eclipse.wst.jsdt.core.tests.dom,
- org.eclipse.wst.jsdt.core.tests.formatter,
- org.eclipse.wst.jsdt.core.tests.formatter.comment,
- org.eclipse.wst.jsdt.core.tests.model,
- org.eclipse.wst.jsdt.core.tests.rewrite.describing,
- org.eclipse.wst.jsdt.core.tests.rewrite.modifying
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.junit;bundle-version="[3.8.2,4.0.0)",
- org.eclipse.wst.jsdt.core.tests.compiler;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.team.core;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.text;bundle-version="[3.4.0,4.0.0)",
- com.ibm.icu;bundle-version="[3.8.1,4.0.0)",
- org.eclipse.wst.jsdt.core;bundle-version="[1.0.0,2.0.0)"
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
View
28 tests/org.eclipse.wst.jsdt.core.tests.model/about.html
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 2, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
View
18 tests/org.eclipse.wst.jsdt.core.tests.model/build.properties
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2007 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
-###############################################################################
-bin.includes = plugin.xml,\
- workspace/,\
- .,\
- test.xml,\
- plugin.properties,\
- META-INF/,\
- about.html
-source.. = src/
View
19 tests/org.eclipse.wst.jsdt.core.tests.model/plugin.properties
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2008 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
-###############################################################################
-
-#
-# Messages in plugin.xml.
-#
-pluginName=JSDT Tests - Model
-providerName=Eclipse.org
-
-JsGlobalScopeVariableInitializer.deprecated.0 = Test deprecated flag
-JsGlobalScopeVariableInitializer.deprecated.1 = A deprecated and read-only initializer
View
67 tests/org.eclipse.wst.jsdt.core.tests.model/plugin.xml
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!-- Classpath variable initializer -->
- <extension point = "org.eclipse.wst.jsdt.core.JsGlobalScopeVariableInitializer">
- <JsGlobalScopeVariableInitializer
- variable="TEST_LIB"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- variable="TEST_SRC"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- variable="TEST_ROOT"
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"/>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- deprecated="%JsGlobalScopeVariableInitializer.deprecated.0"
- variable="TEST_DEPRECATED">
- </JsGlobalScopeVariableInitializer>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- readOnly="true"
- variable="TEST_READ_ONLY">
- </JsGlobalScopeVariableInitializer>
- <JsGlobalScopeVariableInitializer
- class="org.eclipse.wst.jsdt.core.tests.model.VariablesInitializer"
- deprecated="%JsGlobalScopeVariableInitializer.deprecated.1"
- readOnly="true"
- variable="TEST_DEPRECATED_READ_ONLY">
- </JsGlobalScopeVariableInitializer>
- </extension>
-
- <!-- Classpath container initializer -->
- <extension point = "org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer">
- <JsGlobalScopeContainerInitializer
- id="org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER"
- class="org.eclipse.wst.jsdt.core.tests.model.ContainerInitializer"/>
- </extension>
-
- <!-- Extra Java-like file extensions -->
- <extension point="org.eclipse.core.runtime.contentTypes">
- <file-association
- content-type="org.eclipse.wst.jsdt.core.javaSource"
- file-extensions="foo,bar"/>
- </extension>
-
- <!-- Repository provider -->
- <extension point="org.eclipse.team.core.repository">
- <repository
- id="org.eclipse.wst.jsdt.core.tests.model.pessimisticnature"
- class="org.eclipse.wst.jsdt.core.tests.model.TestPessimisticProvider">
- </repository>;
- </extension>
-
- <!-- Compilation participant -->
- <extension point="org.eclipse.wst.jsdt.core.validationParticipant">
- <validationParticipant
- class="org.eclipse.wst.jsdt.core.tests.model.TestvalidationParticipant"
- createsProblems="true"
- id="org.eclipse.wst.jsdt.core.tests.model.validationParticipant"
- requiredSourceLevel="1.4"
- modifiesEnvironment="true">
- <requires id="non.existing"/>
- </validationParticipant>
- </extension>
-
-</plugin>
View
32 ...clipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunBuilderTests.java
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-//import org.eclipse.wst.jsdt.core.tests.builder.BuilderTests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Runs all Java builder tests.
- */
-public class RunBuilderTests extends TestCase {
-public RunBuilderTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunBuilderTests.class.getName());
- //suite.addTest(BuilderTests.suite());
- return suite;
-}
-}
-
View
60 ...lipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunCompilerTests.java
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Runs all compiler tests (including parser tests and evaluation tests) in all compliance mode.
- * Use -Dcompliance=1.4 as a VM argument if you want to run in 1.4 compliance mode only.
- * See AbstractCompilerTests for more details.
- */
-public class RunCompilerTests extends TestCase {
-
-public RunCompilerTests(String name) {
- super(name);
-}
-public static Class[] getAllTestClasses() {
- return new Class[] {
- org.eclipse.wst.jsdt.core.tests.compiler.regression.TestAll.class,
- org.eclipse.wst.jsdt.core.tests.compiler.parser.TestAll.class,
-// org.eclipse.wst.jsdt.core.tests.eval.TestAll.class,
- };
-}
-public static Test suite() {
- TestSuite ts = new TestSuite(RunCompilerTests.class.getName());
-
- Class[] testClasses = getAllTestClasses();
- for (int i = 0; i < testClasses.length; i++) {
- Class testClass = testClasses[i];
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
-}
-}
-
View
32 ...rg.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunDOMTests.java
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.dom.RunAllTests;
-
-/**
- * Runs all DOM AST tests.
- */
-public class RunDOMTests extends TestCase {
-
-public RunDOMTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunDOMTests.class.getName());
- suite.addTest(RunAllTests.suite());
- return suite;
-}
-}
View
61 ...ipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunFormatterTests.java
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.formatter.FormatterRegressionTests;
-import org.eclipse.wst.jsdt.core.tests.formatter.comment.CommentsTestSuite;
-
-/**
- * Runs all formatter tests.
- */
-public class RunFormatterTests extends TestCase {
-
- public static Class[] getAllTestClasses() {
- return new Class[] {
- FormatterRegressionTests.class,
- CommentsTestSuite.class,
- };
- }
- public static Test suite() {
- TestSuite ts = new TestSuite(RunFormatterTests.class.getName());
-
- Class[] testClasses = getAllTestClasses();
- for (int i = 0; i < testClasses.length; i++) {
- Class testClass = testClasses[i];
-
- // call the suite() method and add the resulting suite to the suite
- try {
- Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
- Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
- ts.addTest(suite);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.getTargetException().printStackTrace();
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- return ts;
- }
-
-public RunFormatterTests(String name) {
- super(name);
-}
-}
-
View
34 ...clipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunJDTCoreTests.java
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Runs all JDT Core tests.
- */
-public class RunJDTCoreTests extends TestCase {
-public RunJDTCoreTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunJDTCoreTests.class.getName());
- //suite.addTest(RunBuilderTests.suite());
- suite.addTest(RunCompilerTests.suite());
- suite.addTest(RunDOMTests.suite());
- suite.addTest(RunFormatterTests.suite());
- suite.addTest(RunModelTests.suite());
- return suite;
-}
-}
-
View
32 ....eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/RunModelTests.java
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.jsdt.core.tests.model.AllJavaModelTests;
-
-/**
- * Runs all Java model tests.
- */
-public class RunModelTests extends TestCase {
-public RunModelTests(String name) {
- super(name);
-}
-public static Test suite() {
- TestSuite suite = new TestSuite(RunModelTests.class.getName());
- suite.addTest(AllJavaModelTests.suite());
- return suite;
-}
-}
-
View
6,174 ...wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverter15Test.java
0 additions, 6,174 deletions not shown
View
9,798 ...t.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterAST3Test.java
0 additions, 9,798 deletions not shown
View
525 ...dt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterBindingsTest.java
@@ -1,525 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptProject;
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.IPackageFragment;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.CastExpression;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.IBinding;
-import org.eclipse.wst.jsdt.core.dom.IFunctionBinding;
-import org.eclipse.wst.jsdt.core.dom.IPackageBinding;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.IVariableBinding;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.InstanceofExpression;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.ListExpression;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
-import org.eclipse.wst.jsdt.core.dom.TypeLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-
-public class ASTConverterBindingsTest extends ConverterTestSetup {
- private static final boolean DEBUG = false;
-
- static class BindingsCollector extends ASTVisitor {
-
- public ArrayList arrayList;
-
- BindingsCollector() {
- // visit Javadoc.tags() as well
- super(true);
- this.arrayList = new ArrayList();
- }
-
- private void collectBindings(
- ASTNode node,
- IBinding binding) {
-
- if (binding != null) {
- arrayList.add(binding);
- }
- }
-
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(AnonymousClassDeclaration)
- */
- public void endVisit(AnonymousClassDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayAccess)
- */
- public void endVisit(ArrayAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayCreation)
- */
- public void endVisit(ArrayCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayInitializer)
- */
- public void endVisit(ArrayInitializer node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ArrayType)
- */
- public void endVisit(ArrayType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(Assignment)
- */
- public void endVisit(Assignment node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(BooleanLiteral)
- */
- public void endVisit(BooleanLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(CastExpression)
- */
- public void endVisit(CastExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(CharacterLiteral)
- */
- public void endVisit(CharacterLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ClassInstanceCreation)
- */
- public void endVisit(ClassInstanceCreation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConditionalExpression)
- */
- public void endVisit(ConditionalExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ConstructorInvocation)
- */
- public void endVisit(ConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FieldAccess)
- */
- public void endVisit(FieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ImportDeclaration)
- */
- public void endVisit(ImportDeclaration node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InfixExpression)
- */
- public void endVisit(InfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(InstanceofExpression)
- */
- public void endVisit(InstanceofExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- public void endVisit(ListExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(MemberRef)
- * @since 3.0
- */
- public void endVisit(MemberRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionDeclaration)
- */
- public void endVisit(FunctionDeclaration node) {
- IFunctionBinding methodBinding = node.resolveBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(FunctionInvocation)
- */
- public void endVisit(FunctionInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see ASTVisitor#endVisit(FunctionRef )
- * @since 3.0
- */
- public void endVisit(FunctionRef node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NullLiteral)
- */
- public void endVisit(NullLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(NumberLiteral)
- */
- public void endVisit(NumberLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PackageDeclaration)
- */
- public void endVisit(PackageDeclaration node) {
- IPackageBinding packageBinding = node.resolveBinding();
- collectBindings(node, packageBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ParameterizedType)
- * @since 3.0
- */
- public void endVisit(ParameterizedType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ParenthesizedExpression)
- */
- public void endVisit(ParenthesizedExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PostfixExpression)
- */
- public void endVisit(PostfixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrefixExpression)
- */
- public void endVisit(PrefixExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(PrimitiveType)
- */
- public void endVisit(PrimitiveType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(QualifiedName)
- */
- public void endVisit(QualifiedName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleName)
- */
- public void endVisit(SimpleName node) {
- IBinding binding = node.resolveBinding();
- collectBindings(node, binding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SimpleType)
- */
- public void endVisit(SimpleType node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SingleVariableDeclaration)
- */
- public void endVisit(SingleVariableDeclaration node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(StringLiteral)
- */
- public void endVisit(StringLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperConstructorInvocation)
- */
- public void endVisit(SuperConstructorInvocation node) {
- IFunctionBinding methodBinding = node.resolveConstructorBinding();
- collectBindings(node, methodBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperFieldAccess)
- */
- public void endVisit(SuperFieldAccess node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(SuperMethodInvocation)
- */
- public void endVisit(SuperMethodInvocation node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(ThisExpression)
- */
- public void endVisit(ThisExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeDeclaration)
- */
- public void endVisit(TypeDeclaration node) {
- ITypeBinding typeBinding = node.resolveBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(TypeLiteral)
- */
- public void endVisit(TypeLiteral node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationExpression)
- */
- public void endVisit(VariableDeclarationExpression node) {
- ITypeBinding typeBinding = node.resolveTypeBinding();
- collectBindings(node, typeBinding);
- }
-
- /**
- * @see org.eclipse.wst.jsdt.core.dom.ASTVisitor#endVisit(VariableDeclarationFragment)
- */
- public void endVisit(VariableDeclarationFragment node) {
- IVariableBinding variableBinding = node.resolveBinding();
- collectBindings(node, variableBinding);
- }
-
- public List getBindings() {
- return arrayList;
- }
-
- }
-
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public ASTConverterBindingsTest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return buildModelTestSuite(ASTConverterBindingsTest.class);
- }
-
- public void test0001() throws JavaScriptModelException {
- checkBindingEqualityForProject("Converter");
- checkBindingEqualityForProject("Converter15");
- }
-
- /**
- * @throws JavaScriptModelException
- */
- private void checkBindingEqualityForProject(String projectName) throws JavaScriptModelException {
- IJavaScriptProject javaProject = getJavaProject(projectName);
- IPackageFragment[] packageFragments = javaProject.getPackageFragments();
- ArrayList compilationUnitscollector = new ArrayList();
- for (int j = 0, max2 = packageFragments.length; j < max2; j++) {
- IJavaScriptUnit[] units = packageFragments[j].getJavaScriptUnits();
- if (units != null) {
- for (int k = 0, max3 = units.length; k < max3; k++) {
- compilationUnitscollector.add(units[k]);
- }
- }
- }
- final int length = compilationUnitscollector.size();
- IJavaScriptUnit[] units = new IJavaScriptUnit[length];
- compilationUnitscollector.toArray(units);
- long totalTime = 0;
- for (int j = 0; j < length; j++) {
- IJavaScriptUnit currentUnit = units[j];
- ASTNode result = runConversion(AST.JLS3, currentUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- JavaScriptUnit unit = (JavaScriptUnit) result;
- result = runConversion(AST.JLS3, currentUnit, true);
- assertEquals("Not a compilation unit", ASTNode.JAVASCRIPT_UNIT, result.getNodeType());
- if (DEBUG) {
- if (unit.types().size() > 0 ) {
- AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) unit.types().get(0);
- StringBuffer buffer = new StringBuffer();
- PackageDeclaration packageDeclaration = unit.getPackage();
- if (packageDeclaration != null) {
- buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName());
- } else {
- buffer.append(typeDeclaration.getName());
- }
- System.out.println(String.valueOf(buffer));
- } else {
- System.out.println(currentUnit.getElementName());
- }
- }
- JavaScriptUnit unit2 = (JavaScriptUnit) result;
- BindingsCollector collector = new BindingsCollector();
- unit.accept(collector);
- List bindings1 = collector.getBindings();
- BindingsCollector collector2 = new BindingsCollector();
- unit2.accept(collector2);
- List bindings2 = collector2.getBindings();
- assertEquals("Wrong size", bindings1.size(), bindings2.size());
- long time = System.currentTimeMillis();
- for (int i = 0, max = bindings1.size(); i < max; i++) {
- final Object object = bindings1.get(i);
- assertTrue("not a binding", object instanceof IBinding);
- final IBinding binding = (IBinding) object;
- final Object object2 = bindings2.get(i);
- assertTrue("not a binding", object2 instanceof IBinding);
- final IBinding binding2 = (IBinding) object2;
- final boolean equalTo = binding.isEqualTo(binding2);
- assertTrue("not equals", equalTo);
- }
- totalTime += (System.currentTimeMillis() - time);
- }
- if (DEBUG) {
- System.out.println("Total time = " + totalTime + "ms");
- }
- }
-}
View
3,413 ...sdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterJavadocTest.java
0 additions, 3,413 deletions not shown
View
954 ...dt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterRecoveryTest.java
@@ -1,954 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 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
- *******************************************************************************/
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
-import org.eclipse.wst.jsdt.core.JavaScriptModelException;
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.AssertStatement;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.ITypeBinding;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.wst.jsdt.core.dom.VariableDeclarationExpression;
-
-public class ASTConverterRecoveryTest extends ConverterTestSetup {
- public ASTConverterRecoveryTest(String name) {
- super(name);
- }
-
- static {
-// TESTS_NAMES = new String[] {"test0003"};
-// TESTS_NUMBERS = new int[] { 624 };
- }
- public static Test suite() {
- return buildModelTestSuite(ASTConverterRecoveryTest.class);
- }
-
- public void setUpSuite() throws Exception {
- super.setUpSuite();
- this.ast = AST.newAST(AST.JLS3);
- }
-
- public void test0001() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(0)\n"+
- " baz(1);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(0);\n" +
- " baz(1);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(0)", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "bar(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "baz(1);", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "baz(1)", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding2 = parameter2.resolveTypeBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter2, "1", source); //$NON-NLS-1$
- }
-
- public void test0002() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " baz(0);\n"+
- " bar(1,\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " baz(0);\n" +
- " bar(1);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "bar(1", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "bar(1", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 1); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding2 = parameter2.resolveTypeBinding();
- assertNotNull("No binding", typeBinding2); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding2.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter2, "1", source); //$NON-NLS-1$
- }
-
- public void test0003() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " baz(0);\n"+
- " bar(1,\n"+
- " foo(3);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " baz(0);\n" +
- " bar(1,foo(3));\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "baz(0);", source); //$NON-NLS-1$
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation) expression;
- checkSourceRange(methodInvocation, "baz(0)", source); //$NON-NLS-1$
- List list = methodInvocation.arguments();
- assertTrue("Parameter list is empty", list.size() == 1); //$NON-NLS-1$
- Expression parameter = (Expression) list.get(0);
- assertTrue("Not a number", parameter instanceof NumberLiteral); //$NON-NLS-1$
- ITypeBinding typeBinding = parameter.resolveTypeBinding();
- assertNotNull("No binding", typeBinding); //$NON-NLS-1$
- assertEquals("Not int", "int", typeBinding.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- checkSourceRange(parameter, "0", source); //$NON-NLS-1$
- Statement statement2 = (Statement) statements.get(1);
- assertTrue("Not an expression statement", statement2.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement2 = (ExpressionStatement) statement2;
- checkSourceRange(expressionStatement2, "bar(1,\n\t foo(3);", source); //$NON-NLS-1$
- Expression expression2 = expressionStatement2.getExpression();
- assertTrue("Not a method invocation", expression2.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) expression2;
- checkSourceRange(methodInvocation2, "bar(1,\n\t foo(3)", source); //$NON-NLS-1$
- List list2 = methodInvocation2.arguments();
- assertTrue("Parameter list is empty", list2.size() == 2); //$NON-NLS-1$
- Expression parameter2 = (Expression) list2.get(0);
- assertTrue("Not a Number", parameter2 instanceof NumberLiteral); //$NON-NLS-1$
- parameter2 = (Expression) list2.get(1);
- assertTrue("Not a method invocation", parameter2 instanceof FunctionInvocation); //$NON-NLS-1$
- FunctionInvocation methodInvocation3 = (FunctionInvocation) parameter2;
- checkSourceRange(methodInvocation3, "foo(3)", source); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=124296
- public void test0004() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " int var= 123\n"+
- " System.out.println(var);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int var=123;\n" +
- " System.out.println(var);\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 2, statements.size()); //$NON-NLS-1$
- Statement statement1 = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement1.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement1;
- checkSourceRange(variableDeclarationStatement, "int var= 123", source); //$NON-NLS-1$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(variableDeclarationFragment, "var= 123", source); //$NON-NLS-1$
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126148
- public void test0005() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " String[] s = {\"\",,,};\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " String[] s={\"\",$missing$};\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- Block block = methodDeclaration.getBody();
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement1 = (Statement) statements.get(0);
- assertTrue("Not an expression variable declaration statement", statement1.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement1;
- checkSourceRange(variableDeclarationStatement, "String[] s = {\"\",,,};", source); //$NON-NLS-1$
- List fragments = variableDeclarationStatement.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment variableDeclarationFragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(variableDeclarationFragment, "s = {\"\",,,}", source); //$NON-NLS-1$
- Expression expression = variableDeclarationFragment.getInitializer();
- assertTrue("Not an array initializer", expression.getNodeType() == ASTNode.ARRAY_INITIALIZER); //$NON-NLS-1$
- ArrayInitializer arrayInitializer = (ArrayInitializer) expression;
- checkSourceRange(arrayInitializer, "{\"\",,,}", source); //$NON-NLS-1$
- List expressions = arrayInitializer.expressions();
- assertEquals("wrong size", 2, expressions.size()); //$NON-NLS-1$
- Expression expression1 = (Expression) expressions.get(0);
- assertTrue("Not a string literal", expression1.getNodeType() == ASTNode.STRING_LITERAL); //$NON-NLS-1$
- StringLiteral stringLiteral = (StringLiteral) expression1;
- checkSourceRange(stringLiteral, "\"\"", source); //$NON-NLS-1$
- Expression expression2 = (Expression) expressions.get(1);
- assertTrue("Not a string literal", expression2.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) expression2;
- checkSourceRange(simpleName, ",", source); //$NON-NLS-1$
-
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0006() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar()\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0007() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz()\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz()", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) != 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0008() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " for(int i\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " for (int i; ; ) ;\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Not flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a for statement", statement.getNodeType() == ASTNode.FOR_STATEMENT); //$NON-NLS-1$
- ForStatement forStatement = (ForStatement) statement;
- checkSourceRange(forStatement, "for(int i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (forStatement.getFlags() & ASTNode.RECOVERED) != 0);
- List initializers = forStatement.initializers();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Expression expression = (Expression)initializers.get(0);
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.VARIABLE_DECLARATION_EXPRESSION); //$NON-NLS-1$
- VariableDeclarationExpression variableDeclarationExpression = (VariableDeclarationExpression)expression;
- checkSourceRange(variableDeclarationExpression, "int i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (variableDeclarationExpression.getFlags() & ASTNode.RECOVERED) != 0);
- List fragments = variableDeclarationExpression.fragments();
- assertEquals("wrong size", 1, fragments.size()); //$NON-NLS-1$
- VariableDeclarationFragment fragment = (VariableDeclarationFragment)fragments.get(0);
- checkSourceRange(fragment, "i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (fragment.getFlags() & ASTNode.RECOVERED) != 0);
- SimpleName name = fragment.getName();
- checkSourceRange(name, "i", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (name.getFlags() & ASTNode.RECOVERED) == 0);
- Statement statement2 = forStatement.getBody();
- assertTrue("Not an empty statement", statement2.getNodeType() == ASTNode.EMPTY_STATEMENT); //$NON-NLS-1$
- EmptyStatement emptyStatement = (EmptyStatement)statement2;
- checkSourceRange(emptyStatement, "i", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (emptyStatement.getFlags() & ASTNode.RECOVERED) != 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0009() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz());#\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Not flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz());", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz())", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0010() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz())#;\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz())#;", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz())", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (remove tokens)
- public void test0011() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar(baz()#);\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar(baz());\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar(baz()#);", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar(baz()#)", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) != 0);
- List arguments = methodInvocation.arguments();
- assertEquals("wrong size", 1, arguments.size()); //$NON-NLS-1$
- Expression argument = (Expression) arguments.get(0);
- assertTrue("Not a method invocation", argument.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation2 = (FunctionInvocation) argument;
- checkSourceRange(methodInvocation2, "baz()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation2.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // check RECOVERED flag (insert tokens)
- public void test0012() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " bar()#\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " bar();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "bar()#", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not a method invocation", expression.getNodeType() == ASTNode.FUNCTION_INVOCATION); //$NON-NLS-1$
- FunctionInvocation methodInvocation = (FunctionInvocation)expression;
- checkSourceRange(methodInvocation, "bar()", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (methodInvocation.getFlags() & ASTNode.RECOVERED) == 0);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129555
- public void test0013() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " a[0]\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " a[0]=$missing$;\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) != 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an expression statement", statement.getNodeType() == ASTNode.EXPRESSION_STATEMENT); //$NON-NLS-1$
- ExpressionStatement expressionStatement = (ExpressionStatement) statement;
- checkSourceRange(expressionStatement, "a[0]", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (expressionStatement.getFlags() & ASTNode.RECOVERED) != 0);
- Expression expression = expressionStatement.getExpression();
- assertTrue("Not an assigment", expression.getNodeType() == ASTNode.ASSIGNMENT); //$NON-NLS-1$
- Assignment assignment = (Assignment)expression;
- checkSourceRange(assignment, "a[0]", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (assignment.getFlags() & ASTNode.RECOVERED) != 0);
- Expression rhs = assignment.getRightHandSide();
- assertTrue("Not a simple name", rhs.getNodeType() == ASTNode.SIMPLE_NAME); //$NON-NLS-1$
- SimpleName simpleName = (SimpleName) rhs;
- assertEquals("Not length isn't correct", 0, simpleName.getLength()); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=129909
- public void test0014() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " int[] = a[0];\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " int[] $missing$=a[0];\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not a variable declaration statement", statement.getNodeType() == ASTNode.VARIABLE_DECLARATION_STATEMENT); //$NON-NLS-1$
- VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement) statement;
- checkSourceRange(variableDeclarationStatement, "int[] = a[0];", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (variableDeclarationStatement.getFlags() & ASTNode.RECOVERED) != 0);
- List fragments = variableDeclarationStatement.fragments();
- VariableDeclarationFragment fragment = (VariableDeclarationFragment) fragments.get(0);
- SimpleName simpleName = fragment.getName();
- assertEquals("Not length isn't correct", 0, simpleName.getLength()); //$NON-NLS-1$
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0015() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : a[0;\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : a[0];\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an assert statement", statement.getNodeType() == ASTNode.ASSERT_STATEMENT); //$NON-NLS-1$
- AssertStatement assertStatement = (AssertStatement) statement;
- checkSourceRange(assertStatement, "assert 0 == 0 : a[0;", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (assertStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression message = assertStatement.getMessage();
- assertTrue("No message expression", message != null); //$NON-NLS-1$
- checkSourceRange(message, "a[0", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (message.getFlags() & ASTNode.RECOVERED) != 0);
- }
-
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0016() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : foo(;\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : foo();\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an assert statement", statement.getNodeType() == ASTNode.ASSERT_STATEMENT); //$NON-NLS-1$
- AssertStatement assertStatement = (AssertStatement) statement;
- checkSourceRange(assertStatement, "assert 0 == 0 : foo(;", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (assertStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression message = assertStatement.getMessage();
- assertTrue("No message expression", message != null); //$NON-NLS-1$
- checkSourceRange(message, "foo(", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (message.getFlags() & ASTNode.RECOVERED) != 0);
- }
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=143212
- public void test0017() throws JavaScriptModelException {
- this.workingCopies = new IJavaScriptUnit[1];
- this.workingCopies[0] = getWorkingCopy(
- "/Converter/src/test/X.js",
- "package test;\n"+
- "\n"+
- "public class X {\n"+
- " void foo() {\n"+
- " assert 0 == 0 : (\"aa\";\n"+
- " }\n"+
- "}\n");
-
- char[] source = this.workingCopies[0].getSource().toCharArray();
- ASTNode result = runConversion(AST.JLS3, this.workingCopies[0], true, true);
-
- assertASTNodeEquals(
- "package test;\n" +
- "public class X {\n" +
- " void foo(){\n" +
- " assert 0 == 0 : (\"aa\");\n" +
- " }\n" +
- "}\n",
- result);
-
- ASTNode node = getASTNode((JavaScriptUnit) result, 0, 0);
- assertNotNull(node);
- assertTrue("Not a method declaration", node.getNodeType() == ASTNode.FUNCTION_DECLARATION); //$NON-NLS-1$
- FunctionDeclaration methodDeclaration = (FunctionDeclaration) node;
- assertTrue("Flag as RECOVERED", (methodDeclaration.getFlags() & ASTNode.RECOVERED) == 0);
- Block block = methodDeclaration.getBody();
- assertTrue("Flag as RECOVERED", (block.getFlags() & ASTNode.RECOVERED) == 0);
- List statements = block.statements();
- assertEquals("wrong size", 1, statements.size()); //$NON-NLS-1$
- Statement statement = (Statement) statements.get(0);
- assertTrue("Not an assert statement", statement.getNodeType() == ASTNode.ASSERT_STATEMENT); //$NON-NLS-1$
- AssertStatement assertStatement = (AssertStatement) statement;
- checkSourceRange(assertStatement, "assert 0 == 0 : (\"aa\";", source); //$NON-NLS-1$
- assertTrue("Flag as RECOVERED", (assertStatement.getFlags() & ASTNode.RECOVERED) == 0);
- Expression message = assertStatement.getMessage();
- assertTrue("No message expression", message != null); //$NON-NLS-1$
- checkSourceRange(message, "(\"aa\"", source); //$NON-NLS-1$
- assertTrue("Not flag as RECOVERED", (message.getFlags() & ASTNode.RECOVERED) != 0);
- }
-}
View
9,960 ...e.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest.java
0 additions, 9,960 deletions not shown
View
5,462 ....wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTest2.java
0 additions, 5,462 deletions not shown
View
8,701 ...jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTConverterTestAST3_2.java
0 additions, 8,701 deletions not shown
View
1,202 ...pse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/dom/ASTMatcherTest.java
@@ -1,1202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 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
- *******************************************************************************/
-
-package org.eclipse.wst.jsdt.core.tests.dom;
-
-import java.lang.reflect.Method;
-
-import junit.framework.Test;
-
-import org.eclipse.wst.jsdt.core.dom.AST;
-import org.eclipse.wst.jsdt.core.dom.ASTMatcher;
-import org.eclipse.wst.jsdt.core.dom.ASTNode;
-import org.eclipse.wst.jsdt.core.dom.ASTVisitor;
-import org.eclipse.wst.jsdt.core.dom.AnonymousClassDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
-import org.eclipse.wst.jsdt.core.dom.ArrayCreation;
-import org.eclipse.wst.jsdt.core.dom.ArrayInitializer;
-import org.eclipse.wst.jsdt.core.dom.ArrayType;
-import org.eclipse.wst.jsdt.core.dom.AssertStatement;
-import org.eclipse.wst.jsdt.core.dom.Assignment;
-import org.eclipse.wst.jsdt.core.dom.Block;
-import org.eclipse.wst.jsdt.core.dom.BlockComment;
-import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
-import org.eclipse.wst.jsdt.core.dom.BreakStatement;
-import org.eclipse.wst.jsdt.core.dom.CastExpression;
-import org.eclipse.wst.jsdt.core.dom.CatchClause;
-import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
-import org.eclipse.wst.jsdt.core.dom.ClassInstanceCreation;
-import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
-import org.eclipse.wst.jsdt.core.dom.ConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.ContinueStatement;
-import org.eclipse.wst.jsdt.core.dom.DoStatement;
-import org.eclipse.wst.jsdt.core.dom.EmptyStatement;
-import org.eclipse.wst.jsdt.core.dom.EnhancedForStatement;
-import org.eclipse.wst.jsdt.core.dom.Expression;
-import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
-import org.eclipse.wst.jsdt.core.dom.FieldAccess;
-import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ForStatement;
-import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
-import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
-import org.eclipse.wst.jsdt.core.dom.FunctionRef;
-import org.eclipse.wst.jsdt.core.dom.FunctionRefParameter;
-import org.eclipse.wst.jsdt.core.dom.IfStatement;
-import org.eclipse.wst.jsdt.core.dom.ImportDeclaration;
-import org.eclipse.wst.jsdt.core.dom.InfixExpression;
-import org.eclipse.wst.jsdt.core.dom.Initializer;
-import org.eclipse.wst.jsdt.core.dom.JSdoc;
-import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
-import org.eclipse.wst.jsdt.core.dom.LabeledStatement;
-import org.eclipse.wst.jsdt.core.dom.LineComment;
-import org.eclipse.wst.jsdt.core.dom.MemberRef;
-import org.eclipse.wst.jsdt.core.dom.Modifier;
-import org.eclipse.wst.jsdt.core.dom.Name;
-import org.eclipse.wst.jsdt.core.dom.NullLiteral;
-import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
-import org.eclipse.wst.jsdt.core.dom.PackageDeclaration;
-import org.eclipse.wst.jsdt.core.dom.ParameterizedType;
-import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
-import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
-import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
-import org.eclipse.wst.jsdt.core.dom.QualifiedName;
-import org.eclipse.wst.jsdt.core.dom.QualifiedType;
-import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
-import org.eclipse.wst.jsdt.core.dom.SimpleName;
-import org.eclipse.wst.jsdt.core.dom.SimpleType;
-import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
-import org.eclipse.wst.jsdt.core.dom.Statement;
-import org.eclipse.wst.jsdt.core.dom.StringLiteral;
-import org.eclipse.wst.jsdt.core.dom.SuperConstructorInvocation;
-import org.eclipse.wst.jsdt.core.dom.SuperFieldAccess;
-import org.eclipse.wst.jsdt.core.dom.SuperMethodInvocation;
-import org.eclipse.wst.jsdt.core.dom.SwitchCase;
-import org.eclipse.wst.jsdt.core.dom.SwitchStatement;
-import org.eclipse.wst.jsdt.core.dom.TagElement;
-import org.eclipse.wst.jsdt.core.dom.TextElement;
-import org.eclipse.wst.jsdt.core.dom.ThisExpression;
-import org.eclipse.wst.jsdt.core.dom.ThrowStatement;