Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2006-04-18 18:41:59 +0000
committernitind2006-04-18 18:41:59 +0000
commita60c10d23e201e27110ff20d88f253eed8f186ef (patch)
tree6907cae48e6a9625e1f521a70e603880f94b684d /tests/org.eclipse.wst.html.core.tests/src/org/eclipse
parentc595c0c255d8f8ed469583ba4dd5c0332740da9f (diff)
downloadwebtools.sourceediting.tests-a60c10d23e201e27110ff20d88f253eed8f186ef.tar.gz
webtools.sourceediting.tests-a60c10d23e201e27110ff20d88f253eed8f186ef.tar.xz
webtools.sourceediting.tests-a60c10d23e201e27110ff20d88f253eed8f186ef.zip
This commit was manufactured by cvs2svn to create tag 'v200604181942'.v200604181942
Diffstat (limited to 'tests/org.eclipse.wst.html.core.tests/src/org/eclipse')
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestSuite.java47
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestsPlugin.java68
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/Logger.java144
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/ModelParserTests.java133
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLCorePreferencesTest.java164
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLTagInfoTest.java118
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/BUG124835SetStyleAttributeValueTest.java80
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/GetOverrideStyleTest.java57
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/ModelModifications.java304
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/TestForNPEInCSSCreation.java91
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AllModelParserTests.java152
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest.java50
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest2.java77
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest3.java67
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest.java64
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest2.java74
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest3.java74
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/DocTypeTest.java71
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest.java85
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest2.java70
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest3.java78
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest.java76
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest2.java79
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest3.java60
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest.java60
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest2.java62
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest3.java82
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest4.java78
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest5.java63
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest6.java63
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest7.java53
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest8.java53
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest9.java63
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ModelTest.java291
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NodeListTest.java142
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NullInputStream.java69
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/PITest.java70
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest.java102
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest2.java93
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest3.java89
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest4.java84
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest.java112
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest2.java115
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest3.java93
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest.java87
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest2.java79
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest3.java81
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest4.java79
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest5.java94
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest6.java65
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest7.java66
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest8.java66
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TableTest.java85
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest.java61
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest2.java61
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest3.java106
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest.java105
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest10.java112
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest11.java62
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest12.java64
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest13.java66
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest14.java58
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest15.java64
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest2.java77
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest3.java69
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest4.java62
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest5.java63
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest6.java67
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest7.java62
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest8.java60
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest9.java61
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTestRegionChanged.java73
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/css/StyleTest.java75
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/TestStructuredPartitionerHTML.java319
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example01.html5
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example02.html14
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example03.html8
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/CommonXML.java86
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/DateUtil.java46
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/FileUtil.java193
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/StringCompareUtil.java71
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestRuntimeException.java81
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestWriter.java26
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TimestampUtil.java51
-rw-r--r--tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/WorkspaceProgressMonitor.java54
85 files changed, 0 insertions, 7204 deletions
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestSuite.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestSuite.java
deleted file mode 100644
index 430952c01..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestSuite.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.html.core.tests.misc.HTMLCorePreferencesTest;
-import org.eclipse.wst.html.core.tests.misc.HTMLTagInfoTest;
-import org.eclipse.wst.html.core.tests.model.BUG124835SetStyleAttributeValueTest;
-import org.eclipse.wst.html.core.tests.model.GetOverrideStyleTest;
-import org.eclipse.wst.html.core.tests.model.ModelModifications;
-import org.eclipse.wst.html.core.tests.model.TestForNPEInCSSCreation;
-
-
-
-public class HTMLCoreTestSuite extends TestSuite {
-
- /**
- * to get picked up by BVT
- *
- * @return
- */
- public static Test suite() {
- return new HTMLCoreTestSuite();
- }
-
- public HTMLCoreTestSuite() {
- super("HTML Core TestSuite");
-
- addTest(ModelParserTests.suite());
- addTest(new TestSuite(HTMLCorePreferencesTest.class));
- addTest(new TestSuite(HTMLTagInfoTest.class));
- addTest(new TestSuite(ModelModifications.class));
- addTest(new TestSuite(TestForNPEInCSSCreation.class));
- addTest(new TestSuite(GetOverrideStyleTest.class));
- addTest(new TestSuite(BUG124835SetStyleAttributeValueTest.class));
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestsPlugin.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestsPlugin.java
deleted file mode 100644
index b37c006d3..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/HTMLCoreTestsPlugin.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class HTMLCoreTestsPlugin extends Plugin {
- //The shared instance.
- private static HTMLCoreTestsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public HTMLCoreTestsPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.html.core.tests.SSEModelHTMLTestsPluginResources");
- }
- catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * Returns the shared instance.
- */
- public static HTMLCoreTestsPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = HTMLCoreTestsPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- }
- catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/Logger.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/Logger.java
deleted file mode 100644
index 212b6f446..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/Logger.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-/**
- * Small convenience class to log messages to plugin's log file and also, if desired,
- * the console. This class should only be used by classes in this plugin. Other
- * plugins should make their own copy, with appropriate ID.
- */
-public class Logger {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.core.tests"; //$NON-NLS-1$
-
- private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$
-
- public static final int OK = IStatus.OK; // 0
- public static final int INFO = IStatus.INFO; // 1
- public static final int WARNING = IStatus.WARNING; // 2
- public static final int ERROR = IStatus.ERROR; // 4
-
- public static final int OK_DEBUG = 200 + OK;
- public static final int INFO_DEBUG = 200 + INFO;
- public static final int WARNING_DEBUG = 200 + WARNING;
- public static final int ERROR_DEBUG = 200 + ERROR;
-
- /**
- * Adds message to log.
- * @param level severity level of the message (OK, INFO, WARNING, ERROR, OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG)
- * @param message text to add to the log
- * @param exception exception thrown
- */
- protected static void _log(int level, String message, Throwable exception) {
- if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) {
- if (!isDebugging())
- return;
- }
-
- int severity = IStatus.OK;
- switch (level) {
- case INFO_DEBUG :
- case INFO :
- severity = IStatus.INFO;
- break;
- case WARNING_DEBUG :
- case WARNING :
- severity = IStatus.WARNING;
- break;
- case ERROR_DEBUG :
- case ERROR :
- severity = IStatus.ERROR;
- }
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
-
- /**
- * Prints message to log if category matches /debug/tracefilter option.
- * @param message text to print
- * @param category category of the message, to be compared with /debug/tracefilter
- */
- protected static void _trace(String category, String message, Throwable exception) {
- if (isTracing(category)) {
- message = (message != null) ? message : "null"; //$NON-NLS-1$
- Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- if (bundle != null)
- Platform.getLog(bundle).log(statusObj);
- }
- }
-
- /**
- * @return true if the platform is debugging
- */
- public static boolean isDebugging() {
- return Platform.inDebugMode();
- }
-
- /**
- * Determines if currently tracing a category
- * @param category
- * @return true if tracing category, false otherwise
- */
- public static boolean isTracing(String category) {
- if (!isDebugging())
- return false;
-
- String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
- if (traceFilter != null) {
- StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String cat = tokenizer.nextToken().trim();
- if (category.equals(cat)) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void log(int level, String message) {
- _log(level, message, null);
- }
-
- public static void log(int level, String message, Throwable exception) {
- _log(level, message, exception);
- }
-
- public static void logException(String message, Throwable exception) {
- _log(ERROR, message, exception);
- }
-
- public static void logException(Throwable exception) {
- _log(ERROR, exception.getMessage(), exception);
- }
-
- public static void traceException(String category, String message, Throwable exception) {
- _trace(category, message, exception);
- }
-
- public static void traceException(String category, Throwable exception) {
- _trace(category, exception.getMessage(), exception);
- }
-
- public static void trace(String category, String message) {
- _trace(category, message, null);
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/ModelParserTests.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/ModelParserTests.java
deleted file mode 100644
index 0652a53f1..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/ModelParserTests.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.html.core.tests.parser.AttrTest;
-import org.eclipse.wst.html.core.tests.parser.AttrTest2;
-import org.eclipse.wst.html.core.tests.parser.CDATASectionTest;
-import org.eclipse.wst.html.core.tests.parser.CDATASectionTest2;
-import org.eclipse.wst.html.core.tests.parser.CDATASectionTest3;
-import org.eclipse.wst.html.core.tests.parser.DocTypeTest;
-import org.eclipse.wst.html.core.tests.parser.ElementTest;
-import org.eclipse.wst.html.core.tests.parser.ElementTest2;
-import org.eclipse.wst.html.core.tests.parser.ElementTest3;
-import org.eclipse.wst.html.core.tests.parser.EmptyTextTest;
-import org.eclipse.wst.html.core.tests.parser.EmptyTextTest2;
-import org.eclipse.wst.html.core.tests.parser.EmptyTextTest3;
-import org.eclipse.wst.html.core.tests.parser.EntityTest;
-import org.eclipse.wst.html.core.tests.parser.EntityTest2;
-import org.eclipse.wst.html.core.tests.parser.EntityTest3;
-import org.eclipse.wst.html.core.tests.parser.EntityTest4;
-import org.eclipse.wst.html.core.tests.parser.EntityTest5;
-import org.eclipse.wst.html.core.tests.parser.EntityTest6;
-import org.eclipse.wst.html.core.tests.parser.EntityTest7;
-import org.eclipse.wst.html.core.tests.parser.EntityTest8;
-import org.eclipse.wst.html.core.tests.parser.EntityTest9;
-import org.eclipse.wst.html.core.tests.parser.PITest;
-import org.eclipse.wst.html.core.tests.parser.ParserTest;
-import org.eclipse.wst.html.core.tests.parser.ParserTest2;
-import org.eclipse.wst.html.core.tests.parser.ParserTest3;
-import org.eclipse.wst.html.core.tests.parser.ParserTest4;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest2;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest3;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest4;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest5;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest6;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest7;
-import org.eclipse.wst.html.core.tests.parser.SplitTextTest8;
-import org.eclipse.wst.html.core.tests.parser.TableTest;
-import org.eclipse.wst.html.core.tests.parser.TextTest;
-import org.eclipse.wst.html.core.tests.parser.TextTest2;
-import org.eclipse.wst.html.core.tests.parser.TextTest3;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest10;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest11;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest12;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest13;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest14;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest2;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest3;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest4;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest5;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest6;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest7;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest8;
-import org.eclipse.wst.html.core.tests.parser.UpdaterTest9;
-
-
-
-public class ModelParserTests extends TestSuite {
- public static Test suite() {
- return new ModelParserTests();
- }
-
- public ModelParserTests() {
- super("ModelParserTests");
-
- addTest(new TestSuite(ParserTest.class, "ParserTest"));
- addTest(new TestSuite(ParserTest2.class, "ParserTest2"));
- addTest(new TestSuite(ParserTest3.class, "ParserTest3"));
- addTest(new TestSuite(ParserTest4.class, "ParserTest4"));
- addTest(new TestSuite(UpdaterTest.class, "UpdaterTest"));
- addTest(new TestSuite(UpdaterTest2.class, "UpdaterTest2"));
- addTest(new TestSuite(UpdaterTest3.class, "UpdaterTest3"));
- addTest(new TestSuite(UpdaterTest4.class, "UpdaterTest4"));
- addTest(new TestSuite(UpdaterTest5.class, "UpdaterTest5"));
- addTest(new TestSuite(UpdaterTest6.class, "UpdaterTest6"));
- addTest(new TestSuite(UpdaterTest7.class, "UpdaterTest7"));
- addTest(new TestSuite(UpdaterTest8.class, "UpdaterTest8"));
- addTest(new TestSuite(UpdaterTest9.class, "UpdaterTest9"));
- addTest(new TestSuite(UpdaterTest10.class, "UpdaterTest10"));
- addTest(new TestSuite(UpdaterTest11.class, "UpdaterTest11"));
- addTest(new TestSuite(UpdaterTest12.class, "UpdaterTest12"));
- addTest(new TestSuite(UpdaterTest13.class, "UpdaterTest13"));
- addTest(new TestSuite(UpdaterTest14.class, "UpdaterTest14"));
- addTest(new TestSuite(ElementTest.class, "ElementTest"));
- addTest(new TestSuite(ElementTest2.class, "ElementTest2"));
- addTest(new TestSuite(ElementTest3.class, "ElementTest3"));
- addTest(new TestSuite(TableTest.class, "TableTest"));
- addTest(new TestSuite(TextTest.class, "TextTest"));
- addTest(new TestSuite(TextTest2.class, "TextTest2"));
- addTest(new TestSuite(TextTest3.class, "TextTest3"));
- addTest(new TestSuite(SplitTextTest.class, "SplitTextTest"));
- addTest(new TestSuite(SplitTextTest2.class, "SplitTextTest2"));
- addTest(new TestSuite(SplitTextTest3.class, "SplitTextTest3"));
- addTest(new TestSuite(SplitTextTest4.class, "SplitTextTest4"));
- addTest(new TestSuite(SplitTextTest5.class, "SplitTextTest5"));
- addTest(new TestSuite(SplitTextTest6.class, "SplitTextTest6"));
- addTest(new TestSuite(SplitTextTest7.class, "SplitTextTest7"));
- addTest(new TestSuite(SplitTextTest8.class, "SplitTextTest8"));
- addTest(new TestSuite(EmptyTextTest.class, "EmptyTextTest"));
- addTest(new TestSuite(EmptyTextTest2.class, "EmptyTextTest2"));
- addTest(new TestSuite(EmptyTextTest3.class, "EmptyTextTest3"));
- addTest(new TestSuite(AttrTest.class, "AttrTest"));
- addTest(new TestSuite(AttrTest2.class, "AttrTest2"));
- addTest(new TestSuite(EntityTest.class, "EntityTest"));
- addTest(new TestSuite(EntityTest2.class, "EntityTest2"));
- addTest(new TestSuite(EntityTest3.class, "EntityTest3"));
- addTest(new TestSuite(EntityTest4.class, "EntityTest4"));
- addTest(new TestSuite(EntityTest5.class, "EntityTest5"));
- addTest(new TestSuite(EntityTest6.class, "EntityTest6"));
- addTest(new TestSuite(EntityTest7.class, "EntityTest7"));
- addTest(new TestSuite(EntityTest8.class, "EntityTest8"));
- addTest(new TestSuite(EntityTest9.class, "EntityTest9"));
- addTest(new TestSuite(DocTypeTest.class, "DocTypeTest"));
- addTest(new TestSuite(CDATASectionTest.class, "CDATASectionTest"));
- addTest(new TestSuite(CDATASectionTest2.class, "CDATASectionTest2"));
- addTest(new TestSuite(CDATASectionTest3.class, "CDATASectionTest3"));
- addTest(new TestSuite(PITest.class, "PITest"));
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLCorePreferencesTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLCorePreferencesTest.java
deleted file mode 100644
index 59276fc4f..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLCorePreferencesTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.html.core.tests.misc;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.html.core.internal.HTMLCorePlugin;
-import org.eclipse.wst.html.core.internal.encoding.HTMLDocumentLoader;
-import org.eclipse.wst.html.core.internal.preferences.HTMLCorePreferenceNames;
-import org.eclipse.wst.html.core.internal.provisional.contenttype.ContentTypeIdForHTML;
-import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames;
-import org.eclipse.wst.sse.core.internal.encoding.ContentBasedPreferenceGateway;
-import org.eclipse.wst.sse.core.internal.encoding.ContentTypeEncodingPreferences;
-import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * The purpose of this test is to verify the validity of the HTML Source
- * editor preferences. Tests include setting/getting preferences.
- *
- * NOTE: This test should be preformed on a clean workspace. If performed on
- * an existing workspace, this test will manipulate preferences in the
- * workspace, though attempts will be made to restore original values after
- * testing.
- */
-public class HTMLCorePreferencesTest extends TestCase {
- /**
- * Tests existance of preference values when getting preference values
- * through Platform.getPreferencesService()
- */
- public void testBundleGetPreferences() {
- final String bundleName = "org.eclipse.wst.html.core";
-
- // need to start up bundle for default values to be loaded
- Bundle bundle = Platform.getBundle(bundleName);
- try {
- if (bundle != null)
- bundle.start();
- else
- fail("Get preference value failed because could not find bundle: " + bundleName);
- }
- catch (BundleException e) {
- fail("Get preference value failed because of exception starting bundle: " + bundleName + " exception: " + e);
- }
-
- bundleGetPreference(bundleName, HTMLCorePreferenceNames.TAG_NAME_CASE);
- bundleGetPreference(bundleName, HTMLCorePreferenceNames.ATTR_NAME_CASE);
- }
-
- private void bundleGetPreference(String bundleName, String prefKey) {
- int defaultValue = -1;
-
- int value = Platform.getPreferencesService().getInt(bundleName, prefKey, defaultValue, null);
- assertTrue("Get preference value failed using Platform.getPreferencesService. Key: " + prefKey, defaultValue != value);
- }
-
- /**
- * Tests default values of preferences.
- *
- * NOTE: Expected default values are hard-coded, so if default values do
- * get changed, assertions need to be updated as well
- */
- public void testPluginGetDefaultPreferences() {
- IEclipsePreferences node = new DefaultScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
- pluginGetDefaultPreference(node, HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS, Boolean.toString(false));
- pluginGetDefaultPreference(node, HTMLCorePreferenceNames.ATTR_NAME_CASE, Integer.toString(HTMLCorePreferenceNames.LOWER));
- }
-
- private void pluginGetDefaultPreference(IEclipsePreferences node, String prefKey, String expected) {
- String defaultValue = Long.toString(System.currentTimeMillis()); // random
- // string
-
- String theDefaultValue = node.get(prefKey, defaultValue);
- assertEquals("Get default preference value failed using plugin.getPreferenceStore. Key: " + prefKey, expected, theDefaultValue);
- }
-
- /**
- * Tests setting preference values by setting preference value to be a
- * certain value, then getting the preference value to verify it was set.
- */
- public void testPluginSetPreferences() {
- IEclipsePreferences node = new InstanceScope().getNode(HTMLCorePlugin.getDefault().getBundle().getSymbolicName());
-
- pluginSetPreferenceBoolean(node, HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS);
- pluginSetPreferenceString(node, HTMLCorePreferenceNames.TAG_NAME_CASE);
- }
-
- private void pluginSetPreferenceBoolean(IEclipsePreferences node, String prefKey) {
- boolean originalValue = false;
- boolean expectedValue = true;
-
- String originalString = node.get(prefKey, "bogus");
- if (!"bogus".equals(originalString)) {
- originalValue = Boolean.valueOf(originalString).booleanValue();
- expectedValue = !originalValue;
- }
- node.putBoolean(prefKey, expectedValue);
- boolean foundValue = node.getBoolean(prefKey, true);
- assertEquals("Set preference value failed using plugin.getPreferenceStore. Key: " + prefKey + " expected: " + expectedValue + " found: " + foundValue, expectedValue, foundValue);
-
- // attempt to restore original preference value
- if ("bogus".equals(originalString))
- node.remove(prefKey);
- else
- node.put(prefKey, originalString);
- }
-
- private void pluginSetPreferenceString(IEclipsePreferences node, String prefKey) {
- String originalValue = node.get(prefKey, "bogus");
- String expectedValue = Long.toString(System.currentTimeMillis()); // random
- // string
- node.put(prefKey, expectedValue);
- String foundValue = node.get(prefKey, "");
- assertEquals("Set preference value failed using plugin.getPreferenceStore. Key: " + prefKey + " expected: " + expectedValue + " found: " + foundValue, expectedValue, foundValue);
-
- // attempt to restore original preference value
- if ("bogus".equals(originalValue))
- node.remove(prefKey);
- else
- node.put(prefKey, originalValue);
- }
-
- /**
- * Tests line delimiter preferences by making sure document created
- * follows line delimiter preference.
- */
- public void testDelimiterPreferences() {
- // check if content type preferences match
- String preferredDelimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForHTML.ContentTypeID_HTML);
- Preferences prefs = ContentBasedPreferenceGateway.getPreferences(ContentTypeIdForHTML.ContentTypeID_HTML);
- String gatewayDelimiter = prefs.get(CommonEncodingPreferenceNames.END_OF_LINE_CODE, null);
- assertEquals("ContentTypeEncodingPreferences and ContentBasedPreferenceGateway preferences do not match", gatewayDelimiter, preferredDelimiter);
-
- // set a particular line delimiter
- prefs.put(CommonEncodingPreferenceNames.END_OF_LINE_CODE, CommonEncodingPreferenceNames.LF);
-
- // create document
- HTMLDocumentLoader loader = new HTMLDocumentLoader();
- IEncodedDocument document = loader.createNewStructuredDocument();
- String documentDelimiter = document.getPreferredLineDelimiter();
-
- // verify delimiter in document matches preference
- assertEquals("Delimiter in document does not match preference", CommonEncodingPreferenceNames.STRING_LF, documentDelimiter);
-
- // return to original preference
- prefs.remove(CommonEncodingPreferenceNames.END_OF_LINE_CODE);
- }
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLTagInfoTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLTagInfoTest.java
deleted file mode 100644
index 35fa6614c..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/misc/HTMLTagInfoTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 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.html.core.tests.misc;
-
-import org.eclipse.wst.html.core.tests.parser.ModelTest;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class HTMLTagInfoTest extends ModelTest {
-
- public HTMLTagInfoTest(String name) {
- super(name);
- }
-
- public HTMLTagInfoTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new HTMLTagInfoTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element html = document.createElement("HTML"); //$NON-NLS-1$
- document.appendChild(html);
- checkElementTagInfo(html);
-
- Element body = document.createElement("BODY"); //$NON-NLS-1$
- html.appendChild(body);
- checkElementTagInfo(body);
-
- Attr onclick = document.createAttribute("onclick"); //$NON-NLS-1$
- body.setAttributeNode(onclick);
- checkAttributeTagInfo(body, onclick);
- }
- finally {
- model.releaseFromEdit();
- }
- }
-
- private void checkElementTagInfo(Element node) {
- // check taginfo
- CMElementDeclaration elementDecl = getCMElementDeclaration(node);
- assertNotNull("Cannot check taginfo because no cm element declaration for " + node.getNodeName(), elementDecl); //$NON-NLS-1$
- if (elementDecl != null) {
- String tagInfo = (String) elementDecl.getProperty("tagInfo"); //$NON-NLS-1$
- assertNotNull("No taginfo found for " + elementDecl.getNodeName(), tagInfo); //$NON-NLS-1$
- }
- }
-
- private void checkAttributeTagInfo(Element element, Attr attribute) {
- // check taginfo
- CMElementDeclaration elementDecl = getCMElementDeclaration(element);
- assertNotNull("Cannot check taginfo because no element declaration for " + element.getNodeName(), elementDecl); //$NON-NLS-1$
- if (elementDecl != null) {
- CMAttributeDeclaration attDecl = getCMAttributeDeclaration(elementDecl, attribute.getName());
- assertNotNull("Cannot check taginfo because no attribute declaration for " + attribute.getName(), attDecl); //$NON-NLS-1$
-
- String tagInfo = (String) attDecl.getProperty("tagInfo"); //$NON-NLS-1$
- assertNull("Unexpected taginfo found for " + attDecl.getNodeName(), tagInfo); //$NON-NLS-1$
- }
- }
-
- /**
- * Retreives CMAttributeDeclaration indicated by attribute name within
- * elementDecl
- */
- private CMAttributeDeclaration getCMAttributeDeclaration(CMElementDeclaration elementDecl, String attName) {
- CMAttributeDeclaration attrDecl = null;
-
- if (elementDecl != null) {
- CMNamedNodeMap attributes = elementDecl.getAttributes();
- String noprefixName = DOMNamespaceHelper.getUnprefixedName(attName);
- if (attributes != null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(noprefixName);
- if (attrDecl == null) {
- attrDecl = (CMAttributeDeclaration) attributes.getNamedItem(attName);
- }
- }
- }
- return attrDecl;
- }
-
- /**
- * Retreives CMElementDeclaration for given node
- *
- * @return CMElementDeclaration - CMElementDeclaration of node or
- * <code>null</code> if not possible
- */
- private CMElementDeclaration getCMElementDeclaration(Element element) {
- CMElementDeclaration result = null;
-
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(element.getOwnerDocument());
- if (modelQuery != null)
- result = modelQuery.getCMElementDeclaration(element);
- return result;
- }
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/BUG124835SetStyleAttributeValueTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/BUG124835SetStyleAttributeValueTest.java
deleted file mode 100644
index 949e59f3f..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/BUG124835SetStyleAttributeValueTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.eclipse.wst.html.core.tests.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.css.core.internal.contentmodel.PropCMProperty;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleDeclaration;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.tests.utils.FileUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.css.ElementCSSInlineStyle;
-
-public class BUG124835SetStyleAttributeValueTest extends TestCase {
- /**
- * Tests setting some css attribute values including setting the same
- * value several times for different attributes
- */
- public void testSetAttributeValue() {
- final String ABSOLUTE = "absolute";
- final String ONE = "1";
- final String PX = "50px";
-
- IDOMModel model = FileUtil.createHTMLModel();
- try {
- IDOMDocument doc = model.getDocument();
- Element element = doc.createElement(HTML40Namespace.ElementName.DIV);
- element.setAttribute(HTML40Namespace.ATTR_NAME_ID, "Layer0");
- element.setAttribute(HTML40Namespace.ATTR_NAME_STYLE, "");
- setInlineStyle(element, PropCMProperty.P_POSITION, ABSOLUTE);
- setInlineStyle(element, PropCMProperty.P_Z_INDEX, ONE);
- setInlineStyle(element, PropCMProperty.P_WIDTH, PX);
- setInlineStyle(element, PropCMProperty.P_HEIGHT, PX);
- setInlineStyle(element, PropCMProperty.P_TOP, PX);
- setInlineStyle(element, PropCMProperty.P_LEFT, PX);
-
- assertEquals(ABSOLUTE, getInlineStyle(element, PropCMProperty.P_POSITION));
- assertEquals(ONE, getInlineStyle(element, PropCMProperty.P_Z_INDEX));
- assertEquals(PX, getInlineStyle(element, PropCMProperty.P_WIDTH));
- assertEquals(PX, getInlineStyle(element, PropCMProperty.P_HEIGHT));
- assertEquals(PX, getInlineStyle(element, PropCMProperty.P_TOP));
- assertEquals(PX, getInlineStyle(element, PropCMProperty.P_LEFT));
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- private void setInlineStyle(Element element, String name, String value) {
- ICSSStyleDeclaration decl = null;
- try {
- decl = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
- }
- catch (ClassCastException ex) {
- // do nothing
- }
- if (decl != null) {
- String priority = decl.getPropertyPriority(name);
- decl.setProperty(name, value, priority);
- }
- }
-
-
- private String getInlineStyle(Element element, String name) {
- String value = null;
- ICSSStyleDeclaration decl = null;
- try {
- decl = (ICSSStyleDeclaration) ((ElementCSSInlineStyle) element).getStyle();
- }
- catch (ClassCastException ex) {
- // do nothing
- }
- if (decl != null) {
- value = decl.getPropertyValue(name);
- }
- return value;
- }
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/GetOverrideStyleTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/GetOverrideStyleTest.java
deleted file mode 100644
index 71d12ac34..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/GetOverrideStyleTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.model;
-
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.html.core.tests.utils.FileUtil;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.css.DocumentCSS;
-
-public class GetOverrideStyleTest extends TestCase {
- /**
- * Constructor for StyleTest.
- *
- * @param name
- */
- public GetOverrideStyleTest(String name) {
- super(name);
- }
-
- public GetOverrideStyleTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new GetOverrideStyleTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = FileUtil.createHTMLModel();
- try {
- model.getStructuredDocument().setText(null, "<style>p { border-color: blue; margin: 0; } </style> <p style=\"border-color: red; margin: 1;\">");
- Document document = model.getDocument();
-
- DocumentCSS ddd = (DocumentCSS) document;
- NodeList n = document.getElementsByTagName("p");
- ddd.getOverrideStyle((Element) n.item(0), "");
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/ModelModifications.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/ModelModifications.java
deleted file mode 100644
index 768776297..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/ModelModifications.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.model;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.tests.utils.TestWriter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.util.NullInputStream;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-public class ModelModifications extends TestCase {
-
- public void testPlainDocument() throws BadLocationException {
- IDocument document = new Document();
- document.set("");
- document.replace(0, 0, "test");
- document.set("");
- document.replace(0, 0, "test2");
- assertTrue(true);
-
- }
-
- public void testRepDocumentHTMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createHTMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testSetDocumentXMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createXMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.setText(this, "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testRepDocumentJSPMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createJSPModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testSetDocumentHTMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createHTMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.setText(this, "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testSetDocumentJSPMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createJSPModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.setText(this, "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testRepDocumentXMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createXMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "<tag>text</tag>");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testDocumentHTMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createHTMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testDocumentJSPMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createJSPModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- public void testDocumentXMLMods() throws UnsupportedEncodingException, IOException {
- IDOMModel model = null; // assumes 0-byte html empty file
-
- model = createXMLModel();
-
- try {
- IDOMDocument doc = model.getDocument();
- Element ele = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele);
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.replaceText(this, 0, structuredDocument.getLength(), "");
- Element ele2 = doc.createElement(HTML40Namespace.ElementName.P);
- doc.appendChild(ele2);
- }
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
- }
-
- /**
- * Be sure to release any models obtained from this method.
- *
- * @return
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- private static IDOMModel createXMLModel() throws UnsupportedEncodingException, IOException {
-
- IStructuredModel model = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
-
- model = modelManager.getModelForEdit("test.xml", new NullInputStream(), null);
-
- // always use the same line delimiter for these tests, regardless
- // of
- // plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
- return (IDOMModel) model;
-
- }
-
- /**
- * Be sure to release any models obtained from this method.
- *
- * @return
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- private static IDOMModel createHTMLModel() throws UnsupportedEncodingException, IOException {
-
- IStructuredModel model = null;
- IModelManager modelManager = StructuredModelManager.getModelManager();
-
- model = modelManager.getModelForEdit("test.html", new NullInputStream(), null);
-
- // always use the same line delimiter for these tests, regardless
- // of
- // plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
- return (IDOMModel) model;
-
- }
-
- /**
- * Be sure to release any models obtained from this method.
- *
- * @return
- * @throws IOException
- * @throws UnsupportedEncodingException
- */
- private static IDOMModel createJSPModel() throws UnsupportedEncodingException, IOException {
-
- IStructuredModel model = null;
-
- IModelManager modelManager = StructuredModelManager.getModelManager();
-
- model = modelManager.getModelForEdit("test.xml", new NullInputStream(), null);
-
- // always use the same line delimiter for these tests, regardless
- // of
- // plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
-
-
- return (IDOMModel) model;
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/TestForNPEInCSSCreation.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/TestForNPEInCSSCreation.java
deleted file mode 100644
index 597a34139..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/model/TestForNPEInCSSCreation.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet;
-import org.eclipse.wst.html.core.internal.provisional.HTML40Namespace;
-import org.eclipse.wst.html.core.tests.utils.FileUtil;
-import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-public class TestForNPEInCSSCreation extends TestCase {
-
-
- public void testCSSModel() {
-
- IDOMModel model = FileUtil.createHTMLModel();
-
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- structuredDocument.set(getHTMLDocumentText());
-
- IDOMDocument doc = model.getDocument();
-
- // get head tag
- NodeList list = doc.getElementsByTagName(HTML40Namespace.ElementName.HEAD);
- Element head = (Element) list.item(0);
-
- // create and append style element
- Element ele = doc.createElement(HTML40Namespace.ElementName.STYLE);
- ele.setAttribute(HTML40Namespace.ATTR_NAME_TYPE, "text/css");
-
- String delim = model.getStructuredDocument().getLineDelimiter();
- if (delim == null)
- delim = "\n";//$NON-NLS-1$
- StringBuffer buffer = new StringBuffer(delim);
- buffer.append("<!--");//$NON-NLS-1$
- buffer.append(delim);
- buffer.append("-->");//$NON-NLS-1$
- buffer.append(delim);
- Text text = doc.createTextNode(buffer.toString());
- ele.appendChild(text);
-
- head.insertBefore(ele, null);
-
- // get adapter for StyleSheet
- ICSSStyleSheet sheet = (ICSSStyleSheet) ((IStyleSheetAdapter) ((INodeNotifier) ele).getAdapterFor(IStyleSheetAdapter.class)).getSheet();
-
- // create style declaration
- ICSSStyleRule rule = sheet.createCSSStyleRule();
- rule.getStyle().setProperty("background-color", "lime", "");
- rule.getStyle().setProperty("background-color", "blue", "");
- rule.getStyle().setProperty("background-color", "#0080ff", "");
-
- //model.save();
-
-
- }
-
-
- finally {
- if (model != null) {
- model.releaseFromEdit();
- }
- }
-
- }
-
- private String getHTMLDocumentText() {
- return "<html><head></head><body></body></html>";
- }
-
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AllModelParserTests.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AllModelParserTests.java
deleted file mode 100644
index 0ed2256c9..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AllModelParserTests.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-
-import junit.framework.TestSuite;
-
-
-public class AllModelParserTests {
-
- // public AllModelParserTests(String name) {
- // //super(name);
- // }
-
- public void holdOldTestMain() {
- runTest(new ParserTest());
- runTest(new ParserTest2());
- runTest(new ParserTest3());
- runTest(new ParserTest4());
- runTest(new UpdaterTest());
- runTest(new UpdaterTest2());
- runTest(new UpdaterTest3());
- runTest(new UpdaterTest4());
- runTest(new UpdaterTest5());
- runTest(new UpdaterTest6());
- runTest(new UpdaterTest7());
- runTest(new UpdaterTest8());
- runTest(new UpdaterTest9());
- runTest(new UpdaterTest10());
- runTest(new UpdaterTest11());
- runTest(new UpdaterTest12());
- runTest(new UpdaterTest13());
- runTest(new UpdaterTest14());
- runTest(new ElementTest());
- runTest(new ElementTest2());
- runTest(new ElementTest3());
- runTest(new TableTest());
- runTest(new TextTest());
- runTest(new TextTest2());
- runTest(new TextTest3());
- runTest(new SplitTextTest());
- runTest(new SplitTextTest2());
- runTest(new SplitTextTest3());
- runTest(new SplitTextTest4());
- runTest(new SplitTextTest5());
- runTest(new SplitTextTest6());
- runTest(new SplitTextTest7());
- runTest(new SplitTextTest8());
- runTest(new EmptyTextTest());
- runTest(new EmptyTextTest2());
- runTest(new EmptyTextTest3());
- runTest(new AttrTest());
- runTest(new AttrTest2());
- runTest(new EntityTest());
- runTest(new EntityTest2());
- runTest(new EntityTest3());
- runTest(new EntityTest4());
- runTest(new EntityTest5());
- runTest(new EntityTest6());
- runTest(new EntityTest7());
- runTest(new EntityTest8());
- runTest(new EntityTest9());
- runTest(new DocTypeTest());
- runTest(new CDATASectionTest());
- runTest(new CDATASectionTest2());
- runTest(new CDATASectionTest3());
- runTest(new PITest());
- }
-
- public static TestSuite getAllTests() {
-
-
- TestSuite testSuite = new TestSuite();
-
- testSuite.addTestSuite(ParserTest.class);
- testSuite.addTestSuite(ParserTest2.class);
- testSuite.addTestSuite(ParserTest3.class);
- testSuite.addTestSuite(ParserTest4.class);
- testSuite.addTestSuite(UpdaterTest.class);
- testSuite.addTestSuite(UpdaterTest2.class);
- testSuite.addTestSuite(UpdaterTest3.class);
- testSuite.addTestSuite(UpdaterTest4.class);
- testSuite.addTestSuite(UpdaterTest5.class);
- testSuite.addTestSuite(UpdaterTest6.class);
- testSuite.addTestSuite(UpdaterTest7.class);
- testSuite.addTestSuite(UpdaterTest8.class);
- testSuite.addTestSuite(UpdaterTest9.class);
- testSuite.addTestSuite(UpdaterTest10.class);
- testSuite.addTestSuite(UpdaterTest11.class);
- testSuite.addTestSuite(UpdaterTest12.class);
- testSuite.addTestSuite(UpdaterTest13.class);
- testSuite.addTestSuite(UpdaterTest14.class);
- testSuite.addTestSuite(ElementTest.class);
- testSuite.addTestSuite(ElementTest2.class);
- testSuite.addTestSuite(ElementTest3.class);
- testSuite.addTestSuite(TableTest.class);
- testSuite.addTestSuite(TextTest.class);
- testSuite.addTestSuite(TextTest2.class);
- testSuite.addTestSuite(TextTest3.class);
- testSuite.addTestSuite(SplitTextTest.class);
- testSuite.addTestSuite(SplitTextTest2.class);
- testSuite.addTestSuite(SplitTextTest3.class);
- testSuite.addTestSuite(SplitTextTest4.class);
- testSuite.addTestSuite(SplitTextTest5.class);
- testSuite.addTestSuite(SplitTextTest6.class);
- testSuite.addTestSuite(SplitTextTest7.class);
- testSuite.addTestSuite(SplitTextTest8.class);
- testSuite.addTestSuite(EmptyTextTest.class);
- testSuite.addTestSuite(EmptyTextTest2.class);
- testSuite.addTestSuite(EmptyTextTest3.class);
- testSuite.addTestSuite(AttrTest.class);
- testSuite.addTestSuite(AttrTest2.class);
- testSuite.addTestSuite(EntityTest.class);
- testSuite.addTestSuite(EntityTest2.class);
- testSuite.addTestSuite(EntityTest3.class);
- testSuite.addTestSuite(EntityTest4.class);
- testSuite.addTestSuite(EntityTest5.class);
- testSuite.addTestSuite(EntityTest6.class);
- testSuite.addTestSuite(EntityTest7.class);
- testSuite.addTestSuite(EntityTest8.class);
- testSuite.addTestSuite(EntityTest9.class);
- testSuite.addTestSuite(DocTypeTest.class);
- testSuite.addTestSuite(CDATASectionTest.class);
- testSuite.addTestSuite(CDATASectionTest2.class);
- testSuite.addTestSuite(CDATASectionTest3.class);
- testSuite.addTestSuite(PITest.class);
- // the follow is fairly long running
- //testSuite.addTestSuite(TestExampleFiles.class);
-
- return testSuite;
- }
-
-
-
- private void runTest(ModelTest test) {
- try {
- test.testModel();
- }
- catch (Exception ex) {
- ModelTest.printException(ex);
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest.java
deleted file mode 100644
index 1e713e834..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class AttrTest extends ModelTest {
- /**
- * Constructor for AttrTest.
- *
- * @param name
- */
- public AttrTest(String name) {
- super(name);
- }
-
- public AttrTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new AttrTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- //Document document = model.getDocument();
-
- structuredDocument.setText(this, "<a href=\"<%=c%>\">a</a>");
-
- printSource(model);
- printTree(model);
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest2.java
deleted file mode 100644
index 8dbef6aed..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest2.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class AttrTest2 extends ModelTest {
- /**
- * Constructor for AttrTest2.
- *
- * @param name
- */
- public AttrTest2(String name) {
- super(name);
- }
-
- public AttrTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new AttrTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- a.setAttribute("b", "c");
- a.setAttribute("d", "e");
- Text t = document.createTextNode("f");
- document.appendChild(a);
- a.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- Attr b = a.getAttributeNode("b");
- b.setPrefix("x");
-
- fOutputWriter.writeln("b.name=" + b.getName());
- fOutputWriter.writeln("b.value=" + b.getValue());
- String ab = a.getAttribute("b");
- fOutputWriter.writeln("a b=" + ab);
- String axb = a.getAttribute("x:b");
- fOutputWriter.writeln("a x:b=" + axb);
-
- printSource(model);
- printTree(model);
-
- a.getAttributeNode("d").setPrefix("y");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest3.java
deleted file mode 100644
index 7630665c4..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/AttrTest3.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class AttrTest3 extends ModelTest {
- /**
- * Constructor for AttrTest3.
- *
- * @param name
- */
- public AttrTest3(String name) {
- super(name);
- }
-
- public AttrTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new AttrTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.setText(this, "<a xmlns='default-uri' xmlns:b='b-uri'><c d='d-value' b:e='e-value'/></a>");
-
- printSource(model);
- printTree(model);
-
- Element a = (Element) document.getFirstChild();
- Element c = (Element) a.getFirstChild();
-
- Attr xmlns = a.getAttributeNode("xmlns");
- fOutputWriter.writeln("xmlns [" + xmlns.getNamespaceURI() + "]");
- Attr xmlns_b = a.getAttributeNode("xmlns:b");
- fOutputWriter.writeln("xmlns:b [" + xmlns_b.getNamespaceURI() + "]");
- Attr d = c.getAttributeNode("d");
- fOutputWriter.writeln("d [" + d.getNamespaceURI() + "]");
- Attr b_e = c.getAttributeNode("b:e");
- fOutputWriter.writeln("b:e [" + b_e.getNamespaceURI() + "]");
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest.java
deleted file mode 100644
index 64e8c889e..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class CDATASectionTest extends ModelTest {
- /**
- * Constructor for CDATASectionTest.
- *
- * @param name
- */
- public CDATASectionTest(String name) {
- super(name);
- }
-
- public CDATASectionTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new CDATASectionTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<a><![CDATA[contentOfCDATASection]]></a>");
-
- printSource(model);
- printTree(model);
-
- Node a = document.getFirstChild();
- for (Node child = a.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.CDATA_SECTION_NODE)
- continue;
- CDATASection cdata = (CDATASection) child;
- fOutputWriter.writeln(cdata.getData());
- }
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest2.java
deleted file mode 100644
index bb476623f..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest2.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class CDATASectionTest2 extends ModelTest {
- /**
- * Constructor for CDATASectionTest2.
- *
- * @param name
- */
- public CDATASectionTest2(String name) {
- super(name);
- }
-
- public CDATASectionTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new CDATASectionTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- CDATASection cdata = document.createCDATASection("contentOfCDATASection");
- a.appendChild(cdata);
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- cdata.setData("new content");
-
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- cdata.setData("new content");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest3.java
deleted file mode 100644
index 3e014cd5e..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/CDATASectionTest3.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class CDATASectionTest3 extends ModelTest {
- /**
- * Constructor for CDATASectionTest3.
- *
- * @param name
- */
- public CDATASectionTest3(String name) {
- super(name);
- }
-
- public CDATASectionTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new CDATASectionTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- CDATASection cdata = document.createCDATASection("contentOfCDATASection");
- a.appendChild(cdata);
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- cdata.setData("new < content");
-
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- cdata.setData("new > content");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(cdata.getData());
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/DocTypeTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/DocTypeTest.java
deleted file mode 100644
index 4aede0361..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/DocTypeTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocumentType;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Element;
-
-public class DocTypeTest extends ModelTest {
- /**
- * Constructor for DocTypeTest.
- *
- * @param name
- */
- public DocTypeTest(String name) {
- super(name);
- }
-
- public DocTypeTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new DocTypeTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- IDOMDocument document = model.getDocument();
-
- IDOMDocumentType docType = (IDOMDocumentType) document.createDoctype("HTML");
- document.appendChild(docType);
- Element html = document.createElement("HTML");
- document.appendChild(html);
-
- printSource(model);
- printTree(model);
-
- docType.setSystemId("sytem");
-
- printSource(model);
- printTree(model);
-
- docType.setPublicId("public");
-
- printSource(model);
- printTree(model);
-
- document.insertBefore(document.createTextNode(" "), docType);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest.java
deleted file mode 100644
index 6cf7cad05..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class ElementTest extends ModelTest {
- /**
- * Constructor for ElementTest.
- *
- * @param name
- */
- public ElementTest(String name) {
- super(name);
- }
-
- public ElementTest() {
- super();
- }
-
- public Element changeTagName(Element element, String tagName) {
- Document document = element.getOwnerDocument();
- Node parent = element.getParentNode();
- Element newElement = document.createElement(tagName);
- NamedNodeMap attributes = element.getAttributes();
- while (attributes.getLength() > 0) {
- Attr attr = (Attr) attributes.item(0);
- attr = element.removeAttributeNode(attr);
- newElement.setAttributeNode(attr);
- }
- while (element.hasChildNodes()) {
- Node child = element.getFirstChild();
- child = element.removeChild(child);
- newElement.appendChild(child);
- }
- parent.insertBefore(newElement, element);
- parent.removeChild(element);
- return newElement;
- }
-
- public static void main(java.lang.String[] args) {
- new ElementTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<a><b e=\"f\" c=\"d\"><g /><h /></b></a>");
- Node a = document.getFirstChild();
- Element b = (Element) a.getFirstChild();
-
- printSource(model);
- printTree(model);
-
- //Element i =
- changeTagName(b, "i");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest2.java
deleted file mode 100644
index 23f1a75cb..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest2.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class ElementTest2 extends ModelTest {
- /**
- * Constructor for ElementTest2.
- *
- * @param name
- */
- public ElementTest2(String name) {
- super(name);
- }
-
- public ElementTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ElementTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- Element b = document.createElement("b");
- Text t = document.createTextNode("c");
- document.appendChild(a);
- a.appendChild(b);
- b.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- a.setPrefix("x");
-
- fOutputWriter.writeln("a.tagName=" + a.getTagName());
-
- printSource(model);
- printTree(model);
-
- b.setPrefix("y");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest3.java
deleted file mode 100644
index 71f465b64..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ElementTest3.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class ElementTest3 extends ModelTest {
- /**
- * Constructor for ElementTest3.
- *
- * @param name
- */
- public ElementTest3(String name) {
- super(name);
- }
-
- public ElementTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ElementTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("x:a");
- Element b = document.createElement("b");
- Text t = document.createTextNode("c");
- document.appendChild(a);
- a.appendChild(b);
- b.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- a.setPrefix("");
-
- fOutputWriter.writeln("a.tagName=" + a.getTagName());
-
- printSource(model);
- printTree(model);
-
- a.setPrefix("y");
-
- fOutputWriter.writeln("a.tagName=" + a.getTagName());
-
- printSource(model);
- printTree(model);
-
- a.setPrefix("y");
-
- printSource(model);
- printTree(model);
-
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest.java
deleted file mode 100644
index f50cbf75f..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EmptyTextTest extends ModelTest {
- /**
- * Constructor for EmptyTextTest.
- *
- * @param name
- */
- public EmptyTextTest(String name) {
- super(name);
- }
-
- public EmptyTextTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EmptyTextTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a");
- p.appendChild(text);
- Element br = document.createElement("BR");
- p.appendChild(br);
- Text text2 = document.createTextNode("");
- p.appendChild(text2);
-
- printSource(model);
- printTree(model);
-
- Text text3 = document.createTextNode("");
- p.insertBefore(text3, text2);
-
- printSource(model);
- printTree(model);
-
- text3.setData("b");
-
- printSource(model);
- printTree(model);
-
- p.removeChild(text2);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest2.java
deleted file mode 100644
index f3006450b..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest2.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EmptyTextTest2 extends ModelTest {
- /**
- * Constructor for EmptyTextTest2.
- *
- * @param name
- */
- public EmptyTextTest2(String name) {
- super(name);
- }
-
- public EmptyTextTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EmptyTextTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.setData("a");
-
- printSource(model);
- printTree(model);
-
- text.setData("");
-
- printSource(model);
- printTree(model);
-
- Element b = document.createElement("B");
- p.appendChild(b);
- p.removeChild(text);
- b.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.setData("a");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest3.java
deleted file mode 100644
index 49dfb7a40..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EmptyTextTest3.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EmptyTextTest3 extends ModelTest {
- /**
- * Constructor for EmptyTextTest3.
- *
- * @param name
- */
- public EmptyTextTest3(String name) {
- super(name);
- }
-
- public EmptyTextTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EmptyTextTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Text text = document.createTextNode("");
- document.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Element a = document.createElement("a");
- document.insertBefore(a, text);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest.java
deleted file mode 100644
index 6deb9cf7c..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest extends ModelTest {
- /**
- * Constructor for EntityTest.
- *
- * @param name
- */
- public EntityTest(String name) {
- super(name);
- }
-
- public EntityTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
-
- printSource(model);
- printTree(model);
-
- Text text = document.createTextNode("&gt;");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest2.java
deleted file mode 100644
index 7bb1459b0..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest2.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest2 extends ModelTest {
- /**
- * Constructor for EntityTest2.
- *
- * @param name
- */
- public EntityTest2(String name) {
- super(name);
- }
-
- public EntityTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.setData("a&gt;");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest3.java
deleted file mode 100644
index 12591e707..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest3.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest3 extends ModelTest {
- /**
- * Constructor for EntityTest3.
- *
- * @param name
- */
- public EntityTest3(String name) {
- super(name);
- }
-
- public EntityTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.setData("ab");
-
- printSource(model);
- printTree(model);
-
- text.setData("ab&");
-
- printSource(model);
- printTree(model);
-
- text.setData("ab&c");
-
- printSource(model);
- printTree(model);
-
- text.setData("dab&c");
-
- printSource(model);
- printTree(model);
-
- text.setData("dab&ce");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest4.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest4.java
deleted file mode 100644
index 5f1744c16..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest4.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest4 extends ModelTest {
- /**
- * Constructor for EntityTest4.
- *
- * @param name
- */
- public EntityTest4(String name) {
- super(name);
- }
-
- public EntityTest4() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest4().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a&b");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = document.createTextNode("");
- p.insertBefore(text2, text);
-
- printSource(model);
- printTree(model);
-
- text2.setData("c");
-
- printSource(model);
- printTree(model);
-
- text2.setData("ca&b");
-
- printSource(model);
- printTree(model);
-
- p.removeChild(text);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest5.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest5.java
deleted file mode 100644
index 5d6e2692b..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest5.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest5 extends ModelTest {
- /**
- * Constructor for EntityTest5.
- *
- * @param name
- */
- public EntityTest5(String name) {
- super(name);
- }
-
- public EntityTest5() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest5().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a&b");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = document.createTextNode("a&b");
- p.insertBefore(text2, text);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest6.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest6.java
deleted file mode 100644
index c55a9c20c..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest6.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class EntityTest6 extends ModelTest {
- /**
- * Constructor for EntityTest6.
- *
- * @param name
- */
- public EntityTest6(String name) {
- super(name);
- }
-
- public EntityTest6() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest6().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("a&");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = document.createTextNode("a&");
- p.insertBefore(text2, text);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest7.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest7.java
deleted file mode 100644
index 4a092d033..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest7.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class EntityTest7 extends ModelTest {
- /**
- * Constructor for EntityTest7.
- *
- * @param name
- */
- public EntityTest7(String name) {
- super(name);
- }
-
- public EntityTest7() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest7().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- //Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<a>a&#65;&#x41;&unk;&unk&unk</a>");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest8.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest8.java
deleted file mode 100644
index b22f9389c..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest8.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class EntityTest8 extends ModelTest {
- /**
- * Constructor for EntityTest8.
- *
- * @param name
- */
- public EntityTest8(String name) {
- super(name);
- }
-
- public EntityTest8() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest8().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- //Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "&ibm;&rtp;");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest9.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest9.java
deleted file mode 100644
index a1eff8b36..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/EntityTest9.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class EntityTest9 extends ModelTest {
- /**
- * Constructor for EntityTest9.
- *
- * @param name
- */
- public EntityTest9(String name) {
- super(name);
- }
-
- public EntityTest9() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new EntityTest9().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- //Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "&lt;");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(this, 4, 0, "&gt");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(this, 7, 0, ";");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ModelTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ModelTest.java
deleted file mode 100644
index d59cfe7c2..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ModelTest.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Writer;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.html.core.tests.utils.DateUtil;
-import org.eclipse.wst.html.core.tests.utils.FileUtil;
-import org.eclipse.wst.html.core.tests.utils.StringCompareUtil;
-import org.eclipse.wst.html.core.tests.utils.TestWriter;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.internal.document.StructuredDocumentRegionChecker;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Node;
-
-public abstract class ModelTest extends TestCase {
-
- public final static String testResultsDirectoryPrefix = "ParserResults";
- private final static String fileExtension = ".txt";
- protected TestWriter fOutputWriter = new TestWriter();
- private int READ_BUFFER_SIZE = 4096;
-
- private boolean echoToSystemOut = false;
- private boolean printedOnce;
- private boolean printSummaryToSystemOut;
-
- /**
- * Constructor for ModelTest.
- *
- * @param name
- */
- public ModelTest(String name) {
- super(name);
- try {
- printClass();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public ModelTest() {
- this("dummy");
- // try {
- // printClass();
- // } catch (IOException e) {
- // e.printStackTrace();
- // }
- }
-
- public static IDOMModel createHTMLModel() {
-
- //return new XMLModelImpl();
-
- IStructuredModel model = null;
- try {
- IModelManager modelManager = StructuredModelManager.getModelManager();
-
- model = modelManager.getModelForEdit("test.html", new NullInputStream(), null);
-
- // always use the same line delimiter for these tests, regardless
- // of
- // plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- //assertTrue("basic XML empty model could not be created", model !=
- // null);
- return (IDOMModel) model;
-
- }
-
- public static IDOMModel createXMLModel() {
-
- //return new XMLModelImpl();
-
- IStructuredModel model = null;
- try {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- //assertTrue("modelManager must not be null", modelManager !=
- // null);
-
- model = modelManager.getModelForEdit("test.xml", new NullInputStream(), null);
-
- // always use the same line delimiter for these tests, regardless
- // of
- // plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(TestWriter.commonEOL);
-
-
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- //assertTrue("basic XML empty model could not be created", model !=
- // null);
- return (IDOMModel) model;
-
- }
-
- /**
- */
- private void printClass() throws IOException {
- fOutputWriter.writeln(getClass().getName());
- }
-
- public static void printException(Exception ex) {
- ex.printStackTrace();
- }
-
- private void printNode(Node node, int indent) {
- try {
- StringBuffer buffer = new StringBuffer(10);
- for (int i = 0; i < indent; i++)
- buffer.append("--");
- buffer.append(StringUtils.escape(node.toString()));
- fOutputWriter.writeln(buffer.toString());
- indent++;
- Node child = node.getFirstChild();
- while (child != null) {
- printNode(child, indent);
- child = child.getNextSibling();
- }
- }
- catch (Exception ex) {
- printException(ex);
- }
- }
-
- public void printSource(IDOMModel model) {
- try {
- fOutputWriter.writeln("Source :");
- fOutputWriter.writeln(model.getStructuredDocument().getText());
- fOutputWriter.writeln("");
- }
- catch (Exception ex) {
- printException(ex);
- }
- }
-
- public void printTree(IDOMModel model) {
- try {
- printFlatModel(model.getStructuredDocument());
- new StructuredDocumentRegionChecker(fOutputWriter).checkModel(model);
- fOutputWriter.writeln("Tree :");
- printNode(model.getDocument(), 0);
- fOutputWriter.writeln("");
-
- }
- catch (Exception ex) {
- printException(ex);
- }
-
- }
-
- protected void saveAndCompareTestResults() {
- try {
- String testOutputDirectory = testResultsDirectoryPrefix + DateUtil.now();
- String currentFilename = getClass().getName() + fileExtension;
- File fileout = FileUtil.makeFileFor(testOutputDirectory, currentFilename, testResultsDirectoryPrefix);
- Writer fileWriter = new FileWriter(fileout);
- fileWriter.write(fOutputWriter.toString());
- fileWriter.close();
- compareWithPreviousResults(fOutputWriter, currentFilename);
-
- if (echoToSystemOut) {
- System.out.println(fOutputWriter.toString());
- }
-
- fOutputWriter.close();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Method compareWithPreviousResults.
- *
- * @param outputWriter
- * @param currentFilename
- */
- private void compareWithPreviousResults(TestWriter outputWriter, String currentFilename) throws IOException {
- boolean success = false;
- File previousResultsDir = FileUtil.getPreviousResultsDirectory(testResultsDirectoryPrefix);
- if (previousResultsDir != null) {
- String currentResults = outputWriter.toString();
- File previousResultsFile = new File(previousResultsDir, currentFilename);
- FileReader previousResultsFileReader = new FileReader(previousResultsFile);
- String previousResults = readString(previousResultsFileReader);
- StringCompareUtil stringCompare = new StringCompareUtil();
- // trying to "force" the same linedelimter didn't work well,
- // I think since the line delimiter is input on some tests,
- // and CVS is likely to change anyway (for ASCII files).
- // so we'll ignore in our comparisons. Note: we wouldn't
- // want to ignore whitespace. There might actually be some
- // tests that are not as accurate if we ignore EOL, but there
- // seems to be no easy way to handle, with out a lot of trouble.
- if (!stringCompare.equalsIgnoreLineSeperator(previousResults, currentResults)) {
- // previousResults.equals(currentResults)) {
- // fail
- success = false;
-
- System.out.println();
- System.out.println(currentFilename + " failed comparison to previous results");
- System.out.println("Previous: ");
- System.out.println(previousResults);
- System.out.println();
- System.out.println("Current: ");
- System.out.println(currentResults);
- System.out.println();
- }
- else {
- success = true;
- if (printSummaryToSystemOut) {
- System.out.println();
- System.out.println(currentFilename + " compared ok");
- System.out.println();
- }
- }
- }
- else {
- if (!printedOnce) {
- System.out.println();
- System.out.println("No Previous Directory found ... couldn't compare " + currentFilename + " with previous results");
- printedOnce = true;
- System.out.println();
- }
- }
- assertTrue("current is not equal to reference results for " + currentFilename, success);
- }
-
- /**
- * Method readString.
- *
- * @param previousResultsFileReader
- * @return String
- */
- private String readString(FileReader fileReader) throws IOException {
- return readInputStream(fileReader);
- }
-
- private String readInputStream(InputStreamReader inputStreamReader) throws IOException {
- int numRead = 0;
- StringBuffer buffer = new StringBuffer();
- char tBuff[] = new char[READ_BUFFER_SIZE];
- while ((numRead = inputStreamReader.read(tBuff, 0, tBuff.length)) != -1) {
- buffer.append(tBuff, 0, numRead);
- }
- // remember -- we didn't open stream ... so we don't close it
- return buffer.toString();
- }
-
- public abstract void testModel();
-
- protected void printFlatModel(IStructuredDocument flatModel) {
- fOutputWriter.writeln("");
- fOutputWriter.writeln("StructuredDocument Regions :");
- IStructuredDocumentRegion flatnode = flatModel.getFirstStructuredDocumentRegion();
- while (flatnode != null) {
-
- fOutputWriter.writeln(flatnode.toString());
- flatnode = flatnode.getNext();
-
- }
- fOutputWriter.writeln("");
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NodeListTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NodeListTest.java
deleted file mode 100644
index e5f4b16d8..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NodeListTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class NodeListTest extends ModelTest {
- /**
- * Constructor for PITest.
- *
- * @param name
- */
- public NodeListTest(String name) {
- super(name);
- }
-
- public NodeListTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new NodeListTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<p></p>");
- Node parent = document.getFirstChild();
-
- for (int i = 0; i < 1; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 1; i < 5; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 5; i < 10; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 10; i < 20; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 20; i < 50; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 50; i < 100; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 100; i < 200; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 200; i < 500; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 500; i < 1000; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 1000; i < 2000; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 2000; i < 5000; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
-
- for (int i = 5000; i < 10000; i++) {
- parent.appendChild(document.createElement("c"));
- }
-
- iterate(parent);
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-
- private void iterate(Node parent) {
- long start = System.currentTimeMillis();
- int i = 0;
- int t = 0;
- while (t < 1000) {
- NodeList childNodes = parent.getChildNodes();
- int length = childNodes.getLength();
- for (i = 0; i < length; i++) {
- childNodes.item(i);
- }
- // these 2 lines are required to invalidate the cache
- parent.appendChild(parent.getOwnerDocument().createTextNode(""));
- parent.removeChild(parent.getLastChild());
- t++;
- }
- float d = ((float) (System.currentTimeMillis() - start)) / t;
- System.out.println(d + " ms for " + i + " child nodes");
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NullInputStream.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NullInputStream.java
deleted file mode 100644
index e4810c3d9..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/NullInputStream.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 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
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.html.core.tests.parser;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-
-class NullInputStream extends InputStream {
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#mark(int)
- */
- public synchronized void mark(int readlimit) {
- // nothing to do
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#markSupported()
- */
- public boolean markSupported() {
- // we can mark nothing.
- // and, we are using this Null class specifically for
- // a "fake" resettable stream.
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#read()
- */
- public int read() throws IOException {
-
- return -1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#reset()
- */
- public synchronized void reset() throws IOException {
- // nothing to do
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.io.InputStream#skip(long)
- */
- public long skip(long n) throws IOException {
- return 0;
- }
-}
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/PITest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/PITest.java
deleted file mode 100644
index ce72a8d26..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/PITest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.ProcessingInstruction;
-
-public class PITest extends ModelTest {
- /**
- * Constructor for PITest.
- *
- * @param name
- */
- public PITest(String name) {
- super(name);
- }
-
- public PITest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new PITest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<a><?echo $PHP_SELF?></a>");
-
- printSource(model);
- printTree(model);
-
- Node a = document.getFirstChild();
- for (Node child = a.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child.getNodeType() != Node.PROCESSING_INSTRUCTION_NODE)
- continue;
- ProcessingInstruction pi = (ProcessingInstruction) child;
- String target = pi.getTarget();
- if (target == null)
- target = "null";
- String data = pi.getData();
- if (data == null)
- data = "null";
- fOutputWriter.writeln("target(" + target + ") data (" + data + ")");
- }
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest.java
deleted file mode 100644
index d1d9b9c04..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class ParserTest extends ModelTest {
- /**
- * Constructor for ParserTest.
- *
- * @param name
- */
- public ParserTest(String name) {
- super(name);
- }
-
- public ParserTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ParserTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<P><B></B><B></B></P><P></P>");
- Node p = document.getFirstChild();
- Node b = p.getFirstChild();
- Node b2 = b.getNextSibling();
- Node p2 = p.getNextSibling();
- /*
- * Element p = document.createElement("P");
- * document.appendChild(p); Element b =
- * document.createElement("B"); p.appendChild(b); Element b2 =
- * document.createElement("B"); p.appendChild(b2); Element p2 =
- * document.createElement("P"); document.appendChild(p2);
- */
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 0, 0, "a");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) b).getStartOffset(), 0, "b");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) b2).getStartOffset(), 0, "c");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) b2).getEndOffset(), 0, "d");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) p2).getStartOffset(), 0, "e");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) p2).getStartOffset() + 3, 0, "f");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, ((IDOMNode) p2).getEndOffset(), 0, "g");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest2.java
deleted file mode 100644
index 2790ba33d..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest2.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class ParserTest2 extends ModelTest {
- /**
- * Constructor for ParserTest2.
- *
- * @param name
- */
- public ParserTest2(String name) {
- super(name);
- }
-
- public ParserTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ParserTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<a b=\"\" c=\"c\">");
-
- printSource(model);
- printTree(model);
-
- Element a = (Element) document.getFirstChild();
- NamedNodeMap attributes = a.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attr = attributes.item(i);
- String name = attr.getNodeName();
- String value = attr.getNodeValue();
- fOutputWriter.writeln(name + "=[" + value + "]");
- }
-
- structuredDocument.replaceText(null, 8, 0, "d");
-
- printSource(model);
- printTree(model);
-
- a = (Element) document.getFirstChild();
- attributes = a.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attr = attributes.item(i);
- String name = attr.getNodeName();
- String value = attr.getNodeValue();
- fOutputWriter.writeln(name + "=[" + value + "]");
- }
-
- structuredDocument.replaceText(null, 8, 1, "");
-
- printSource(model);
- printTree(model);
-
- a = (Element) document.getFirstChild();
- attributes = a.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attr = attributes.item(i);
- String name = attr.getNodeName();
- String value = attr.getNodeValue();
- fOutputWriter.writeln(name + "=[" + value + "]");
- }
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest3.java
deleted file mode 100644
index be59eb676..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest3.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-public class ParserTest3 extends ModelTest {
- /**
- * Constructor for ParserTest3.
- *
- * @param name
- */
- public ParserTest3(String name) {
- super(name);
- }
-
- public ParserTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ParserTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- //StructuredDocumentEvent event =
- structuredDocument.replaceText(null, 0, 0, "<a b >");
- // dont's print instance of event, or many tests will fail when
- // event class is changed (exactly what is not needed for unit
- // tests!)
- // fOutputWriter.writeln(event.toString());
-
- printSource(model);
- printTree(model);
-
- Element a = (Element) document.getFirstChild();
- NamedNodeMap attributes = a.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attr = attributes.item(i);
- String name = attr.getNodeName();
- String value = attr.getNodeValue();
- fOutputWriter.writeln(name + "=[" + value + "]");
- }
-
- StructuredDocumentEvent event2 = structuredDocument.replaceText(null, 4, 1, "");
- // I removed this part of output, since renaming class or package
- // will cause test to fail!
- fOutputWriter.writeln(event2.toString());
-
- printSource(model);
- printTree(model);
-
- a = (Element) document.getFirstChild();
- attributes = a.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Node attr = attributes.item(i);
- String name = attr.getNodeName();
- String value = attr.getNodeValue();
- fOutputWriter.writeln(name + "=[" + value + "]");
- }
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest4.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest4.java
deleted file mode 100644
index 4d6e60c29..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/ParserTest4.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class ParserTest4 extends ModelTest {
- /**
- * Constructor for ParserTest4.
- *
- * @param name
- */
- public ParserTest4(String name) {
- super(name);
- }
-
- public ParserTest4() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new ParserTest4().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- //Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<a>\n\n<% a %>\n<% b %>\n</a>");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 4, 0, "<");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 5, 0, "b");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 6, 0, "c");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 7, 0, "d");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 8, 0, "e");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 9, 0, ">");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest.java
deleted file mode 100644
index 7b4d018ef..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Text;
-
-public class SourceTest extends ModelTest {
- /**
- * Constructor for SourceTest.
- *
- * @param name
- */
- public SourceTest(String name) {
- super(name);
- }
-
- public SourceTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SourceTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Text t = document.createTextNode("t");
- document.appendChild(t);
- SourceValidator validator = new SourceValidator(t);
-
- String source = null;
- String result = null;
-
- source = "aaa<bbb>ccc";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "aaa&amp;\"'bbb&gt;&lt;ccc&quot;&#64;";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "&amp;&&";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "&bbb&<>ccc";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "&unk;&unk";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest2.java
deleted file mode 100644
index 96bbec3ce..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest2.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class SourceTest2 extends ModelTest {
- /**
- * Constructor for SourceTest2.
- *
- * @param name
- */
- public SourceTest2(String name) {
- super(name);
- }
-
- public SourceTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SourceTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- Attr b = document.createAttribute("b");
- a.setAttributeNode(b);
- document.appendChild(a);
- SourceValidator validator = new SourceValidator(b);
-
- String source = null;
- String result = null;
-
- source = "aaa<bbb>ccc";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "aaa&amp;bbb&gt;&lt;ccc&quot;&#64;";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "&amp;&&";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "\"aaa\"";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "\"a'a\"";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest3.java
deleted file mode 100644
index 3d9fa8400..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SourceTest3.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.document.SourceValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class SourceTest3 extends ModelTest {
- /**
- * Constructor for SourceTest3.
- *
- * @param name
- */
- public SourceTest3(String name) {
- super(name);
- }
-
- public SourceTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SourceTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- Attr b = document.createAttribute("b");
- a.setAttributeNode(b);
- document.appendChild(a);
- SourceValidator validator = new SourceValidator(b);
-
- String source = null;
- String result = null;
-
- source = "<% aaa %><%= bbb %>/<%! ccc %>ddd";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = "<% aaa";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- source = ">< % aaa %>";
- fOutputWriter.writeln("source: " + source);
- try {
- validator.validateSource(source);
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
- result = validator.convertSource(source);
- fOutputWriter.writeln("result: " + result);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest.java
deleted file mode 100644
index efb9deb09..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest extends ModelTest {
- /**
- * Constructor for SplitTextTest.
- *
- * @param name
- */
- public SplitTextTest(String name) {
- super(name);
- }
-
- public SplitTextTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aabbbbccc");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = text.splitText(2);
-
- printSource(model);
- printTree(model);
-
- Text text3 = text2.splitText(4);
-
- printSource(model);
- printTree(model);
-
- p.removeChild(text2);
-
- printSource(model);
- printTree(model);
-
- text.appendData("ddddddd");
-
- printSource(model);
- printTree(model);
-
- text3.appendData("eee");
-
- printSource(model);
- printTree(model);
-
- p.insertBefore(text2, text3);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest2.java
deleted file mode 100644
index fc09d0cd3..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest2.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest2 extends ModelTest {
- /**
- * Constructor for SplitTextTest2.
- *
- * @param name
- */
- public SplitTextTest2(String name) {
- super(name);
- }
-
- public SplitTextTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aabbbbccc");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = text.splitText(2);
-
- printSource(model);
- printTree(model);
-
- Text text3 = text2.splitText(4);
-
- printSource(model);
- printTree(model);
-
- p.removeChild(text2);
-
- printSource(model);
- printTree(model);
-
- Element b = document.createElement("B");
- b.appendChild(text2);
- p.insertBefore(b, text3);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest3.java
deleted file mode 100644
index 9eb3cc121..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest3.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest3 extends ModelTest {
- /**
- * Constructor for SplitTextTest3.
- *
- * @param name
- */
- public SplitTextTest3(String name) {
- super(name);
- }
-
- public SplitTextTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aa");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Element b = document.createElement("B");
- Text text2 = document.createTextNode("bbbb");
- b.appendChild(text2);
- p.appendChild(b);
-
- printSource(model);
- printTree(model);
-
- Text text3 = document.createTextNode("ccc");
- p.appendChild(text3);
-
- printSource(model);
- printTree(model);
-
- p.removeChild(b);
-
- printSource(model);
- printTree(model);
-
- p.insertBefore(b, text3);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
-
- }
- finally {
- model.releaseFromEdit();
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest4.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest4.java
deleted file mode 100644
index e7eb96ce2..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest4.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest4 extends ModelTest {
- /**
- * Constructor for SplitTextTest4.
- *
- * @param name
- */
- public SplitTextTest4(String name) {
- super(name);
- }
-
- public SplitTextTest4() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest4().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.appendData("aaa");
-
- printSource(model);
- printTree(model);
-
- text.deleteData(0, 3);
-
- printSource(model);
- printTree(model);
-
- Text text2 = document.createTextNode("cccc");
- p.insertBefore(text2, text);
-
- printSource(model);
- printTree(model);
-
- text.appendData("aaa");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
-
-
- }
- finally {
- model.releaseFromEdit();
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest5.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest5.java
deleted file mode 100644
index 37861f4ea..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest5.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest5 extends ModelTest {
- /**
- * Constructor for SplitTextTest5.
- *
- * @param name
- */
- public SplitTextTest5(String name) {
- super(name);
- }
-
- public SplitTextTest5() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest5().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aabbbbccc");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Text text2 = text.splitText(6);
-
- printSource(model);
- printTree(model);
-
- Element br = document.createElement("BR");
- p.insertBefore(br, text2);
-
- printSource(model);
- printTree(model);
-
- text2.setData("cccd");
-
- printSource(model);
- printTree(model);
-
- text2.setData("cccde");
-
- printSource(model);
- printTree(model);
-
- Text text3 = text.splitText(2);
- Element b = document.createElement("B");
- b.appendChild(text3);
- p.insertBefore(b, br);
-
- printSource(model);
- printTree(model);
-
- Text text4 = text2.splitText(3);
- Element i = document.createElement("I");
- i.appendChild(text2);
- p.insertBefore(i, text4);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
-
- }
- finally {
- model.releaseFromEdit();
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest6.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest6.java
deleted file mode 100644
index 165f429ae..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest6.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest6 extends ModelTest {
- /**
- * Constructor for SplitTextTest6.
- *
- * @param name
- */
- public SplitTextTest6(String name) {
- super(name);
- }
-
- public SplitTextTest6() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest6().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aabbbbccc");
- p.appendChild(text);
- Text text2 = text.splitText(2);
- // ==> // Text text3 =
- text2.splitText(4);
-
- printSource(model);
- printTree(model);
-
- text2.setData("bbbbd");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest7.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest7.java
deleted file mode 100644
index 31ab275ba..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest7.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest7 extends ModelTest {
- /**
- * Constructor for SplitTextTest7.
- *
- * @param name
- */
- public SplitTextTest7(String name) {
- super(name);
- }
-
- public SplitTextTest7() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest7().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aaaa");
- Text text2 = document.createTextNode("bbbb");
- p.appendChild(text);
- p.appendChild(text2);
-
- printSource(model);
- printTree(model);
-
-
- // delete accross node boundry
- model.getStructuredDocument().replaceText(this, 6, 3, "");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest8.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest8.java
deleted file mode 100644
index 2a94e4410..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/SplitTextTest8.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class SplitTextTest8 extends ModelTest {
- /**
- * Constructor for SplitTextTest8.
- *
- * @param name
- */
- public SplitTextTest8(String name) {
- super(name);
- }
-
- public SplitTextTest8() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new SplitTextTest8().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Text text = document.createTextNode("aaaa");
- Text text2 = document.createTextNode("bbbb");
- p.appendChild(text);
- p.appendChild(text2);
-
- printSource(model);
- printTree(model);
-
-
- // delete accross node boundry
- model.getStructuredDocument().replaceText(this, 4, 6, "");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TableTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TableTest.java
deleted file mode 100644
index 02851e78a..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TableTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class TableTest extends ModelTest {
- /**
- * Constructor for TableTest.
- * @param name
- */
- public TableTest(String name) {
- super(name);
- }
-
- public TableTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new TableTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element html = document.createElement("HTML");
- document.appendChild(html);
-
- printSource(model);
- printTree(model);
-
- Element body = document.createElement("BODY");
- html.appendChild(body);
-
- printSource(model);
- printTree(model);
-
- Element table = document.createElement("TABLE");
- table.setAttribute("border", "1");
- Element td = null;
- for (int row = 0; row < 2; row++) {
- Element tr = document.createElement("TR");
- table.appendChild(tr);
- for (int col = 0; col < 2; col++) {
- td = document.createElement("TD");
- tr.appendChild(td);
- }
- }
- body.appendChild(table);
-
- printSource(model);
- printTree(model);
-
- Element font = document.createElement("FONT");
- font.setAttribute("color", "red");
- Text text = document.createTextNode("text");
- font.appendChild(text);
- td.appendChild(font);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest.java
deleted file mode 100644
index 125ac1983..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class TextTest extends ModelTest {
- /**
- * Constructor for TextTest.
- *
- * @param name
- */
- public TextTest(String name) {
- super(name);
- }
-
- public TextTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new TextTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- CharacterData text = document.createTextNode("text");
- a.appendChild(text);
-
- text.setData("hello &lt;");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(text.getData());
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest2.java
deleted file mode 100644
index 593e61a1d..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest2.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class TextTest2 extends ModelTest {
- /**
- * Constructor for TextTest2.
- *
- * @param name
- */
- public TextTest2(String name) {
- super(name);
- }
-
- public TextTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new TextTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- CharacterData text = document.createTextNode("text");
- a.appendChild(text);
-
- text.setNodeValue("hello &lt;");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln(text.getNodeValue());
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest3.java
deleted file mode 100644
index ab5d11a57..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/TextTest3.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.document.InvalidCharacterException;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class TextTest3 extends ModelTest {
- /**
- * Constructor for TextTest3.
- *
- * @param name
- */
- public TextTest3(String name) {
- super(name);
- }
-
- public TextTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new TextTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- IDOMNode text = (IDOMNode) document.createTextNode("text");
- a.appendChild(text);
-
- try {
- text.setSource("hello <");
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
-
- printSource(model);
- printTree(model);
-
- try {
- text.setSource("hello &lt;");
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
-
- printSource(model);
- printTree(model);
-
- try {
- text.setSource("hello &unk;");
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
-
- printSource(model);
- printTree(model);
-
- try {
- text.setSource("hello &#65;");
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
-
- printSource(model);
- printTree(model);
-
- try {
- text.setSource("hello & good-bye");
- }
- catch (InvalidCharacterException ex) {
- fOutputWriter.writeln(ex.getMessage());
- }
-
- printSource(model);
- printTree(model);
-
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest.java
deleted file mode 100644
index 805965ef6..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest extends ModelTest {
- /**
- * Constructor for UpdaterTest.
- *
- * @param name
- */
- public UpdaterTest(String name) {
- super(name);
- }
-
- public UpdaterTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element html = document.createElement("HTML");
- document.appendChild(html);
-
- printSource(model);
- printTree(model);
-
- Element body = document.createElement("BODY");
- html.appendChild(body);
-
- printSource(model);
- printTree(model);
-
- Element p = document.createElement("P");
- body.appendChild(p);
-
- printSource(model);
- printTree(model);
-
- Text text = document.createTextNode("text");
- p.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- Element br = document.createElement("BR");
- p.insertBefore(br, text);
-
- printSource(model);
- printTree(model);
-
- Element img = document.createElement("IMG");
- p.appendChild(img);
-
- printSource(model);
- printTree(model);
-
- p.removeChild(text);
-
- printSource(model);
- printTree(model);
-
- p.insertBefore(text, img);
-
- printSource(model);
- printTree(model);
-
- body.removeChild(p);
-
- printSource(model);
- printTree(model);
-
- body.appendChild(p);
-
- printSource(model);
- printTree(model);
-
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest10.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest10.java
deleted file mode 100644
index d8b6a90f2..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest10.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import java.util.Iterator;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class UpdaterTest10 extends ModelTest {
- /**
- * Constructor for UpdaterTest10.
- *
- * @param name
- */
- public UpdaterTest10(String name) {
- super(name);
- }
-
- public UpdaterTest10() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest10().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- a.setAttribute("b", "c");
- Element b = document.createElement("b");
- a.appendChild(b);
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln("IStructuredDocumentRegion:");
- IDOMNode node = (IDOMNode) b;
- IStructuredDocumentRegion flatNode = node.getStartStructuredDocumentRegion();
- fOutputWriter.writeln(flatNode.getText());
- Iterator e = flatNode.getRegions().iterator();
- int i = 0;
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- boolean ok = true; // no longer has parent.
- // //(region.getParent() == flatNode);
- fOutputWriter.writeln(i + "(" + flatNode.getText(region) + ")" + ok);
- }
- fOutputWriter.writeln("");
-
- b.setAttribute("c", "d");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln("IStructuredDocumentRegion:");
- node = (IDOMNode) b;
- flatNode = node.getStartStructuredDocumentRegion();
- fOutputWriter.writeln(flatNode.getText());
- e = flatNode.getRegions().iterator();
- i = 0;
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- boolean ok = true; // no longer has parent.
- // (region.getParent() == flatNode);
- fOutputWriter.writeln(i + "(" + flatNode.getText(region) + ")" + ok);
- }
- fOutputWriter.writeln("");
-
- a.setAttribute("b", "cd");
-
- printSource(model);
- printTree(model);
-
- fOutputWriter.writeln("IStructuredDocumentRegion:");
- node = (IDOMNode) b;
- flatNode = node.getStartStructuredDocumentRegion();
- fOutputWriter.writeln(flatNode.getText());
- e = flatNode.getRegions().iterator();
- i = 0;
- while (e.hasNext()) {
- ITextRegion region = (ITextRegion) e.next();
- boolean ok = true; // (region.getParent() == flatNode);
- fOutputWriter.writeln(i + "(" + flatNode.getText(region) + ")" + ok);
- }
- fOutputWriter.writeln("");
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest11.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest11.java
deleted file mode 100644
index baf6fbbea..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest11.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest11 extends ModelTest {
- /**
- * Constructor for UpdaterTest11.
- *
- * @param name
- */
- public UpdaterTest11(String name) {
- super(name);
- }
-
- public UpdaterTest11() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest11().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- Text text = document.createTextNode("b");
- a.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- text.setData("b");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest12.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest12.java
deleted file mode 100644
index 1d313ac05..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest12.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class UpdaterTest12 extends ModelTest {
- /**
- * Constructor for UpdaterTest12.
- *
- * @param name
- */
- public UpdaterTest12(String name) {
- super(name);
- }
-
- public UpdaterTest12() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest12().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
-
- printSource(model);
- printTree(model);
-
- Element a2 = document.createElement("a");
- document.insertBefore(a2, a);
-
- printSource(model);
- printTree(model);
-
- document.removeChild(a2);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest13.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest13.java
deleted file mode 100644
index 81341762e..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest13.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest13 extends ModelTest {
- /**
- * Constructor for UpdaterTest13.
- *
- * @param name
- */
- public UpdaterTest13(String name) {
- super(name);
- }
-
- public UpdaterTest13() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest13().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<a>\r\n<b>\r\n</a>");
-
- Element a = (Element) document.getFirstChild();
- Element b = (Element) a.getLastChild();
- Text text = document.createTextNode(" ");
- a.appendChild(text);
-
- printSource(model);
- printTree(model);
-
- a.removeChild(b);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest14.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest14.java
deleted file mode 100644
index a27c9ea17..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest14.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class UpdaterTest14 extends ModelTest {
- /**
- * Constructor for UpdaterTest14.
- *
- * @param name
- */
- public UpdaterTest14(String name) {
- super(name);
- }
-
- public UpdaterTest14() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest14().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- //Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<%= aaaa %>");
-
- printSource(model);
- printTree(model);
-
- structuredDocument.replaceText(null, 2, 0, " ");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest15.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest15.java
deleted file mode 100644
index 532b11c80..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest15.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-
-public class UpdaterTest15 extends ModelTest {
- /**
- * Constructor for UpdaterTest15.
- *
- * @param name
- */
- public UpdaterTest15(String name) {
- super(name);
- }
-
- public UpdaterTest15() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest15().testModel();
- }
-
- public void testModel() {
- // XML case
- IDOMModel model = createXMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- //Document document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<%= aaaa %><P>");
-
- printSource(model);
- printTree(model);
-
- // HTML case
- model = createHTMLModel();
- structuredDocument = model.getStructuredDocument();
- //document = model.getDocument();
-
- structuredDocument.replaceText(null, 0, 0, "<%= aaaa %><P>");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest2.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest2.java
deleted file mode 100644
index 4b5da1c28..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest2.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest2 extends ModelTest {
- /**
- * Constructor for UpdaterTest2.
- *
- * @param name
- */
- public UpdaterTest2(String name) {
- super(name);
- }
-
- public UpdaterTest2() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest2().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- Document document = model.getDocument();
-
- structuredDocument.setText(this, "<HTML>\r\n<HEAD></HEAD>\r\n<BODY></BODY>\r\n</HTML>\r\n");
- Element html = (Element) document.getFirstChild();
- Element head = (Element) html.getFirstChild().getNextSibling();
-
- printSource(model);
- printTree(model);
-
- Element meta = document.createElement("META");
- meta.setAttribute("name", "GENERATOR");
- meta.setAttribute("content", "Updater Test 2");
- head.appendChild(meta);
- Text text4 = document.createTextNode("\r\n");
- head.insertBefore(text4, meta);
- Text text5 = document.createTextNode("\r\n");
- head.appendChild(text5);
-
- printSource(model);
- printTree(model);
-
- Element title = document.createElement("TITLE");
- Text text6 = document.createTextNode("");
- title.appendChild(text6);
- head.appendChild(title);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest3.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest3.java
deleted file mode 100644
index 7e8fb76ea..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest3.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest3 extends ModelTest {
- /**
- * Constructor for UpdaterTest3.
- *
- * @param name
- */
- public UpdaterTest3(String name) {
- super(name);
- }
-
- public UpdaterTest3() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest3().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- Element b = document.createElement("b");
- a.appendChild(b);
-
- printSource(model);
- printTree(model);
-
- Text t1 = document.createTextNode("\n");
- a.insertBefore(t1, b);
-
- printSource(model);
- printTree(model);
-
- Text t2 = document.createTextNode("\n");
- a.appendChild(t2);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest4.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest4.java
deleted file mode 100644
index 964e56517..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest4.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest4 extends ModelTest {
- /**
- * Constructor for UpdaterTest4.
- *
- * @param name
- */
- public UpdaterTest4(String name) {
- super(name);
- }
-
- public UpdaterTest4() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest4().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- Text t = document.createTextNode("b");
- a.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- t.setData("b");
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest5.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest5.java
deleted file mode 100644
index c32e9f496..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest5.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class UpdaterTest5 extends ModelTest {
- /**
- * Constructor for UpdaterTest5.
- *
- * @param name
- */
- public UpdaterTest5(String name) {
- super(name);
- }
-
- public UpdaterTest5() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest5().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<a>&apos;</a>");
-
- printSource(model);
- printTree(model);
-
- Node a = document.getFirstChild();
- Node t = a.getFirstChild();
- a.removeChild(t);
- a.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest6.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest6.java
deleted file mode 100644
index ca2839f68..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest6.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest6 extends ModelTest {
- /**
- * Constructor for UpdaterTest6.
- *
- * @param name
- */
- public UpdaterTest6(String name) {
- super(name);
- }
-
- public UpdaterTest6() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest6().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element a = document.createElement("a");
- document.appendChild(a);
- Text t = document.createTextNode("b");
- a.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- a.removeChild(t);
-
- printSource(model);
- printTree(model);
-
- a.appendChild(t);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest7.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest7.java
deleted file mode 100644
index 2c041889b..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest7.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class UpdaterTest7 extends ModelTest {
- /**
- * Constructor for UpdaterTest7.
- *
- * @param name
- */
- public UpdaterTest7(String name) {
- super(name);
- }
-
- public UpdaterTest7() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest7().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
- Element b = document.createElement("B");
- p.appendChild(b);
-
- printSource(model);
- printTree(model);
-
- Element b2 = document.createElement("B");
- p.insertBefore(b2, b);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest8.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest8.java
deleted file mode 100644
index c54f47adb..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest8.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-public class UpdaterTest8 extends ModelTest {
- /**
- * Constructor for UpdaterTest8.
- *
- * @param name
- */
- public UpdaterTest8(String name) {
- super(name);
- }
-
- public UpdaterTest8() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest8().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
-
- Element p = document.createElement("P");
- document.appendChild(p);
-
- printSource(model);
- printTree(model);
-
- Element p2 = document.createElement("P");
- document.appendChild(p2);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
- }
- finally {
- model.releaseFromEdit();
- }
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest9.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest9.java
deleted file mode 100644
index 92f9165c0..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTest9.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-
-public class UpdaterTest9 extends ModelTest {
- /**
- * Constructor for UpdaterTest9.
- *
- * @param name
- */
- public UpdaterTest9(String name) {
- super(name);
- }
-
- public UpdaterTest9() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTest9().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel();
- try {
- Document document = model.getDocument();
-
- Element style = document.createElement("STYLE");
- document.appendChild(style);
-
- printSource(model);
- printTree(model);
-
- Text text2 = document.createTextNode("p");
- style.appendChild(text2);
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTestRegionChanged.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTestRegionChanged.java
deleted file mode 100644
index 8ba3c2ec3..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/UpdaterTestRegionChanged.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser;
-
-import org.eclipse.wst.sse.core.internal.provisional.events.RegionChangedEvent;
-import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class UpdaterTestRegionChanged extends ModelTest {
- /**
- * Constructor for UpdaterTestRegionChanged.
- *
- * @param name
- */
- public UpdaterTestRegionChanged(String name) {
- super(name);
- }
-
- public UpdaterTestRegionChanged() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new UpdaterTestRegionChanged().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createXMLModel();
- try {
- Document document = model.getDocument();
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- structuredDocument.setText(this, "<a b= c></a>");
-
- Node before = document.getFirstChild();
-
- StructuredDocumentEvent fmEvent = structuredDocument.replaceText(null, 5, 1, "");
- if (fmEvent instanceof RegionChangedEvent) {
- fOutputWriter.writeln("ok: RegionChangedEvent");
- }
- else {
- fOutputWriter.writeln("not ok: " + fmEvent.getClass().getName());
- }
-
- Node after = document.getFirstChild();
-
- if (before != after) {
- fOutputWriter.writeln("not ok: Node replaced");
- }
- else {
- fOutputWriter.writeln("ok: Node not replaced");
- }
-
- saveAndCompareTestResults();
- }
- finally {
- model.releaseFromEdit();
- }
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/css/StyleTest.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/css/StyleTest.java
deleted file mode 100644
index 29a582e0e..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/parser/css/StyleTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.parser.css;
-
-import org.eclipse.wst.html.core.tests.parser.ModelTest;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Text;
-import org.w3c.dom.css.CSSStyleSheet;
-import org.w3c.dom.stylesheets.DocumentStyle;
-import org.w3c.dom.stylesheets.LinkStyle;
-import org.w3c.dom.stylesheets.StyleSheetList;
-
-public class StyleTest extends ModelTest {
- /**
- * Constructor for StyleTest.
- * @param name
- */
- public StyleTest(String name) {
- super(name);
- }
-
- public StyleTest() {
- super();
- }
-
- public static void main(java.lang.String[] args) {
- new StyleTest().testModel();
- }
-
- public void testModel() {
- IDOMModel model = createHTMLModel(); //new HTMLModelImpl();
- Document document = model.getDocument();
-
- Element style = document.createElement("STYLE");
- Text text = document.createTextNode("BODY { color : red; } P { color : green; } B { color : blue; }");
- style.appendChild(text);
- document.appendChild(style);
-
- printSource(model);
- printTree(model);
-
- DocumentStyle ds = (DocumentStyle) document;
- StyleSheetList ssl = ds.getStyleSheets();
- if (ssl.getLength() > 0) {
- CSSStyleSheet ss = (CSSStyleSheet) ssl.item(0);
- ss.deleteRule(1);
- }
-
- printSource(model);
- printTree(model);
-
- LinkStyle ls = (LinkStyle) style;
- CSSStyleSheet ss2 = (CSSStyleSheet) ls.getSheet();
- if (ss2 != null) {
- ss2.deleteRule(0);
- }
-
- printSource(model);
- printTree(model);
-
- saveAndCompareTestResults();
-
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/TestStructuredPartitionerHTML.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/TestStructuredPartitionerHTML.java
deleted file mode 100644
index fcde0d514..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/TestStructuredPartitionerHTML.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.text;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringBufferInputStream;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitioning;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredTextPartitioner;
-import org.eclipse.wst.sse.core.utils.StringUtils;
-import org.eclipse.wst.xml.core.text.IXMLPartitions;
-
-import com.ibm.icu.text.DecimalFormat;
-
-public class TestStructuredPartitionerHTML extends TestCase {
-
- private boolean DEBUG_PRINT_RESULT = false;
- protected ITypedRegion[] partitions = null;
-
- private boolean useFormatter = true;
- protected DecimalFormat formatter;
-
- public TestStructuredPartitionerHTML(String name) {
- super(name);
- if (DEBUG_PRINT_RESULT && useFormatter)
- formatter = new DecimalFormat();
- }
-
- /**
- * must release model (from edit) after
- * @param filename relative to this class (TestStructuredPartitioner)
- */
- private IStructuredModel getModelForEdit(String filename) {
-
- IStructuredModel model = null;
- try {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- InputStream inStream = getClass().getResourceAsStream(filename);
- if (inStream == null)
- inStream = new StringBufferInputStream("");
- model = modelManager.getModelForEdit(filename, inStream, null);
- }
- catch (IOException ex) {
- ex.printStackTrace();
- }
- return model;
- }
-
- public void testDisconnectConnect() {
- IStructuredModel model = null;
- try {
- model =getModelForEdit("testfiles/html/example01.xml");
- if(model != null) {
- IStructuredDocument sDoc = model.getStructuredDocument();
- assertTrue("sDoc implementation not instance of IDocumentExtension3", sDoc instanceof IDocumentExtension3);
-
- IDocumentPartitioner partitioner = ((IDocumentExtension3)sDoc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
- assertTrue("partitioner doesn't implement IStructuredTextPartitioner", partitioner instanceof IStructuredTextPartitioner);
-
- IStructuredTextPartitioner stp = (IStructuredTextPartitioner)partitioner;
- assertNotNull("partitioner was null for sDoc:" + sDoc, partitioner);
- try {
- stp.disconnect();
- }
- catch(Exception e) {
- assertTrue("problem disconnecting w/:" +sDoc + "/n" + e, false);
- }
- try {
- stp.connect(sDoc);
- }
- catch(Exception e) {
- assertTrue("problem connecting w/:" + sDoc + "/n" + e, false);
- }
- }
- else {
- assertTrue("could not retrieve structured model", false);
- }
- }
- finally {
- if(model != null)
- model.releaseFromEdit();
- }
- }
-
- public void testGetDefaultPartitionType() {
- IStructuredModel model = null;
- try {
- model =getModelForEdit("testfiles/html/example01.xml");
- if(model != null) {
- IStructuredDocument sDoc = model.getStructuredDocument();
- assertTrue("sDoc implementation not instance of IDocumentExtension3", sDoc instanceof IDocumentExtension3);
-
- IDocumentPartitioner partitioner = ((IDocumentExtension3)sDoc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
- assertTrue("partitioner doesn't implement IStructuredTextPartitioner", partitioner instanceof IStructuredTextPartitioner);
-
- IStructuredTextPartitioner stp = (IStructuredTextPartitioner)partitioner;
- String defaultPartitionType = stp.getDefaultPartitionType();
- assertTrue("wrong default partition type was: [" + defaultPartitionType + "] should be: [" + IXMLPartitions.XML_DEFAULT + "]", defaultPartitionType.equals(IXMLPartitions.XML_DEFAULT));
- }
- else {
- assertTrue("could not retrieve structured model", false);
- }
- }
- finally {
- if(model != null)
- model.releaseFromEdit();
- }
- }
-
- public void testGetPartitionType() {
- IStructuredModel model = null;
- try {
- model =getModelForEdit("testfiles/html/example01.xml");
- if(model != null) {
- IStructuredDocument sDoc = model.getStructuredDocument();
- assertTrue("sDoc implementation not instance of IDocumentExtension3", sDoc instanceof IDocumentExtension3);
-
- IDocumentPartitioner partitioner = ((IDocumentExtension3)sDoc).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
- assertTrue("paritioner doesn't implement IStructuredTextPartitioner", partitioner instanceof IStructuredTextPartitioner);
-
- IStructuredTextPartitioner stp = (IStructuredTextPartitioner)partitioner;
- String defaultPartitionType = stp.getDefaultPartitionType();
- assertTrue("wrong default partition type was: [" + defaultPartitionType + "] should be: [" + IXMLPartitions.XML_DEFAULT + "]", defaultPartitionType.equals(IXMLPartitions.XML_DEFAULT));
- }
- else {
- assertTrue("could not retrieve structured model", false);
- }
- }
- finally {
- if(model != null)
- model.releaseFromEdit();
- }
- }
-
- public void testHTML1() throws IOException, BadLocationException {
- int expectedPartitions = 4;
- int nPartitions = doComputePartitioningTest("testfiles/html/example01.html");
- assertTrue("wrong number of partitions", nPartitions == expectedPartitions);
- checkSeams();
- verifyPartitionTypes(partitions, new String[]{IHTMLPartitions.HTML_DECLARATION, IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.HTML_COMMENT, IHTMLPartitions.HTML_DEFAULT});
- }
-
- public void testHTML2() throws IOException, BadLocationException {
- int expectedPartitions = 7;
- //TODO Nitin, we need to review the Unknown to Script change (8/1/03, 9:00PM)
- int nPartitions = doComputePartitioningTest("testfiles/html/example02.html");
- assertTrue("wrong number of partitions", nPartitions == expectedPartitions);
- checkSeams();
- verifyPartitionTypes(partitions, new String[]{IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.SCRIPT, IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.SCRIPT, IHTMLPartitions.HTML_DEFAULT, IHTMLPartitions.SCRIPT, IHTMLPartitions.HTML_DEFAULT});
- }
-
- public void testHTML3() throws IOException, BadLocationException {
- int expectedPartitions = 1;
- String file = "testfiles/html/example03.html";
- int nPartitions = doComputePartitioningTest(file);
- assertTrue("wrong number of partitions", nPartitions == expectedPartitions);
- checkSeams();
- verifyPartitionTypes(partitions, new String[]{IHTMLPartitions.HTML_DEFAULT});
-
- // 121 if CRLF
- // ITypedRegion scriptPartition = getPartitionTest(file, 121);
- // 116 if LF or CR only
- // ITypedRegion scriptPartition = getPartitionTest(file, 121);
-
- ITypedRegion part1 = getPartitionTest(file, 121);
- ITypedRegion part2 = getPartitionTest(file, 116);
-
-// assertEquals("partition is wrong type!", scriptPartition.getType(), IHTMLPartitions.ST_SCRIPT);
- // the critical position is surrounded with HTML > 5 characters in either direction; this should be good enough
- assertTrue("partition is wrong type! :(" + part1.getType() + "|" + part2.getType() + ")", part1.getType().equals(IHTMLPartitions.SCRIPT) || part2.getType().equals(IHTMLPartitions.SCRIPT));
- assertTrue("partition is not zero length!", (part1.getLength() == 0 || part2.getLength() == 0));
- }
-
- /**
- * Ensure that the current list of partitions are all adjacent to one another
- */
- protected void checkSeams() {
- if (partitions == null)
- return;
- int offset = 0;
- for (int i = 0; i < partitions.length; i++) {
- assertEquals("partitions are not contiguous!", partitions[i].getOffset(), offset);
- offset = partitions[i].getOffset() + partitions[i].getLength();
- }
- }
-
- /**
- * Compute the partitions for the given filename using the default partitioner
- * for that file type.
- *
- * @param filename
- * @return int
- * @throws IOException
- * @throws BadLocationException
- */
- protected int doComputePartitioningTest(String filename) throws IOException, BadLocationException {
-
- IModelManager modelManager = StructuredModelManager.getModelManager();
- InputStream inStream = getClass().getResourceAsStream(filename);
- if (inStream == null)
- inStream = new StringBufferInputStream("");
- IStructuredModel model = modelManager.getModelForEdit(filename, inStream, null);
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
- if (DEBUG_PRINT_RESULT && useFormatter) {
- double baseTen = Math.log(10);
- formatter.setMinimumIntegerDigits((int) (Math.log(structuredDocument.getLength()) / baseTen) + 1);
- formatter.setGroupingUsed(false);
- }
-
- partitions = structuredDocument.computePartitioning(0, structuredDocument.getLength());
- if (DEBUG_PRINT_RESULT) {
- String contents = null;
-
- System.out.println("\nfilename: " + filename);
- for (int i = 0; i < partitions.length; i++) {
- try {
- contents = structuredDocument.get(partitions[i].getOffset(), partitions[i].getLength());
- }
- catch (BadLocationException e) {
- contents = "*error*";
- }
- if (useFormatter)
- System.out.println(formatter.format(partitions[i].getOffset()) + ":" + formatter.format(partitions[i].getLength()) + " - " + partitions[i].getType() + " [" + StringUtils.escape(contents) + "]");
- else
- System.out.println(partitions[i] + " [" + StringUtils.escape(contents) + "]");
- }
- }
- checkSeams();
- model.releaseFromEdit();
- inStream.close();
-
- if (partitions == null)
- return -1;
- return partitions.length;
- }
-
- /**
- * Retrieves the single partition at the given offset for the given file, using the
- * default partitioner for that file type. This test allows for verifying the zero-length
- * partitioning behavior.
- *
- * @param filename
- * @param offset
- * @return ITypedRegion
- * @throws IOException
- * @throws BadLocationException
- */
- protected ITypedRegion getPartitionTest(String filename, int offset) throws IOException, BadLocationException {
- IModelManager modelManager = StructuredModelManager.getModelManager();
- InputStream inStream = getClass().getResourceAsStream(filename);
- IStructuredModel model = modelManager.getModelForEdit(filename, inStream, null);
-
- IStructuredDocument structuredDocument = model.getStructuredDocument();
-
- partitions = null;
- ITypedRegion partition = structuredDocument.getPartition(offset);
- if (DEBUG_PRINT_RESULT) {
- String contents = null;
-
- System.out.println("\nfilename: " + filename);
- try {
- contents = structuredDocument.get(partition.getOffset(), partition.getLength());
- }
- catch (BadLocationException e) {
- contents = "*error*";
- }
- System.out.println(partition + " [" + StringUtils.escape(contents) + "]");
- }
- model.releaseFromEdit();
- inStream.close();
-
- return partition;
- }
-
- /**
- * Verifies that the given partitions are of the given partition types
- * @param typedRegions
- * @param types
- */
- protected void verifyPartitionTypes(ITypedRegion actualTypedRegions[], String expectedTypes[]) {
- for (int i = 0; i < expectedTypes.length; i++)
- assertEquals("partition type mismatched", expectedTypes[i], actualTypedRegions[i].getType());
- }
-
- /**
- * Verifies that the given partitions begin at the given offsets
- * @param typedRegions
- * @param types
- */
- protected void verifyPartitionRegions(ITypedRegion typedRegions[], int offsets[]) {
- for (int i = 0; i < offsets.length; i++) {
- assertEquals("offset mismatched", typedRegions[i].getOffset(), offsets[i]);
- if (i > 0) {
- assertEquals("lengths misaligned", typedRegions[i].getOffset(), typedRegions[i - 1].getOffset() + typedRegions[i - 1].getLength());
- }
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example01.html b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example01.html
deleted file mode 100644
index 4a0ffe208..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example01.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE html SYSTEM nonsense>
-<html>
-<bo<!--comments-->dy>
-abcdefghijklmnopqrstuvwxyz
-</body></html>
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example02.html b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example02.html
deleted file mode 100644
index a0286c4e6..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example02.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html><head>
-<META creator=wssa/4.0pre119>
-<title>Script Tests</title>
-</head>
-<body>
-<Script language="javascript">
- protected void foo() { String value = "true"; return value; } </script>
-<Script type="text/jscript">
- protected void foo() { String value = "true"; return value; } </script>
-
-<SCRIPT> "foo" </SCRIPT>
-<a href="http://example.com/" name="ref" >Example</a>
-</body>
-</html>
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example03.html b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example03.html
deleted file mode 100644
index dc8daf360..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/text/testfiles/html/example03.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html><head>
-<META creator=wssa/4.0pre119>
-<title>Script Tests</title>
-</head>
-<body>
-<Script language="javascript"></SCRIPT>
-</body>
-</html>
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/CommonXML.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/CommonXML.java
deleted file mode 100644
index 94e16a24e..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/CommonXML.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.wst.html.core.tests.Logger;
-import org.w3c.dom.Document;
-
-/**
- */
-public class CommonXML {
-
- public synchronized static DocumentBuilder getDocumentBuilder() {
- DocumentBuilder result = null;
- try {
- result = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- return result;
- }
-
- public synchronized static DocumentBuilder getDocumentBuilder(boolean validating) {
- DocumentBuilder result = null;
- try {
- DocumentBuilderFactory instance = DocumentBuilderFactory.newInstance();
- instance.setValidating(validating);
- result = instance.newDocumentBuilder();
- }
- catch (ParserConfigurationException e) {
- Logger.logException(e);
- }
- return result;
- }
-
- public static void serialize(Document document, OutputStream ostream) throws IOException {
- Source domSource = new DOMSource(document);
- try {
- Transformer serializer = TransformerFactory.newInstance().newTransformer();
- try {
- serializer.setOutputProperty(OutputKeys.INDENT, "yes");
- serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
- serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-16");
- }
- catch (IllegalArgumentException e) {
- // unsupported properties
- }
- serializer.transform(domSource, new StreamResult(ostream));
- }
- catch (TransformerConfigurationException e) {
- throw new IOException(e.getMessage());
- }
- catch (TransformerFactoryConfigurationError e) {
- throw new IOException(e.getMessage());
- }
- catch (TransformerException e) {
- throw new IOException(e.getMessage());
- }
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/DateUtil.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/DateUtil.java
deleted file mode 100644
index e4d1834fd..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/DateUtil.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-/**
- * @author davidw
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
-public class DateUtil {
-
- /**
- * Constructor for AllTests.
- * @param name
- */
- private static String now = null;
-
-
- public static String now() {
- // just calculate once, so whole run as same timestamp
- if (DateUtil.now == null) {
- DateFormat format = new SimpleDateFormat("yyyy'-'MM'-'dd'-'kk'-'mm'-'ss");
- Calendar calendar = Calendar.getInstance();
- Date today = calendar.getTime();
- DateUtil.now = format.format(today);
- }
- return DateUtil.now;
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/FileUtil.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/FileUtil.java
deleted file mode 100644
index 587143875..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/FileUtil.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.encoding.util.NullInputStream;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.osgi.framework.Bundle;
-
-/**
- * @author davidw
- *
- */
-public class FileUtil {
- private static final String PLUGIN_ID = "org.eclipse.wst.html.core.tests";
- public static final String commonEOL = "\r\n";
- public static String fLineSeparator = System.getProperty("line.separator");
- public static String fPathSeparator = System.getProperty("path.separator");
- public static String fFileSeparator = System.getProperty("file.separator");
-
- static File previousResultsDirectory = null;
- static private String logSubDirectoryPath;
-
- private static boolean notTriedYet = true;
- static int uniqueNum = 0;
-
- public static class DirFilenameFilter implements FilenameFilter {
- String startOfAcceptableNames;
-
- public DirFilenameFilter(String startOfDirName) {
- startOfAcceptableNames = startOfDirName;
- }
-
- /**
- * @see java.io.FileFilter#accept(File)
- */
- public boolean accept(File pathname, String filename) {
- // we'll just assume if it starts with right key, it is a directory ... for now
- return filename.startsWith(startOfAcceptableNames);
- }
-
- }
-
- public static File getPreviousResultsDirectory(String directoryRootName) throws IOException {
- if (previousResultsDirectory == null && notTriedYet) {
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- URL url = bundle.getEntry("/"); //$NON-NLS-1$
- //String installPath = url.getPath();
- // add known file so URL method below can be used
- // (doesn't seem to work for directory?)
- URL totalURL = new URL(url, "plugin.xml");
- URL finalurl = FileLocator.toFileURL(totalURL);
- String finalFile = finalurl.getFile();
- File file = new File(finalFile);
- String finalPath = file.getParent();
- File pluginHomeDir = new File(finalPath);
- FilenameFilter dirFilter = new DirFilenameFilter(directoryRootName);
- File[] allDirs = pluginHomeDir.listFiles(dirFilter);
-
- // assume first in list is newest, then start looking with the
- // second item ... just to avoid "null" case checking
- if (allDirs.length > 0) {
- File currentNewest = allDirs[0];
- for (int i = 1; i < allDirs.length; i++) {
- File current = allDirs[i];
- // NOTE: we go by modified date, not by the actual time stamp in name.
- // This should work for all normal cases, but may not if someone does some
- // "funny" copying, or updating from repository.
- if (current.lastModified() > currentNewest.lastModified()) {
- currentNewest = current;
- }
- }
- previousResultsDirectory = currentNewest;
- }
- notTriedYet = false;
- }
- return previousResultsDirectory;
- }
-
- public static File makeFileFor(String directory, String filename, String testResultsDirectoryPrefix) throws IOException {
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- URL url = bundle.getEntry("/"); //$NON-NLS-1$
- URL localURL = FileLocator.toFileURL(url);
- String installPath = localURL.getPath();
- String totalDirectory = installPath + directory;
- String totalPath = totalDirectory + "/" + filename;
- URL totalURL = new URL(url, totalPath);
- //URL finalurl = Platform.asLocalURL(totalURL);
- String finalFile = totalURL.getFile();
- File file = new File(finalFile);
- String finalPath = file.getParent();
- File dir = new File(finalPath);
- if (!dir.exists()) {
- // a little safety net, be sure the previous newest directory
- // is initialized, just in case no one else has done so
- if (testResultsDirectoryPrefix != null && testResultsDirectoryPrefix.length() > 0) {
- FileUtil.getPreviousResultsDirectory(testResultsDirectoryPrefix);
- }
- // now its "safe" to make the new one
- dir.mkdirs();
- }
- return file;
- }
-
- /**
- * Just a general utility method
- * @param filename
- * @return String
- */
- public static String getExtension(String filename) {
- String extension = null;
- int dotPostion = filename.lastIndexOf('.');
- if (dotPostion > -1) {
- extension = filename.substring(dotPostion + 1);
- }
- else {
- extension = new String();
- }
- return extension;
- }
-
- /**
- * General purpose utility method to ensure the log
- * directory exists, and returns the name.
- */
- public static String getLogDirectory() {
- if (logSubDirectoryPath == null) {
- String mainDirectory = "/logs";
- File dir = new File(mainDirectory);
- ensureExists(dir);
- String subDirectory = TimestampUtil.timestamp();
- logSubDirectoryPath = mainDirectory + "/" + subDirectory;
- File subdir = new File(logSubDirectoryPath);
- ensureExists(subdir);
- }
- return logSubDirectoryPath;
- }
-
- public static void ensureExists(File dir) {
- if (!dir.exists()) {
- dir.mkdirs();
- }
- }
-
- public static String getPerformanceOutputLogName() {
- String result = null;
- String directoryName = FileUtil.getLogDirectory();
- String extension = ".out";
- String baseName = "sedTests";
- long now = System.currentTimeMillis();
- String nowStr = String.valueOf(now);
- result = directoryName + FileUtil.fFileSeparator + baseName + nowStr + extension;
- return result;
- }
- public static IDOMModel createHTMLModel() {
- IStructuredModel model = null;
- try {
-
- IModelManager modelManager = StructuredModelManager.getModelManager();
-
- model = modelManager.getModelForEdit("test" + uniqueNum++ + ".html", new NullInputStream(), null); //$NON-NLS-1$
-
- // always use the same line delimiter for these tests, regardless
- // of plaform or preference settings
- model.getStructuredDocument().setLineDelimiter(commonEOL);
-
-
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- return (IDOMModel) model;
-
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/StringCompareUtil.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/StringCompareUtil.java
deleted file mode 100644
index a33ba6a6c..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/StringCompareUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-public class StringCompareUtil {
-
- public boolean equalsIgnoreLineSeperator(String string1, String string2) {
-
- if (string1 == null)
- return false;
- if (string2 == null)
- return false;
-
- StringReader s1Reader = new StringReader(string1);
- StringReader s2Reader = new StringReader(string2);
-
- // assume true unless find evidence to the contrary
- boolean result = true;
- int s1Char = -1;
- int s2Char = -1;
- do {
-
- s1Char = getNextChar(s1Reader);
-
- s2Char = getNextChar(s2Reader);
-
- if (s1Char != s2Char) {
- result = false;
- break;
- }
- }
- while (s1Char != -1 && s2Char != -1);
-
- return result;
- }
-
- /**
- * Method getNextChar.
- * @param s1Reader
- * @return char
- */
- private int getNextChar(StringReader reader) {
- int nextChar = -1;
- try {
- nextChar = reader.read();
- while (isEOL(nextChar)) {
- nextChar = reader.read();
- }
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- return nextChar;
- }
-
- private boolean isEOL(int aChar) {
- return (aChar == '\n' || aChar == '\r');
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestRuntimeException.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestRuntimeException.java
deleted file mode 100644
index ad7d6cee7..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestRuntimeException.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-
-
-/**
- * The SourceEditingRuntimeException is often thrown by Source Editor methods when
- * a service we use throws a checked exception, but we want to convert and treat
- * as a runtime exception. (Such as BadLocationException is a common example).
- */
-public class TestRuntimeException extends RuntimeException {
- /**
- * Default <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1L;
- private Throwable originalException;
-
- public TestRuntimeException() {
- super();
- }
-
- public TestRuntimeException(String s) {
- super(s);
- }
-
- /**
- * This form of the constructor is used to wrapper another exception.
- */
- public TestRuntimeException(Throwable t) {
- super();
- originalException = t;
- }
-
- /**
- * This form of the constructor is used to wrapper another exception, but still
- * provide a new descriptive message.
- */
- public TestRuntimeException(Throwable t, String s) {
- super(s);
- originalException = t;
- }
-
- public String getMessage() {
- String result = super.getMessage();
- if ((result != null) && (!result.endsWith("."))) //$NON-NLS-1$
- result = result + "."; //$NON-NLS-1$
- if (originalException != null) {
- String embeddedMessage = originalException.getMessage();
- // not all exceptions (e.g. many NullPointer exception) have messages
- String originalError = "Original error:"; //$NON-NLS-1$
- if (embeddedMessage != null)
- result = result + " " + originalError + " " + embeddedMessage;//$NON-NLS-2$//$NON-NLS-1$
- else
- result = result + " " + originalError + " " + originalException.toString();//$NON-NLS-2$//$NON-NLS-1$
- }
- return result;
- }
-
- public Throwable getOriginalException() {
- return originalException;
- }
-
- public String toString() {
- // we don't put super.toString or getClass to "hide" that it was a
- // SourceEditing exception (otherwise, focus goes on that,
- // instead of original exception.
- String message = getMessage();
- // message should never be null ... but just in case
- return (message != null) ? message : super.toString();
-
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestWriter.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestWriter.java
deleted file mode 100644
index 593f562ca..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TestWriter.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import java.io.StringWriter;
-
-public class TestWriter extends StringWriter {
- // we don't really want to use the system EOL, since
- // we want a common once across platforms, CVS, etc.
- public final static String commonEOL = "\r\n";
-
- //System.getProperty("line.separator");
-
- public void writeln(String line) {
- write(line);
- write(commonEOL);
- }
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TimestampUtil.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TimestampUtil.java
deleted file mode 100644
index e398bb0e7..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/TimestampUtil.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-/**
- * @author davidw
- *
- * This class provides one timestamp per VM run.
- * (Technically, per class loading.)
- */
-public class TimestampUtil {
-
- private static Date timestamp = null;
- private static DateFormat shortFormat = new SimpleDateFormat("yyyy'-'MM'-'dd");
- // private static DateFormat longFormat = new SimpleDateFormat("yyyy'-'MM'-'dd'-'kk'-'mm'-'ss");
-
- private static String nowShort = null;
-
- public static String timestamp() {
-
- if (TimestampUtil.nowShort == null) {
- TimestampUtil.nowShort = shortFormat.format(ensureTimestamp());
- }
- return TimestampUtil.nowShort;
- }
-
- protected static Date ensureTimestamp() {
- // just calculate 'timestamp' once per class loading,
- // so this 'timestamp' remains the same during
- // entire run.
- if (TimestampUtil.timestamp == null) {
- Calendar calendar = Calendar.getInstance();
- TimestampUtil.timestamp = calendar.getTime();
- }
- return TimestampUtil.timestamp;
- }
-
-} \ No newline at end of file
diff --git a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/WorkspaceProgressMonitor.java b/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/WorkspaceProgressMonitor.java
deleted file mode 100644
index 9370ace02..000000000
--- a/tests/org.eclipse.wst.html.core.tests/src/org/eclipse/wst/html/core/tests/utils/WorkspaceProgressMonitor.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 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.html.core.tests.utils;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-class WorkspaceProgressMonitor implements IProgressMonitor {
- private boolean finished = false;
-
- public void beginTask(String name, int totalWork) {
- // we dont' care
- }
-
- public void done() {
- finished = true;
- }
-
- public boolean isFinished() {
- return finished;
- }
-
- public void internalWorked(double work) {
- // we dont' care
- }
-
- public boolean isCanceled() {
- return finished;
- }
-
- public void setCanceled(boolean value) {
- if (value == true)
- finished = true;
- }
-
- public void setTaskName(String name) {
- // we don't care
- }
-
- public void subTask(String name) {
- // we don't care
- }
-
- public void worked(int work) {
- // we don't care
- }
-} \ No newline at end of file

Back to the top