Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'development/org.eclipse.wst.sse.unittests/src')
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java124
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java51
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java34
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java64
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java46
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java105
-rw-r--r--development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage10
7 files changed, 0 insertions, 434 deletions
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
deleted file mode 100644
index e0e517a82d..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2004, 2009 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.sse.unittests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.jsp.core.tests.JSPCoreTestSuite;
-import org.eclipse.jst.jsp.tests.encoding.JSPEncodingTestSuite;
-import org.eclipse.jst.jsp.ui.tests.JSPUITestSuite;
-import org.eclipse.wst.css.core.tests.CSSCoreTestSuite;
-import org.eclipse.wst.css.tests.encoding.CSSEncodingTestSuite;
-import org.eclipse.wst.css.ui.tests.CSSUITestSuite;
-import org.eclipse.wst.dtd.core.tests.DTDCoreTestSuite;
-import org.eclipse.wst.dtd.ui.tests.DTDUITestSuite;
-import org.eclipse.wst.html.core.tests.HTMLCoreTestSuite;
-import org.eclipse.wst.html.tests.encoding.HTMLEncodingTestSuite;
-import org.eclipse.wst.html.ui.tests.HTMLUITestSuite;
-import org.eclipse.wst.jsdt.core.tests.compiler.JSDTCompilerTests;
-import org.eclipse.wst.jsdt.core.tests.model.JSDTModelTests;
-import org.eclipse.wst.jsdt.web.core.tests.translation.AllWebCoreTests;
-import org.eclipse.wst.jsdt.web.ui.tests.AllWebUITests;
-import org.eclipse.wst.sse.core.tests.SSEModelTestSuite;
-import org.eclipse.wst.sse.ui.tests.SSEUITestSuite;
-import org.eclipse.wst.xml.core.tests.SSEModelXMLTestSuite;
-import org.eclipse.wst.xml.tests.encoding.EncodingTestSuite;
-import org.eclipse.wst.xml.ui.tests.XMLUITestSuite;
-import org.eclipse.wst.xml.validation.tests.internal.AllXMLTests;
-import org.eclipse.wst.xsd.core.tests.internal.AllXSDCoreTests;
-import org.eclipse.wst.xsd.validation.tests.internal.AllXSDTests;
-import org.eclipse.wst.xsl.tests.AllTestsSuite;
-
-public class MasterListTestSuite extends TestSuite {
- private static final String CLASS = "class";
- private static final String EXTENSION_POINT_ID = "org.eclipse.wst.sse.unittests.additionalTests";
-
- public MasterListTestSuite() {
- super("WTP Source Editing Master List Test Suite");
-
- System.setProperty("wtp.autotest.noninteractive", "true");
-
- addTest(SSEModelTestSuite.suite());
-
- addTest(SSEModelXMLTestSuite.suite());
- addTest(DTDCoreTestSuite.suite());
- addTest(AllXSDCoreTests.suite());
- addTest(CSSCoreTestSuite.suite());
- addTest(HTMLCoreTestSuite.suite());
- addTest(JSPCoreTestSuite.suite());
-
- addTest(EncodingTestSuite.suite());
- addTest(CSSEncodingTestSuite.suite());
- addTest(HTMLEncodingTestSuite.suite());
- addTest(JSPEncodingTestSuite.suite());
-
- addTest(AllXMLTests.suite());
- addTest(AllXSDTests.suite());
-
- addTest(CSSUITestSuite.suite());
- addTest(HTMLUITestSuite.suite());
- addTest(SSEUITestSuite.suite());
- addTest(XMLUITestSuite.suite());
- addTest(DTDUITestSuite.suite());
- addTest(JSPUITestSuite.suite());
-
- addTest(JSDTModelTests.suite());
- addTest(JSDTCompilerTests.suite());
- addTest(AllWebCoreTests.suite());
- addTest(AllWebUITests.suite());
-
-
- addTest(new AllTestsSuite());
-
- // addTest(RegressionBucket.suite());
- // addTest(AllTestCases.suite());
-
- IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID);
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].getName().equals("suite")) {
- TestSuite suite;
- try {
- suite = (TestSuite) elements[i].createExecutableExtension(CLASS);
- addTestSuite(suite.getClass());
- System.err.println("Adding TestSuite " + suite.getClass().getName());
- }
- catch (CoreException e) {
- e.printStackTrace(System.err);
- Platform.getLog(Platform.getBundle("org.eclipse.wst.sse.unittests")).log(e.getStatus());
- }
- }
- else if (elements[i].getName().equals("test")) {
- Test test;
- try {
- test = (Test) elements[i].createExecutableExtension(CLASS);
- addTest(new TestSuite(test.getClass()));
- System.err.println("Adding TestCase " + test.getClass().getName());
- }
- catch (CoreException e) {
- e.printStackTrace(System.err);
- Platform.getLog(Platform.getBundle("org.eclipse.wst.sse.unittests")).log(e.getStatus());
- }
- }
- }
- }
-
- public void testAll() {
- // this method needs to exist, but doesn't really do anything
- // other than to signal to create an instance of this class.
- // The rest it automatic from the tests added in constructor.
- }
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java
deleted file mode 100644
index 8491014ef0..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.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.sse.unittests;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsp.ui.tests.performance.JSPUIPerformanceTests;
-import org.eclipse.wst.css.ui.tests.performance.CSSUIPerformanceTestSuite;
-import org.eclipse.wst.html.ui.tests.performance.HTMLUIPerformanceTestSuite;
-import org.eclipse.wst.sse.ui.tests.performance.SSEUIPerformanceTestSuite;
-import org.eclipse.wst.xml.ui.tests.performance.XMLUIPerformanceTestSuite;
-
-/*****************************************************************************
- * 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
- *
- ****************************************************************************/
-
-public class MasterPerformanceTestSuite extends TestSuite {
-
- public MasterPerformanceTestSuite() {
- super("All Tests");
-
- addTest(JSPUIPerformanceTests.suite());
- addTest(CSSUIPerformanceTestSuite.suite());
- addTest(HTMLUIPerformanceTestSuite.suite());
- addTest(SSEUIPerformanceTestSuite.suite());
- addTest(XMLUIPerformanceTestSuite.suite());
-
-
- }
-
- public void testAll() {
- // this method needs to exist, but doesn't really do anything
- }
-
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java
deleted file mode 100644
index 939c544208..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/TestTurkish.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests;
-
-import java.util.Locale;
-
-/**
- * TestTurkish
- * See http://www.i18nguy.com/unicode/turkish-i18n.html
- */
-
-public class TestTurkish {
- public static void main(String[] args) {
- String turkishLowerCase = "\u0131" + "\u0069";
- String turkishUpperCase = "\u0130" + "\u0049";
- Locale[] locales = Locale.getAvailableLocales();
- for (int i = 0; i < locales.length; i++) {
- // System.out.println(locales[i]);
- }
- Locale turkishLocale = new Locale("TR");
- String testUppercase = turkishLowerCase.toUpperCase(turkishLocale);
- System.out.println(turkishUpperCase.equals(testUppercase));
- }
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java
deleted file mode 100644
index 578fc46fde..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestString.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- *******************************************************************************/
-
-package org.eclipse.wst.sse.unittests.minortools;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * TestString
- */
-
-public class TestString {
-
- public static void main(String[] args) {
-
-
- String xml = "<?xml version=\"1.0\" encoding=\"UTF-16\"?><message><sourceUri></sourceUri><body></body></message>";
-
-
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(false);
- factory.setValidating(false);
- try {
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.parse(new InputSource(new StringReader(xml)));
- if (document != null) {
- System.out.print(document.hasChildNodes());
- }
- System.out.println(document);
- }
- catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java
deleted file mode 100644
index aa2e238027..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.sse.unittests.minortools;
-
-
-
-public class TestStringUtils {
-
- /**
- * TestStringUtils constructor comment.
- */
- private TestStringUtils() {
- super();
- }
-
- /**
- * Replace matching literal portions of a string with another string
- */
- public static String replace(String aString, String source, String target) {
- if (aString == null)
- return null;
- String normalString = ""; //$NON-NLS-1$
- int length = aString.length();
- int position = 0;
- int previous = 0;
- int spacer = source.length();
- while (position + spacer - 1 < length && aString.indexOf(source, position) > -1) {
- position = aString.indexOf(source, previous);
- normalString = normalString + aString.substring(previous, position) + target;
- position += spacer;
- previous = position;
- }
- normalString = normalString + aString.substring(position, aString.length());
-
- return normalString;
- }
-
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java
deleted file mode 100644
index 61ed9c5068..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 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.sse.unittests.minortools;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.eclipse.wst.xml.core.tests.util.CommonXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-
-
-/**
- * Modifies plugin.xml and fragment.xml files to not require specific versions
- * of their plugin dependencies.
- *
- * @author nitin
- */
-public class VersionRemover {
-
- char[] charbuff = new char[2048];
- StringBuffer s = null;
-
- public VersionRemover() {
- super();
- }
-
-
-
- public static void main(String[] args) {
- if (args.length < 1)
- new VersionRemover().visit(new File("d:/target"));
- else
- new VersionRemover().visit(new File(args[0]));
- }
-
-
-
- protected void visit(File file) {
- // Skip directories like org.eclipse.*, org.apache.*, and org.junit.*
- if (file.isDirectory() && !file.getName().startsWith("org.eclipse.") && !file.getName().startsWith("org.apache") && !file.getName().startsWith("org.junit")) {
- String[] contents = file.list();
- for (int i = 0; i < contents.length; i++)
- visit(new File(file.getAbsolutePath() + '/' + contents[i]));
- }
- else {
- fixupFile(file);
- }
- }
-
- protected void fixupFile(File file) {
- // only load and fixup files named plugin.xml or fragment.xml under eclipse\plugins\XXXXXXX.*
- if (!(file.getName().equalsIgnoreCase("plugin.xml") || file.getName().equalsIgnoreCase("fragment.xml")) || file.getAbsolutePath().indexOf("eclipse\\plugins\\XXXXXXX.") == -1)
- return;
- // System.out.println(file.getAbsolutePath());
- try {
- Document doc = CommonXML.getDocumentBuilder().parse(file);
- NodeList imports = null;
- if (file.getName().equalsIgnoreCase("plugin.xml"))
- imports = doc.getElementsByTagName("import");
- else if (file.getName().equalsIgnoreCase("fragment.xml"))
- imports = doc.getElementsByTagName("fragment");
- boolean changed = false;
- for (int i = 0; i < imports.getLength(); i++) {
- Node importNode = imports.item(i);
- if (importNode.getNodeName().equalsIgnoreCase("import") && importNode.getAttributes().getNamedItem("version") != null) {
- changed = true;
- importNode.getAttributes().removeNamedItem("version");
- }
- if (importNode.getAttributes().getNamedItem("plugin-version") != null) {
- changed = true;
- importNode.getAttributes().removeNamedItem("plugin-version");
- }
- if (importNode.getAttributes().getNamedItem("match") != null) {
- importNode.getAttributes().removeNamedItem("match");
- changed = true;
- }
- }
- if (changed) {
- FileOutputStream ostream = new FileOutputStream(file.getAbsolutePath());
- CommonXML.serialize(doc, ostream);
- ostream.close();
- System.out.println("Modified " + file.getAbsolutePath());
- }
- }
- catch (SAXException e) {
- System.err.println(file.getPath() + ": " + e);
- }
- catch (IOException e) {
- System.err.println(file.getPath() + ": " + e);
- }
- }
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage b/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage
deleted file mode 100644
index 0f1eaa00db..0000000000
--- a/development/org.eclipse.wst.sse.unittests/src/testStringXML.jpage
+++ /dev/null
@@ -1,10 +0,0 @@
-
-String xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?><message><sourceUri></sourceUri><body></body></message>";
-
-
-DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-factory.setNamespaceAware(false);
-factory.setValidating(false);
-DocumentBuilder builder = factory.newDocumentBuilder();
-Document document = builder.parse(new InputSource(new StringReader(xml)));
-System.out.println(document); \ No newline at end of file

Back to the top