This commit was manufactured by cvs2svn to create tag 'v200901291600'.
diff --git a/features/org.eclipse.wst.common_tests.feature/.cvsignore b/features/org.eclipse.wst.common_tests.feature/.cvsignore
deleted file mode 100644
index e304b65..0000000
--- a/features/org.eclipse.wst.common_tests.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-build.xml
-org.eclipse.wst.common_tests.feature_1.0.0.bin.dist.zip
-org.eclipse.wst.common_tests.feature_1.0.1.200602150104.bin.dist.zip
diff --git a/features/org.eclipse.wst.common_tests.feature/.project b/features/org.eclipse.wst.common_tests.feature/.project
deleted file mode 100644
index 6069a82..0000000
--- a/features/org.eclipse.wst.common_tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common_tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/features/org.eclipse.wst.common_tests.feature/build.properties b/features/org.eclipse.wst.common_tests.feature/build.properties
deleted file mode 100644
index 7f47694..0000000
--- a/features/org.eclipse.wst.common_tests.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
diff --git a/features/org.eclipse.wst.common_tests.feature/eclipse_update_120.jpg b/features/org.eclipse.wst.common_tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708..0000000
--- a/features/org.eclipse.wst.common_tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/features/org.eclipse.wst.common_tests.feature/epl-v10.html b/features/org.eclipse.wst.common_tests.feature/epl-v10.html
deleted file mode 100644
index ed4b196..0000000
--- a/features/org.eclipse.wst.common_tests.feature/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Contributor" means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>"Program" means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>"Recipient" means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
\ No newline at end of file
diff --git a/features/org.eclipse.wst.common_tests.feature/feature.properties b/features/org.eclipse.wst.common_tests.feature/feature.properties
deleted file mode 100644
index a09aa74..0000000
--- a/features/org.eclipse.wst.common_tests.feature/feature.properties
+++ /dev/null
@@ -1,145 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 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
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=WST Common Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse.org
-
-# "updateSiteName" property - label for the update site
-updateSiteName=The Eclipse Web Tools Platform (WTP) Project update site
-
-# "description" property - description of the feature
-description=WST common tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006 IBM Corporation and others.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- IBM Corporation - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-licenseURL=license.html
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-license=\
-ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
-June 06, 2007\n\
-\n\
-Usage Of Content\n\
-\n\
-THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
-OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
-USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
-AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
-NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
-AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
-AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
-OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
-OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
-BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
-\n\
-Applicable Licenses\n\
-\n\
-Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
-is provided to you under the terms and conditions of the Eclipse Public\n\
-License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
-Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
-For purposes of the EPL, "Program" will mean the Content.\n\
-\n\
-Content includes, but is not limited to, source code, object code,\n\
-documentation and other files maintained in the Eclipse.org CVS\n\
-repository ("Repository") in CVS modules ("Modules") and made available\n\
-as downloadable archives ("Downloads").\n\
-\n\
- - Content may be structured and packaged into modules to facilitate delivering,\n\
- extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
- plug-in fragments ("Fragments"), and features ("Features").\n\
- - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
- in a directory named "plugins".\n\
- - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
- Each Feature may be packaged as a sub-directory in a directory named "features".\n\
- Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
- numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- - Features may also include other Features ("Included Features"). Within a Feature, files\n\
- named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
-\n\
-Features may also include other Features ("Included Features"). Files named\n\
-"feature.xml" may contain a list of the names and version numbers of\n\
-Included Features.\n\
-\n\
-The terms and conditions governing Plug-ins and Fragments should be\n\
-contained in files named "about.html" ("Abouts"). The terms and\n\
-conditions governing Features and Included Features should be contained\n\
-in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
-Licenses may be located in any directory of a Download or Module\n\
-including, but not limited to the following locations:\n\
-\n\
- - The top-level (root) directory\n\
- - Plug-in and Fragment directories\n\
- - Inside Plug-ins and Fragments packaged as JARs\n\
- - Sub-directories of the directory named "src" of certain Plug-ins\n\
- - Feature directories\n\
-\n\
-Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
-Eclipse Update Manager, you must agree to a license ("Feature Update\n\
-License") during the installation process. If the Feature contains\n\
-Included Features, the Feature Update License should either provide you\n\
-with the terms and conditions governing the Included Features or inform\n\
-you where you can locate them. Feature Update Licenses may be found in\n\
-the "license" property of files named "feature.properties". Such Abouts,\n\
-Feature Licenses and Feature Update Licenses contain the terms and\n\
-conditions (or references to such terms and conditions) that govern your\n\
-use of the associated Content in that directory.\n\
-\n\
-THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
-TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
-SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
-\n\
- - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
- - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
- - Common Development and Distribution License (CDDL) Version 1.0 (available at http://www.sun.com/cddl/cddl.html)\n\
-\n\
-IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
-is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
-govern that particular Content.\n\
-\n\
-Cryptography\n\
-\n\
-Content may contain encryption software. The country in which you are\n\
-currently may have restrictions on the import, possession, and use,\n\
-and/or re-export to another country, of encryption software. BEFORE\n\
-using any encryption software, please check the country's laws,\n\
-regulations and policies concerning the import, possession, or use,\n\
-and re-export of encryption software, to see if this is permitted.\n\
-\n\
-Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
-########### end of license property ##########################################
diff --git a/features/org.eclipse.wst.common_tests.feature/feature.xml b/features/org.eclipse.wst.common_tests.feature/feature.xml
deleted file mode 100644
index 915fb2b..0000000
--- a/features/org.eclipse.wst.common_tests.feature/feature.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.wst.common_tests.feature"
- label="%featureName"
- version="3.0.4.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.eclipse.org/webtools/updates/"/>
- </url>
-
- <requires>
- <import feature="org.eclipse.wst.common_ui.feature" version="3.0.0"/>
- <import feature="org.eclipse.platform" version="3.4.0"/>
- <import feature="org.eclipse.test" version="3.3.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.wst.common.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.tests.collector"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.tests.performance"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.tests.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.snippets.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.internet.cache.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.project.facet.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.project.facet.ui.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.tests.validation"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.wst.common.tests.validation.guard"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/features/org.eclipse.wst.common_tests.feature/license.html b/features/org.eclipse.wst.common_tests.feature/license.html
deleted file mode 100644
index 5644598..0000000
--- a/features/org.eclipse.wst.common_tests.feature/license.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
-<!-- saved from url=(0044)http://www.eclipse.org/legal/epl/notice.html -->
-<HTML><HEAD><TITLE>Eclipse.org Software User Agreement</TITLE>
-<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<META content="MSHTML 6.00.2800.1479" name=GENERATOR></HEAD>
-<BODY lang=EN-US vLink=purple link=blue>
-<H2>Eclipse Foundation Software User Agreement</H2>
-<P>June 06, 2007</P>
-<H3>Usage Of Content</H3>
-<P>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION
-AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT"). USE OF
-THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE
-TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED
-BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED
-BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE
-AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE
-TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS OF ANY
-APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU
-MAY NOT USE THE CONTENT.</P>
-<H3>Applicable Licenses</H3>
-<P>Unless otherwise indicated, all Content made available by the Eclipse
-Foundation is provided to you under the terms and conditions of the Eclipse
-Public License Version 1.0 ("EPL"). A copy of the EPL is provided with this
-Content and is also available at <A
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-<P>Content includes, but is not limited to, source code, object code,
-documentation and other files maintained in the Eclipse.org CVS repository
-("Repository") in CVS modules ("Modules") and made available as downloadable
-archives ("Downloads").</P>
-<P>Content may be apportioned into plug-ins ("Plug-ins"), plug-in fragments
-("Fragments"), and features ("Features"). A Feature is a bundle of one or more
-Plug-ins and/or Fragments and associated material. Files named "feature.xml" may
-contain a list of the names and version numbers of the Plug-ins and/or Fragments
-associated with a Feature. Plug-ins and Fragments are located in directories
-named "plugins" and Features are located in directories named "features".</P>
-<P>Features may also include other Features ("Included Features"). Files named
-"feature.xml" may contain a list of the names and version numbers of Included
-Features.</P>
-<P>The terms and conditions governing Plug-ins and Fragments should be contained
-in files named "about.html" ("Abouts"). The terms and conditions governing
-Features and Included Features should be contained in files named "license.html"
-("Feature Licenses"). Abouts and Feature Licenses may be located in any
-directory of a Download or Module including, but not limited to the following
-locations:</P>
-<UL>
- <LI>The top-level (root) directory
- <LI>Plug-in and Fragment directories
- <LI>Subdirectories of the directory named "src" of certain Plug-ins
- <LI>Feature directories </LI></UL>
-<P>Note: if a Feature made available by the Eclipse Foundation is installed
-using the Eclipse Update Manager, you must agree to a license ("Feature Update
-License") during the installation process. If the Feature contains Included
-Features, the Feature Update License should either provide you with the terms
-and conditions governing the Included Features or inform you where you can
-locate them. Feature Update Licenses may be found in the "license" property of
-files named "feature.properties". Such Abouts, Feature Licenses and Feature
-Update Licenses contain the terms and conditions (or references to such terms
-and conditions) that govern your use of the associated Content in that
-directory.</P>
-<P>THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL
-OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</P>
-<UL>
- <LI>Common Public License Version 1.0 (available at <A
- href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</A>)
-
- <LI>Apache Software License 1.1 (available at <A
- href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</A>)
-
- <LI>Apache Software License 2.0 (available at <A
- href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</A>)
-
- <LI>IBM Public License 1.0 (available at <A
- href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</A>)
-
- <LI>Metro Link Public License 1.00 (available at <A
- href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</A>)
-
- <LI>Mozilla Public License Version 1.1 (available at <A
- href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</A>)
- </LI>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.html)</A>
- </LI>
-</UL>
-<P>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR
-TO USE OF THE CONTENT. If no About, Feature License or Feature Update License is
-provided, please contact the Eclipse Foundation to determine what terms and
-conditions govern that particular Content.</P>
-<H3>Cryptography</H3>
-<P>Content may contain encryption software. The country in which you are
-currently may have restrictions on the import, possession, and use, and/or
-re-export to another country, of encryption software. BEFORE using any
-encryption software, please check the country's laws, regulations and policies
-concerning the import, possession, or use, and re-export of encryption software,
-to see if this is permitted.</P></BODY></HTML>
diff --git a/tests/org.eclipse.wst.common.tests.collector/.classpath b/tests/org.eclipse.wst.common.tests.collector/.classpath
deleted file mode 100644
index 4a382ec..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="collector"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.common.tests.collector/.cvsignore b/tests/org.eclipse.wst.common.tests.collector/.cvsignore
deleted file mode 100644
index 4d7b745..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-runtime
-temp.folder
-javaCompiler.runtime_collector.jar.args
diff --git a/tests/org.eclipse.wst.common.tests.collector/.project b/tests/org.eclipse.wst.common.tests.collector/.project
deleted file mode 100644
index 7441769..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests.collector</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests.collector/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.common.tests.collector/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 542da41..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun Jun 03 02:20:21 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.wst.common.tests.collector/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.common.tests.collector/META-INF/MANIFEST.MF
deleted file mode 100644
index 2a4d0dc..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %org.eclipse.wst.common.tests.collector
-Bundle-SymbolicName: org.eclipse.wst.common.tests.collector; singleton:=true
-Bundle-Version: 1.1.0
-Bundle-ClassPath: runtime/collector.jar
-Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
-Bundle-Localization: plugin
-Require-Bundle: org.junit;bundle-version="[3.8.2,4.0.0)",
- org.eclipse.ui,
- org.eclipse.core.runtime.compatibility
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/tests/org.eclipse.wst.common.tests.collector/about.html b/tests/org.eclipse.wst.common.tests.collector/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the RedistributorÂ’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/tests/org.eclipse.wst.common.tests.collector/build.properties b/tests/org.eclipse.wst.common.tests.collector/build.properties
deleted file mode 100644
index e6b007b..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = plugin.xml,\
- runtime/collector.jar,\
- about.html,\
- META-INF/,\
- plugin.properties
-source.runtime/collector.jar = collector/
-output.runtime/collector.jar = bin/
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java
deleted file mode 100644
index b43f8ec..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author jsholl
- *
- * 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 SuiteHelper {
-
- private Hashtable allTests = new Hashtable();
-
- public SuiteHelper(TestSuite suite) {
- addTest(suite);
- }
-
- private void addTest(Test test) {
- if (test instanceof TestSuite) {
- Enumeration tests = ((TestSuite) test).tests();
- while (tests.hasMoreElements()) {
- Test t = (Test) tests.nextElement();
- allTests.put(t.toString(), t);
- }
- return;
- }
- allTests.put(test.toString(), test);
- }
-
- public String[] getAllTests() {
- ArrayList testList = new ArrayList();
- Enumeration enumeration = allTests.keys();
- while (enumeration.hasMoreElements()) {
- testList.add(enumeration.nextElement());
- }
- Collections.sort(testList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- String[] strArray = new String[testList.size()];
- for (int i = 0; i < strArray.length; i++) {
- strArray[i] = (String) testList.get(i);
- }
-
- return strArray;
- }
-
- public TestSuite buildSuite(String[] completeTests, String[] partialTests) {
- TestSuite suite = new TestSuite();
- for (int i = 0; i < completeTests.length; i++) {
- suite.addTest((Test) allTests.get(completeTests[i]));
- }
- for (int i = 0; i < partialTests.length; i++) {
- suite.addTest(getTest(partialTests[i]));
- }
- return suite;
- }
-
- public String[] getTestMethods(String testName) {
- ArrayList methodList = new ArrayList();
- Test test = (Test) allTests.get(testName);
- if (test instanceof TestSuite) {
- Enumeration testsEnum = ((TestSuite) test).tests();
- while (testsEnum.hasMoreElements()) {
- Test t = (Test) testsEnum.nextElement();
- methodList.add(t.toString());
- }
- }
-
- Collections.sort(methodList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- String[] strArray = new String[methodList.size()];
- for (int i = 0; i < strArray.length; i++) {
- strArray[i] = (String) methodList.get(i);
- }
-
- return strArray;
- }
-
- private Test getSubTest(TestSuite suite, String testName) {
- if (null != suite) {
- Enumeration tests = suite.tests();
- while (tests.hasMoreElements()) {
- Test t = (Test) tests.nextElement();
- if (t.toString().equals(testName)) {
- return t;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns a TestSuite to run
- */
- private Test getTest(String testName) {
- int firstIndex = testName.indexOf("."); //$NON-NLS-1$
- String suiteName = testName.substring(0, firstIndex);
- String subTestName = testName.substring(firstIndex + 1);
-
- //check the obvious suite first
- TestSuite suite = (TestSuite) allTests.get(suiteName);
- Test test = getSubTest(suite, subTestName);
- if (test != null) {
- return test;
- }
- //otherwise check all suites
- Enumeration keys = allTests.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- if (testName.startsWith(key)) {
- suite = (TestSuite) allTests.get(key);
- subTestName = testName.substring(key.length() + 1);
- test = getSubTest(suite, subTestName);
- if (test != null) {
- return test;
- }
- }
- }
-
- return null;
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java
deleted file mode 100644
index 3bab38e..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * @author jsholl
- *
- * 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 SuiteTestRunner extends TestRunner {
-
- private TestSuite suite;
-
- /**
- * PluginTestRunner constructor comment.
- */
- public SuiteTestRunner(TestSuite suiteToRun) {
- super();
- suite = suiteToRun;
- }
-
- /**
- * Only return the specified suite
- */
- public Test getTest(String suiteClassName) {
- return suite;
- }
-
- /**
- * called by the gui
- */
- public void launch() {
- start();
- }
-
- public void start() {
- String name = "dynamic test"; //$NON-NLS-1$
- fFrame = createUI(name);
- fFrame.pack();
- fFrame.setVisible(true);
- setSuite(name);
- runSuite();
- }
-
- /*
- * @see TestRunner#terminate()
- */
- public void terminate() {
- fFrame.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java
deleted file mode 100644
index 2b2bd28..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * @author jsholl
- *
- * 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 TestCollectorActionDelegate implements IWorkbenchWindowActionDelegate {
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- Shell shell = new Shell();
- GridLayout gridLayout = new GridLayout();
- shell.setLayout(gridLayout);
- shell.setText("Test Collector"); //$NON-NLS-1$
- TestCollectorGUI testCollectorGUI = new TestCollectorGUI(shell, SWT.NULL);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- testCollectorGUI.setLayoutData(gridData);
-
- shell.setSize(500, 500);
- shell.open();
- }
-
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java
deleted file mode 100644
index 606252f..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Created on Mar 6, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests.collector;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class TestCollectorGUI extends Composite implements ModifyListener {
-
- private static final String PLUGIN_ID = "org.eclipse.wst.common.tests.collector"; //$NON-NLS-1$
- private static final String SUITES_EXT_PT = "suites"; //$NON-NLS-1$
-// private static final String NAME = "name"; //$NON-NLS-1$
-// private static final String CLASS = "class"; //$NON-NLS-1$
-
- private Composite innerPanes = null;
- private Combo combo = null;
-
- private Hashtable testSuites = new Hashtable();
-
- /**
- * @param parent
- * @param style
- */
- public TestCollectorGUI(Composite parent, int style) {
- super(parent, style);
-
- loadConfiguration();
-
- createPartControl();
- }
-
- private void loadConfiguration() {
- IExtensionPoint suiteExtPt = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, SUITES_EXT_PT);
- IExtension[] suitesExtensions = suiteExtPt.getExtensions();
-
- for (int i = 0; i < suitesExtensions.length; i++) {
- IExtension extension = suitesExtensions[i];
- IConfigurationElement[] tests = extension.getConfigurationElements();
- for (int j = 0; j < tests.length; j++) {
- try {
- IConfigurationElement element = tests[j];
- String suiteName = element.getAttribute("name"); //$NON-NLS-1$
- testSuites.put(suiteName, element);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- public void createPartControl() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- setLayout(gridLayout);
-
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
-
- combo = new Combo(this, SWT.READ_ONLY);
- Enumeration keys = testSuites.keys();
- ArrayList arrayList = new ArrayList();
- while (keys.hasMoreElements()) {
- arrayList.add(keys.nextElement());
- }
-
- Collections.sort(arrayList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- for (int i = 0; i < arrayList.size(); i++) {
- combo.add((String) arrayList.get(i));
- }
- combo.setLayoutData(gridData);
- combo.addModifyListener(this);
- if (combo.getItemCount() > 0) {
- combo.select(0);
- }
- }
-
- public void modifyText(ModifyEvent e) {
- if (e.getSource() == combo) {
- updateCombo(e);
- }
- }
-
- private void updateCombo(ModifyEvent e) {
- if (null != innerPanes) {
- innerPanes.dispose();
- }
- try {
- String testName = combo.getText();
- IConfigurationElement element = (IConfigurationElement) testSuites.get(testName);
- TestSuite suite = (TestSuite) element.createExecutableExtension("class"); //$NON-NLS-1$
- innerPanes = new TestCollectorInnerPanes(this, SWT.NULL, new SuiteHelper(suite));
- } catch (Exception ex) {
- innerPanes = new Composite(this, SWT.NULL);
- innerPanes.setLayout(new GridLayout());
- innerPanes.setBackground(getBackground());
- Label errorLabel = new Label(innerPanes, SWT.NONE);
- errorLabel.setText(ex.getMessage());
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- errorLabel.setLayoutData(gridData);
- }
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- innerPanes.setLayoutData(gridData);
- layout();
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java
deleted file mode 100644
index f62d96b..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @author jsholl
- *
- * 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 TestCollectorInnerPanes extends Composite {
-
- private Table testClassTable;
- private Table testMethodTable;
-
- private Button launchTestButton;
-
- private SuiteHelper pluginTestLoader;
-
- private HashSet partialSetHash = new HashSet();
- private Hashtable shortToFullHashtable = new Hashtable();
- private Hashtable fullToShortHashtable = new Hashtable();
-
- public TestCollectorInnerPanes(Composite parent, int style, SuiteHelper loader) {
- super(parent, style);
- pluginTestLoader = loader;
- createPartControl();
- }
-
- public void createPartControl() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- setLayout(gridLayout);
- GridData gridData = null;
-
- Group tableGroup = new Group(this, SWT.NULL);
- GridLayout tableGroupLayout = new GridLayout();
- tableGroupLayout.makeColumnsEqualWidth = true;
- tableGroupLayout.numColumns = 1;
- tableGroupLayout.marginWidth = 0;
- tableGroupLayout.marginHeight = 0;
- tableGroup.setLayout(tableGroupLayout);
- tableGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SashForm splitView = new SashForm(tableGroup, SWT.HORIZONTAL);
- splitView.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
-
- gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 2;
- splitView.setLayoutData(gridData);
-
- Composite leftComposite = new Composite(splitView, SWT.NONE);
- GridLayout leftLayout = new GridLayout();
- leftLayout.numColumns = 1;
- leftComposite.setLayout(leftLayout);
- Label label2 = new Label(leftComposite, SWT.NULL);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.CENTER;
- label2.setLayoutData(gridData);
- label2.setText("Test Suites"); //$NON-NLS-1$
-
- Composite rightComposite = new Composite(splitView, SWT.NONE);
- GridLayout rightLayout = new GridLayout();
- rightLayout.numColumns = 1;
- rightComposite.setLayout(rightLayout);
- Label label3 = new Label(rightComposite, SWT.NULL);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.CENTER;
- label3.setLayoutData(gridData);
- label3.setText("Tests"); //$NON-NLS-1$
-
- testClassTable = new Table(leftComposite, SWT.CHECK);
- testClassTable.setBackground(getBackground());
- gridData = new GridData(GridData.FILL_BOTH);
- testClassTable.setLayoutData(gridData);
- String[] allTests = pluginTestLoader.getAllTests();
- for (int i = 0; i < allTests.length; i++) {
- TableItem tableItem = new TableItem(testClassTable, SWT.NULL);
- tableItem.setText(allTests[i]);
- }
- testClassTable.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- TableItem item = (TableItem) e.item;
- String testName = item.getText();
- updateMethodTable(testName, pluginTestLoader.getTestMethods(testName));
- testClassTable.setSelection(new TableItem[] { item });
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- });
-
- Label label = new Label(leftComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Button selectAllCheckbox = new Button(leftComposite, SWT.CHECK);
- selectAllCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- selectAllCheckbox.setText("Select All"); //$NON-NLS-1$
- selectAllCheckbox.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- boolean checked = selectAllCheckbox.getSelection();
- TableItem [] items = testClassTable.getItems();
- for(int i=0;i<items.length; i++){
- items[i].setChecked(checked);
- }
- }
- });
-
- testMethodTable = new Table(rightComposite, SWT.CHECK);
- testMethodTable.setBackground(getBackground());
- gridData = new GridData(GridData.FILL_BOTH);
- testMethodTable.setLayoutData(gridData);
-
- launchTestButton = new Button(this, SWT.PUSH);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalAlignment = GridData.CENTER;
- gridData.horizontalSpan = 2;
- launchTestButton.setLayoutData(gridData);
- launchTestButton.setText("Run Tests"); //$NON-NLS-1$
- launchTestButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- SuiteTestRunner runner = new SuiteTestRunner(buildSuite());
- runner.launch();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- private void storeMethodsTable() {
- TableItem[] items = testMethodTable.getItems();
- for (int i = 0; null != items && i < items.length; i++) {
- String partialTestName = (String)shortToFullHashtable.get(items[i].getText());
- if (items[i].getChecked() && !partialSetHash.contains(partialTestName)) {
- partialSetHash.add(partialTestName);
- } else if (!items[i].getChecked() && partialSetHash.contains(partialTestName)) {
- partialSetHash.remove(partialTestName);
- }
- }
- }
-
- private void updateMethodTable(String testName, String[] methodArray) {
- storeMethodsTable();
- testMethodTable.removeAll();
- shortToFullHashtable.clear();
- fullToShortHashtable.clear();
-
- for (int i = 0; null != methodArray && i < methodArray.length; i++) {
- String partialTestName = testName + "." + methodArray[i]; //$NON-NLS-1$
- int endIndex = methodArray[i].indexOf('(');
- String methodName = endIndex > 0 ? methodArray[i].substring(0, endIndex) : methodArray[i];
- shortToFullHashtable.put(methodName, partialTestName);
- fullToShortHashtable.put(partialTestName, methodName);
- TableItem tableItem = new TableItem(testMethodTable, SWT.NULL);
- tableItem.setText(methodName);
- tableItem.setChecked(partialSetHash.contains(partialTestName));
- }
-
- }
-
- private TestSuite buildSuite() {
- ArrayList completeTests = new ArrayList();
- TableItem[] items = testClassTable.getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i].getChecked()) {
- completeTests.add(items[i].getText());
- }
- }
-
- String[] completeArray = new String[completeTests.size()];
- for (int i = 0; i < completeArray.length; i++) {
- completeArray[i] = (String) completeTests.get(i);
- }
-
- ArrayList partialTests = new ArrayList();
- storeMethodsTable();
- Iterator iterator = partialSetHash.iterator();
- while (iterator.hasNext()) {
- partialTests.add(iterator.next());
- }
-
- String[] partialArray = new String[partialTests.size()];
- for (int i = 0; i < partialArray.length; i++) {
- partialArray[i] = (String) partialTests.get(i);
- }
-
- return pluginTestLoader.buildSuite(completeArray, partialArray);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/plugin.properties b/tests/org.eclipse.wst.common.tests.collector/plugin.properties
deleted file mode 100644
index 144de79..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/plugin.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-org.eclipse.wst.common.tests.collector=org.eclipse.wst.common.tests.collector
-suites=suites
-Test_Collector=Test Collector
-WTP_Tests=WTP Tests
-Open=Open
-Test_Collector=Test Collector
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests.collector/plugin.xml b/tests/org.eclipse.wst.common.tests.collector/plugin.xml
deleted file mode 100644
index 28986ff..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/plugin.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="suites" name="%suites" schema="schema/suites.exsd"/>
-
-
-
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="%Test_Collector"
- visible="true"
- id="testCollector">
- <menu
- label="%WTP_Tests"
- path="additions"
- id="org.eclipse.wst.common.tests.collector.testsMenu">
- <separator
- name="group1">
- </separator>
- </menu>
- <action
- label="%Open"
- tooltip="%Test_Collector"
- class="org.eclipse.wst.common.tests.collector.TestCollectorActionDelegate"
- menubarPath="org.eclipse.wst.common.tests.collector.testsMenu/group1"
- id="org.eclipse.wst.common.tests.collector.testsAction">
- </action>
- </actionSet>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd b/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd
deleted file mode 100644
index dfec3c5..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.common.tests.collector">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.tests.collector" id="suites" name="suites"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="suite"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="suite">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/tests/org.eclipse.wst.common.tests.ui/.classpath b/tests/org.eclipse.wst.common.tests.ui/.classpath
deleted file mode 100644
index 4a72458..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/wst/common/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.common.tests.ui/.cvsignore b/tests/org.eclipse.wst.common.tests.ui/.cvsignore
deleted file mode 100644
index f2c0c6d..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-temp.folder
-build.xml
-ui.jar
-javaCompiler.ui.jar.args
diff --git a/tests/org.eclipse.wst.common.tests.ui/.project b/tests/org.eclipse.wst.common.tests.ui/.project
deleted file mode 100644
index 8efe78d..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests.ui/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.common.tests.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9c78d3d..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun Jun 03 02:20:54 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.wst.common.tests.ui/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.common.tests.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 09600d7..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Ui_Plug-in
-Bundle-SymbolicName: org.eclipse.wst.common.tests.ui; singleton:=true
-Bundle-Version: 1.1.101.qualifier
-Bundle-ClassPath: ui.jar
-Bundle-Activator: org.eclipse.wst.common.tests.ui.UiPlugin
-Bundle-Vendor: %Eclipse
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.common.tests.ui,
- org.eclipse.wst.common.tests.ui.manager,
- org.eclipse.wst.common.tests.ui.wizard
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.wst.common.frameworks.ui,
- org.eclipse.wst.common.tests,
- org.eclipse.wst.common.environment
-Eclipse-LazyStart: true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/tests/org.eclipse.wst.common.tests.ui/about.html b/tests/org.eclipse.wst.common.tests.ui/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the RedistributorÂ’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/tests/org.eclipse.wst.common.tests.ui/build.properties b/tests/org.eclipse.wst.common.tests.ui/build.properties
deleted file mode 100644
index cee1739..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.ui.jar = src/
-output.ui.jar = bin/
-bin.includes = plugin.xml,\
- ui.jar,\
- about.html,\
- plugin.properties,\
- META-INF/
diff --git a/tests/org.eclipse.wst.common.tests.ui/plugin.properties b/tests/org.eclipse.wst.common.tests.ui/plugin.properties
deleted file mode 100644
index 43069c8..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/plugin.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-Ui_Plug-in=Test Ui Plug-in
-Eclipse=Eclipse.org
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests.ui/plugin.xml b/tests/org.eclipse.wst.common.tests.ui/plugin.xml
deleted file mode 100644
index cb8cb61..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/plugin.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class="org.eclipse.wst.common.tests.ui.DataModelUIAPITests"
- name="DataModel UI API Tests">
- </suite>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.ui.DataModelWizardExtension">
- <DataModelWizard
- class="org.eclipse.wst.common.tests.ui.TestDataModelWizard"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.ui.wizardPageGroup">
- <wizardPageGroup
- pageGroupID="foo"
- wizardID="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelProvider">
- <factory className="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelWizardFactory"/>
- </wizardPageGroup>
- <wizardPageGroup
- pageGroupID="bar"
- wizardID="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelProvider">
- <factory className="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelWizardFactory2"/>
- </wizardPageGroup>
- <wizardPageGroup
- pageGroupID="foobar"
- wizardID="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelProvider">
- <factory className="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelWizardFactory3"/>
- </wizardPageGroup>
- <wizardPage
- wizardID="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelProvider">
- <factory
- className="org.eclipse.wst.common.tests.ui.wizard.Test2PageWizardExtensionFactory">
- </factory>
- </wizardPage>
- <wizardPage
- wizardID="org.eclipse.wst.common.tests.ui.wizard.Test2DataModelProvider">
- <factory
- className="org.eclipse.wst.common.tests.ui.wizard.Test2PageWizardExtensionFactory2">
- </factory>
- </wizardPage>
- </extension>
-
- <!--
- A picture of the operation tree
- /**
- * Operations are organized as follows: <code>
- * D
- * / \
- * / \
- * B F
- * / \ / \
- * A C E G
- * </code>
- */
- -->
-
- <extension
- point="org.eclipse.wst.common.frameworks.OperationExtension"
- id="org.eclipse.wst.common.tests.ui.manager">
- <operationExtension
- id="org.eclipse.wst.common.tests.ui.manager.D"
- postOperationClass="org.eclipse.wst.common.tests.ui.manager.F"
- preOperationClass="org.eclipse.wst.common.tests.ui.manager.B"/>
- <operationExtension
- id="org.eclipse.wst.common.tests.ui.manager.B"
- postOperationClass="org.eclipse.wst.common.tests.ui.manager.C"
- preOperationClass="org.eclipse.wst.common.tests.ui.manager.A"/>
- <operationExtension
- id="org.eclipse.wst.common.tests.ui.manager.F"
- postOperationClass="org.eclipse.wst.common.tests.ui.manager.G"
- preOperationClass="org.eclipse.wst.common.tests.ui.manager.E"/>
- </extension>
-
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java
deleted file mode 100644
index b7f3581..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-import org.eclipse.wst.common.tests.ui.wizard.TestWizardTestcase;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class DataModelUIAPITests extends TestSuite {
-
- public static Test suite() {
- return new DataModelUIAPITests();
- }
-
- public DataModelUIAPITests() {
- super();
- addTest(new SimpleTestSuite(DataModelUIFactoryTest.class));
- addTest(new SimpleTestSuite(TestWizardTestcase.class));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java
deleted file mode 100644
index 5f2d281..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardFactory;
-
-public class DataModelUIFactoryTest extends TestCase {
-
- public void testValidExtensionID() {
- IDataModel dataModel = DataModelFactory.createDataModel("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"); //$NON-NLS-1$
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"); //$NON-NLS-1$
- assertNotNull(wizard);
- assertNotNull(wizard.getDataModel());
- }
-
-
- public void testValidExtensionClass() {
- IDataModel dataModel = DataModelFactory.createDataModel(ITestDataModel.class);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard(ITestDataModel.class);
- assertNotNull(wizard);
- assertNotNull(wizard.getDataModel());
- }
-
- public void testValidExtensionInstance() {
- int startInstanceCount = TestDataModelProvider.getInstanceCount();
- IDataModel dataModel = DataModelFactory.createDataModel(new TestDataModelProvider());
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard(dataModel);
- assertNotNull(wizard);
- assertTrue(dataModel == wizard.getDataModel());
- int endInstanceCount = TestDataModelProvider.getInstanceCount();
- assertEquals(1, endInstanceCount-startInstanceCount);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java
deleted file mode 100644
index b6044c4..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-
-public class TestDataModelWizard extends DataModelWizard {
-
- public TestDataModelWizard() {
- super();
- }
-
- public TestDataModelWizard(IDataModel dataModel) {
- super(dataModel);
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new TestDataModelProvider();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java
deleted file mode 100644
index 976fc6e..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.wst.common.tests.ui;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class UiPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static UiPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public UiPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static UiPlugin 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 = UiPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.common.tests.ui.UiPluginResources"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.common.tests.ui", path); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/A.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/A.java
deleted file mode 100644
index e0a7f57..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/A.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class A extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/B.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/B.java
deleted file mode 100644
index ce641b4..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/B.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class B extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/BaseOperation.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/BaseOperation.java
deleted file mode 100644
index e72b1f6..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/BaseOperation.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-import java.util.Vector;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.environment.ILog;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class BaseOperation extends AbstractDataModelOperation {
- public static Vector resultList;
- public static Vector undoList;
- private IStatus status;
- private boolean checkModels;
- private boolean modelsOK = false;
-
- public BaseOperation() {
- super();
- }
-
- public void setStatus(IStatus status) {
- this.status = status;
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- resultList.add(getID());
-
- getDataModel().setProperty("executedOps", resultList);
- getDataModel().setProperty("executedUndoOps", undoList);
- if (checkModels)
- modelsOK = checkModels();
-
- getEnvironment().getLog().log(ILog.OK, 1234, this, "BaseOperation", (Throwable) null); //$NON-NLS-1$
-
- return status;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return Status.OK_STATUS;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- resultList.remove(resultList.size() - 1);
- undoList.add(getID());
- return Status.OK_STATUS;
- }
-
- public void setCheckModels(boolean checkModels) {
- this.checkModels = checkModels;
- }
-
- public boolean getModelsOK() {
- return modelsOK;
- }
-
- private boolean checkModels() {
- IDataModel model = getDataModel();
-
- boolean containsModel1 = model.isNestedModel("testprovider1");
- boolean containsModel2 = model.isNestedModel("testprovider2");
- boolean prop1 = model.isPropertySet("provider1Prop1");
- boolean prop2 = model.isPropertySet("provider1Prop2");
- boolean prop3 = model.isPropertySet("provider1Prop3");
- boolean prop4 = model.isPropertySet("provider1Prop4");
- boolean prop5 = model.isPropertySet("provider2Prop1");
- boolean prop6 = model.isPropertySet("provider2Prop2");
- boolean prop7 = model.isPropertySet("provider2Prop3");
- boolean prop8 = model.isPropertySet("provider2Prop4");
- boolean value1 = model.getProperty("provider1Prop1").equals("11");
- boolean value2 = model.getProperty("provider1Prop2").equals("22");
- boolean value3 = model.getProperty("provider1Prop3").equals("33");
- boolean value4 = model.getProperty("provider1Prop4").equals("44");
- boolean value5 = model.getProperty("provider2Prop1").equals("1111");
- boolean value6 = model.getProperty("provider2Prop2").equals("2222");
- boolean value7 = model.getProperty("provider2Prop3").equals("3333");
- boolean value8 = model.getProperty("provider2Prop4").equals("4444");
-
- return containsModel1 && containsModel2 && prop1 && prop2 && prop3 && prop4 && prop5 && prop6 && prop7 && prop8 && value1 && value2 && value3 && value4 && value5 && value6 && value7 && value8;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/C.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/C.java
deleted file mode 100644
index f29751b..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/C.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class C extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/D.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/D.java
deleted file mode 100644
index b4aad22..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/D.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class D extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/E.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/E.java
deleted file mode 100644
index 600c671..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/E.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class E extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/F.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/F.java
deleted file mode 100644
index f42328e..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/F.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class F extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/G.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/G.java
deleted file mode 100644
index 4f8a40f..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/G.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-public class G extends BaseOperation {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestExtendedProvider.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestExtendedProvider.java
deleted file mode 100644
index 7610e30..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestExtendedProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-import java.util.Set;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class TestExtendedProvider extends AbstractDataModelProvider
-{
- public Set getPropertyNames(){
- Set propertyNames = super.getPropertyNames();
- propertyNames.add("executedOps");
- propertyNames.add("executedUndoOps");
-
- return propertyNames;
- }
-
- public void init()
- {
- }
-
- public String getID()
- {
- return "TestExtendedProvider";
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestGroupManager.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestGroupManager.java
deleted file mode 100644
index 6443deb..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestGroupManager.java
+++ /dev/null
@@ -1,525 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl;
-import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IDataModelPausibleOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.IDMPageGroupHandler;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.IDMPageHandler;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.SimplePageGroup;
-import org.eclipse.wst.common.frameworks.internal.ui.PageGroupManager;
-
-public class TestGroupManager extends TestCase {
-
- private IDataModelPausibleOperation rootOperation;
-
- private PageGroupManager pageGroupManager;
- private SimplePageGroup pgA;
- private SimplePageGroup pgB;
- private SimplePageGroup pgC;
- private SimplePageGroup pgD;
- private SimplePageGroup pgE;
- private SimplePageGroup pgF;
- private SimplePageGroup pgG;
- private SimplePageGroup pgH;
- private SimplePageGroup pgRoot;
- private WizardPage r1;
- private WizardPage b1;
- private WizardPage b2;
- private WizardPage c1;
- private WizardPage d1;
- private WizardPage d2;
- private WizardPage d3;
- private WizardPage f1;
- private WizardPage f2;
- private WizardPage f3;
- private WizardPage f4;
- private WizardPage f5;
- private WizardPage f6;
- private WizardPage g1;
-
- private AGroupHandler aGroupHandler;
- private FGroupHandler fGroupHandler;
- private Vector expectedOps;
- private Vector expectedUndoOps;
- private IDataModel dataModel;
-
- public static final String a = A.class.getName();
- public static final String b = B.class.getName();
- public static final String c = C.class.getName();
- public static final String d = D.class.getName();
- public static final String e = E.class.getName();
- public static final String f = F.class.getName();
- public static final String g = G.class.getName();
-
-
- protected void setUp() throws Exception {
- super.setUp();
- BaseOperation.resultList = new Vector();
- BaseOperation.undoList = new Vector();
-
- expectedOps = new Vector();
- expectedUndoOps = new Vector();
- dataModel = new DataModelImpl(new EmptyProvider());
- dataModel.addNestedModel("testprovider1", DataModelFactory.createDataModel(new TestProvider1()));
- dataModel.addNestedModel("testprovider2", DataModelFactory.createDataModel(new TestProvider2()));
- dataModel.addNestedModel("testextendedprovider", DataModelFactory.createDataModel(new TestExtendedProvider()));
-
- /**
- * Operations are organized as follows: <code>
- * D
- * / \
- * / \
- * B F
- * / \ / \
- * A C E G
- * </code>
- */
- rootOperation = new DataModelPausibleOperationImpl(new D());
- rootOperation.setDataModel(dataModel);
- rootOperation.setEnvironment(EnvironmentService.getEclipseConsoleEnvironment());
-
- /**
- * Page groups are organized as follows:
- *
- * <code>
- *
- * B - C
- * / \
- * Root - A - D \ G
- * \ \ /
- * ------ E - F - H
- * \ null
- * </code>
- */
-
- // The page group handler for A will return either B and then E or D and
- // then E. The group handler for F will return either G or H and then null or
- // just null.
- //
- // Some of these group require operations to run first:
- //
- // Page group B requires operation C.
- // Page group D requires operation C.
- // Page group E requires operation E.
- // Page group F requires operation C.( C will already have been run and should not be
- // rerun.)
- //
- // Each page group has some pages associated with it as follows:
- //
- // Root has page r1.
- // A has no pages.
- // B has b1 and b2.
- // C has c1
- // D has d1, d2, and d3
- // E has no pages.
- // F has pages f1, f2, f3, f4, f5, f6
- // the page handler for F will return the following:
- // expected = f1 returns f1
- // expected = f2 returns skip
- // expected = f3 returns before f6
- // expected = f4 returns null
- // expected = f5 returns after f5
- // expected = f6 returns f4
- // G has pages g1
- // H has no pages.
- r1 = new WizardPage("r1"); //$NON-NLS-1$
- b1 = new WizardPage("b1"); //$NON-NLS-1$
- b2 = new WizardPage("b2"); //$NON-NLS-1$
- c1 = new WizardPage("c1"); //$NON-NLS-1$
- d1 = new WizardPage("d1"); //$NON-NLS-1$
- d2 = new WizardPage("d2"); //$NON-NLS-1$
- d3 = new WizardPage("d3"); //$NON-NLS-1$
- f1 = new WizardPage("f1"); //$NON-NLS-1$
- f2 = new WizardPage("f2"); //$NON-NLS-1$
- f3 = new WizardPage("f3"); //$NON-NLS-1$
- f4 = new WizardPage("f4"); //$NON-NLS-1$
- f5 = new WizardPage("f5"); //$NON-NLS-1$
- f6 = new WizardPage("f6"); //$NON-NLS-1$
- g1 = new WizardPage("g1"); //$NON-NLS-1$
-
- String wizardID = "testWizard"; //$NON-NLS-1$
-
- pgRoot = new SimplePageGroup("Root", wizardID); //$NON-NLS-1$
- pgA = new SimplePageGroup("A", wizardID); //$NON-NLS-1$
- pgB = new SimplePageGroup("B", wizardID, true, c); //$NON-NLS-1$ //$NON-NLS-2$
- pgC = new SimplePageGroup("C", wizardID); //$NON-NLS-1$
- pgD = new SimplePageGroup("D", wizardID, true, c); //$NON-NLS-1$ //$NON-NLS-2$
- pgE = new SimplePageGroup("E", wizardID, true, e); //$NON-NLS-1$ //$NON-NLS-2$
- pgF = new SimplePageGroup("F", wizardID, true, c); //$NON-NLS-1$ //$NON-NLS-2$
- pgG = new SimplePageGroup("G", wizardID); //$NON-NLS-1$
- pgH = new SimplePageGroup("H", wizardID); //$NON-NLS-1$
-
- pgRoot.addPages(new WizardPage[]{r1});
- pgB.addPages(new WizardPage[]{b1, b2});
- pgC.addPages(new WizardPage[]{c1});
- pgD.addPages(new WizardPage[]{d1, d2, d3});
- pgF.addPages(new WizardPage[]{f1, f2, f3, f4, f5, f6});
- pgG.addPages(new WizardPage[]{g1});
-
- pgF.setPageHandler(new FPageHandler());
-
- aGroupHandler = new AGroupHandler();
- fGroupHandler = new FGroupHandler();
-
- pgA.setPageGroupHandler(aGroupHandler);
- pgF.setPageGroupHandler(fGroupHandler);
-
- pageGroupManager = new PageGroupManager(rootOperation, pgRoot);
- pageGroupManager.addGroupAfter("Root", pgA); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("A", pgB); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("A", pgD); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("A", pgE); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("B", pgC); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("E", pgF); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("F", pgG); //$NON-NLS-1$
- pageGroupManager.addGroupAfter("F", pgH); //$NON-NLS-1$
- }
-
- public void testSimpleRun() throws Exception {
- HashSet ids = new HashSet();
- ids.add("testprovider1");
- ids.add("testprovider2");
- pgA.setDataModelIDs(ids);
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The root page should be null", pageGroupManager.getCurrentPage() == null); //$NON-NLS-1$
- pageGroupManager.moveBackOnePage(); // Should do nothing.
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- aGroupHandler.setGroupIDToSelect("B"); //$NON-NLS-1$
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be r1", pageGroupManager.getCurrentPage() == r1); //$NON-NLS-1$
- checkResults();
- assertTrue("Data models not Ok for page group A", checkDataModels()); //$NON-NLS-1$
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be b1", pageGroupManager.getCurrentPage() == b1); //$NON-NLS-1$
- expectedOps.add(a);
- expectedOps.add(b);
- expectedOps.add(c);
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be b2", pageGroupManager.getCurrentPage() == b2); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be c1", pageGroupManager.getCurrentPage() == c1); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f1", pageGroupManager.getCurrentPage() == f1); //$NON-NLS-1$
- expectedOps.add(d);
- expectedOps.add(e);
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f3", pageGroupManager.getCurrentPage() == f3); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f5", pageGroupManager.getCurrentPage() == f5); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f6", pageGroupManager.getCurrentPage() == f6); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- fGroupHandler.setGroupIDToSelect("G"); //$NON-NLS-1$
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f4); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertFalse("There should not be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be g1", pageGroupManager.getCurrentPage() == g1); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f4); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f6); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f5); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f3); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f1); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == c1); //$NON-NLS-1$
- expectedOps.setSize(3);
- expectedUndoOps.add(e);
- expectedUndoOps.add(d);
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be b2", pageGroupManager.getCurrentPage() == b2); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be b1", pageGroupManager.getCurrentPage() == b1); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveBackOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The root page should be r1", pageGroupManager.getCurrentPage() == r1); //$NON-NLS-1$
- expectedOps = new Vector();
- expectedUndoOps.add(c);
- expectedUndoOps.add(b);
- expectedUndoOps.add(a);
- checkResults();
-
- reset();
- aGroupHandler.setGroupIDToSelect("D"); //$NON-NLS-1$
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be d1", pageGroupManager.getCurrentPage() == d1); //$NON-NLS-1$
- expectedOps.add(a);
- expectedOps.add(b);
- expectedOps.add(c);
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be d2", pageGroupManager.getCurrentPage() == d2); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be d3", pageGroupManager.getCurrentPage() == d3); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f1", pageGroupManager.getCurrentPage() == f1); //$NON-NLS-1$
- expectedOps.add(d);
- expectedOps.add(e);
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f3", pageGroupManager.getCurrentPage() == f3); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f5", pageGroupManager.getCurrentPage() == f5); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- assertTrue("There should be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f6", pageGroupManager.getCurrentPage() == f6); //$NON-NLS-1$
- checkResults();
-
- pageGroupManager.moveForwardOnePage();
- fGroupHandler.setGroupIDToSelect(null);
- assertFalse("There should not be a next page", pageGroupManager.hasNextPage()); //$NON-NLS-1$
- assertTrue("The page should be f4", pageGroupManager.getCurrentPage() == f4); //$NON-NLS-1$
- checkResults();
- }
-
- private void checkResults() {
- assertTrue("Expected=" + expectedOps.size() + " executed=" + BaseOperation.resultList.size(), BaseOperation.resultList.size() == expectedOps.size()); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int index = 0; index < BaseOperation.resultList.size(); index++) {
- assertEquals(expectedOps.elementAt(index), BaseOperation.resultList.elementAt(index));
- }
-
- assertTrue("Expected undo=" + expectedUndoOps.size() + " executed=" + BaseOperation.undoList.size(), BaseOperation.undoList.size() == expectedUndoOps.size()); //$NON-NLS-1$ //$NON-NLS-2$
-
- for (int index = 0; index < BaseOperation.undoList.size(); index++) {
- assertEquals(expectedUndoOps.elementAt(index), BaseOperation.undoList.elementAt(index));
- }
- }
-
- private void reset() {
- BaseOperation.resultList.removeAllElements();
- expectedOps.removeAllElements();
- BaseOperation.undoList.removeAllElements();
- expectedUndoOps.removeAllElements();
- }
-
- private boolean checkDataModels() {
- IDataModel model = dataModel;
-
- boolean containsModel1 = model.isNestedModel("testprovider1");
- boolean containsModel2 = model.isNestedModel("testprovider2");
- boolean prop1 = model.isPropertySet("provider1Prop1");
- boolean prop2 = model.isPropertySet("provider1Prop2");
- boolean prop3 = model.isPropertySet("provider1Prop3");
- boolean prop4 = model.isPropertySet("provider1Prop4");
- boolean prop5 = model.isPropertySet("provider2Prop1");
- boolean prop6 = model.isPropertySet("provider2Prop2");
- boolean prop7 = model.isPropertySet("provider2Prop3");
- boolean prop8 = model.isPropertySet("provider2Prop4");
- boolean value1 = model.getProperty("provider1Prop1").equals("11");
- boolean value2 = model.getProperty("provider1Prop2").equals("22");
- boolean value3 = model.getProperty("provider1Prop3").equals("33");
- boolean value4 = model.getProperty("provider1Prop4").equals("44");
- boolean value5 = model.getProperty("provider2Prop1").equals("1111");
- boolean value6 = model.getProperty("provider2Prop2").equals("2222");
- boolean value7 = model.getProperty("provider2Prop3").equals("3333");
- boolean value8 = model.getProperty("provider2Prop4").equals("4444");
-
- return containsModel1 && containsModel2 && prop1 && prop2 && prop3 && prop4 && prop5 && prop6 && prop7 && prop8 && value1 && value2 && value3 && value4 && value5 && value6 && value7 && value8;
- }
-
- private class AGroupHandler implements IDMPageGroupHandler {
- private String groupID_;
-
- public String getNextPageGroup(String currentPageGroupID, String[] pageGroupIDs) {
- String result = null;
-
- if (currentPageGroupID == null) {
- result = groupID_;
- } else if (currentPageGroupID.equals("E")) { //$NON-NLS-1$
- result = null;
- } else {
- result = "E"; //$NON-NLS-1$
- }
-
- return result;
- }
-
- public void setGroupIDToSelect(String id) {
- groupID_ = id;
- }
- }
-
- private class FGroupHandler implements IDMPageGroupHandler {
- private String groupID_;
-
- public String getNextPageGroup(String currentPageGroupID, String[] pageGroupIDs) {
- if (currentPageGroupID == null)
- return groupID_;
-
- return null;
- }
-
- public void setGroupIDToSelect(String id) {
- groupID_ = id;
- }
- }
-
- //
- // F has pages f1, f2, f3, f4, f5, f6
- // the page handler for F will return the following:
- // expected = f1 returns f1
- // expected = f2 returns skip
- // expected = f3 returns before f6
- // expected = f4 returns null
- // expected = f5 returns after f5
- // expected = f6 returns f4
- //
- // This handle should cause the following pages to be used.
- // f1, f3, f5, f6, f4, null
- //
- private class FPageHandler implements IDMPageHandler {
- public String getNextPage(String currentPageName, String expectedNextPageName) {
- String result = null;
-
- if (currentPageName == null) {
- result = "f1"; //$NON-NLS-1$
- } else if (currentPageName.equals("f1")) { //$NON-NLS-1$
- result = IDMPageHandler.SKIP_PAGE;
- } else if (currentPageName.equals("f3")) { //$NON-NLS-1$
- result = IDMPageHandler.PAGE_BEFORE + "f6"; //$NON-NLS-1$
- } else if (currentPageName.equals("f4")) { //$NON-NLS-1$
- result = null;
- } else if (currentPageName.equals("f5")) { //$NON-NLS-1$
- result = IDMPageHandler.PAGE_AFTER + "f5"; //$NON-NLS-1$
- } else if (currentPageName.equals("f6")) { //$NON-NLS-1$
- result = "f4"; //$NON-NLS-1$
- }
-
- return result;
- }
-
- public String getPreviousPage(String currentPageName, String expectedPreviousPageName) {
- return expectedPreviousPageName;
- }
-
- }
-
- private class EmptyProvider extends AbstractDataModelProvider {
-
- public Set getPropertyNames() {
- return new HashSet();
- }
- }
-
- private class WizardPage extends DataModelWizardPage {
- private boolean canFinish_ = true;
-
- public WizardPage(String id) {
- super(dataModel, id);
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- return null;
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[0];
- }
-
- public void setCanFinish(boolean canFinish) {
- canFinish_ = canFinish;
- }
-
- public boolean canPageFinish() {
- return canFinish_;
- }
-
- public IDataModelOperation createOperation() {
- return null;
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider1.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider1.java
deleted file mode 100644
index 996b02f..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-import java.util.Set;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class TestProvider1 extends AbstractDataModelProvider
-{
- public Set getPropertyNames(){
- Set propertyNames = super.getPropertyNames();
- propertyNames.add("provider1Prop1");
- propertyNames.add("provider1Prop2");
- propertyNames.add("provider1Prop3");
- propertyNames.add("provider1Prop4");
-
- return propertyNames;
- }
-
- public void init()
- {
- setProperty( "provider1Prop1", "11" );
- setProperty( "provider1Prop2", "22" );
- setProperty( "provider1Prop3", "33" );
- setProperty( "provider1Prop4", "44" );
- }
-
- public String getID()
- {
- return "testprovider1";
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider2.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider2.java
deleted file mode 100644
index 670149d..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/manager/TestProvider2.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.manager;
-
-import java.util.Set;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class TestProvider2 extends AbstractDataModelProvider
-{
- public Set getPropertyNames(){
- Set propertyNames = super.getPropertyNames();
- propertyNames.add("provider2Prop1");
- propertyNames.add("provider2Prop2");
- propertyNames.add("provider2Prop3");
- propertyNames.add("provider2Prop4");
-
- return propertyNames;
- }
-
- public void init()
- {
- setProperty( "provider2Prop1", "1111" );
- setProperty( "provider2Prop2", "2222" );
- setProperty( "provider2Prop3", "3333" );
- setProperty( "provider2Prop4", "4444" );
- }
-
- public String getID()
- {
- return "testprovider2";
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelProvider.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelProvider.java
deleted file mode 100644
index d619d48..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelProvider.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class Test2DataModelProvider extends AbstractDataModelProvider {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizard.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizard.java
deleted file mode 100644
index 63eb6e6..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizard.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.AddablePageGroup;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.SimplePageGroup;
-import org.eclipse.wst.common.frameworks.internal.ui.SimplePageGroupHandler;
-
-public class Test2DataModelWizard extends DataModelWizard {
-
- protected IDataModelProvider getDefaultProvider() {
- return new Test2DataModelProvider();
- }
-
- protected AddablePageGroup createRootPageGroup() {
- SimplePageGroup pg = (SimplePageGroup) super.createRootPageGroup();
- pg.setPageGroupHandler(new SimplePageGroupHandler() {
- public String getNextPageGroup(String currentPageGroupID, String[] pageGroupIDs) {
- if (currentPageGroupID == null) {
- for (int i = 0; i < pageGroupIDs.length; i++) {
- if (pageGroupIDs[i].equals("bar")) { //$NON-NLS-1$
- return "bar"; //$NON-NLS-1$
- }
- }
- }
- return super.getNextPageGroup(currentPageGroupID, pageGroupIDs);
- }
- });
- return pg;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory.java
deleted file mode 100644
index 3e369ad..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.DMWizardExtensionFactory;
-
-public class Test2DataModelWizardFactory extends DMWizardExtensionFactory {
-
- protected String getPageName() {
- return "A Page"; //$NON-NLS-1$
- }
-
- protected IDataModelProvider getProvider(){
- return new Test2DataModelProvider(){
- public IDataModelOperation getDefaultOperation() {
- return new AbstractDataModelOperation(){
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println(getPageName());
- return OK_STATUS;
- }
- };
- }
- };
- }
-
- public DataModelWizardPage[] createPageGroup(IDataModel dataModel, String pageGroupID) {
- return new DataModelWizardPage[]{new DataModelWizardPage(DataModelFactory.createDataModel(getProvider()), getPageName()) {
- protected String[] getValidationPropertyNames() {
- // TODO Auto-generated method stub
- return null;
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- GridData data = new GridData(GridData.FILL_BOTH);
- Label label = new Label(composite, SWT.NULL);
- label.setLayoutData(data);
- label.setText(getPageName());
- return composite;
- }
- }};
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory2.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory2.java
deleted file mode 100644
index 0f758a7..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory2.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-public class Test2DataModelWizardFactory2 extends Test2DataModelWizardFactory {
-
- protected String getPageName() {
- return "A Better Page"; //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory3.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory3.java
deleted file mode 100644
index 891e403..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2DataModelWizardFactory3.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-public class Test2DataModelWizardFactory3 extends Test2DataModelWizardFactory {
-
- protected String getPageName() {
- return "Another Page, but not better"; //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory.java
deleted file mode 100644
index fc27174..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.wst.common.tests.ui.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.DMWizardPageExtensionFactory;
-
-public class Test2PageWizardExtensionFactory extends
- DMWizardPageExtensionFactory {
-
- public void createAdditionalControls(Composite parent, IDataModel model,
- String pageName) {
- String labelName;
- if ("A Better Page".equals(pageName)) {
- labelName = "An additonal text box for the better page";
- } else if ("Another Page, but not better".equals(pageName)) {
- labelName = "An additonal text box for the NOT better page";
- } else {
- return;
- }
-
- Label label = new Label(parent, SWT.NONE);
- label.setText(labelName);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory2.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory2.java
deleted file mode 100644
index 83c0b2f..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/Test2PageWizardExtensionFactory2.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.eclipse.wst.common.tests.ui.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.operation.extensionui.DMWizardPageExtensionFactory;
-
-public class Test2PageWizardExtensionFactory2 extends
- DMWizardPageExtensionFactory {
-
- public void createAdditionalControls(Composite parent, IDataModel model,
- String pageName) {
- if ("A Better Page".equals(pageName)) {
- Button checkbox = new Button(parent, SWT.CHECK);
- checkbox.setText("Additional checkbox for a better page");
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataModelProvider.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataModelProvider.java
deleted file mode 100644
index 5fb74f4..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataModelProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class TestDataModelProvider extends AbstractDataModelProvider {
- public String getID() {
- return "TestWizardID"; //$NON-NLS-1$
- }
-
- public Set getPropertyNames() {
- HashSet result = new HashSet();
-
- result.add("prop1"); //$NON-NLS-1$
- result.add("prop2"); //$NON-NLS-1$
-
- return result;
- }
-
- public IDataModelOperation getDefaultOperation() {
- return new TestOperation();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataWizard.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataWizard.java
deleted file mode 100644
index ce6dde7..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestDataWizard.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.AddablePageGroup;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.SimplePageGroup;
-import org.eclipse.wst.common.frameworks.internal.ui.PageGroupManager;
-
-public class TestDataWizard extends DataModelWizard {
- private SimplePageGroup root;
-
- public TestDataWizard() {
- setForcePreviousAndNextButtons(true);
- setNeedsProgressMonitor(true);
- }
-
- protected void doAddPages() {
- PageGroupManager pageManager = getPageGroupManager();
- pageManager.addGroupAfter(root.getPageGroupID(), new TestPageGroup2(getDataModel()));
-
- super.doAddPages();
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new TestDataModelProvider();
- }
-
- protected AddablePageGroup createRootPageGroup() {
- root = new TestRootPageGroup(getDataModel());
-
- return root;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestOperation.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestOperation.java
deleted file mode 100644
index ecf4a34..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestOperation.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-public class TestOperation extends AbstractDataModelOperation {
-
- public TestOperation() {
- setID("TestOperation"); //$NON-NLS-1$
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println("In execute: data model=" + getDataModel()); //$NON-NLS-1$
-
- try {
- monitor.beginTask("Test operation: ", 5); //$NON-NLS-1$
- for (int index = 1; index < 6; index++) {
- monitor.subTask("part " + index + " of 5 complete."); //$NON-NLS-1$ //$NON-NLS-2$
- Thread.sleep(1000);
- }
- } catch (Exception exc) {
- throw new ExecutionException("execute threw and exception ", exc); //$NON-NLS-1$
- }
-
- return Status.OK_STATUS;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return Status.OK_STATUS;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println("Undo test operation"); //$NON-NLS-1$
-
- return Status.OK_STATUS;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage1.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage1.java
deleted file mode 100644
index 62a71b4..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage1.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-
-public class TestPage1 extends DataModelWizardPage {
- public TestPage1(IDataModel model) {
- super(model, "Page1"); //$NON-NLS-1$
- setTitle("Title for test page1"); //$NON-NLS-1$
- setDescription("Description for test page 1"); //$NON-NLS-1$
- }
-
- public boolean canPageFinish() {
- return true;
- }
-
- public IDataModelOperation createOperation() {
- return null;
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite group = new Composite(parent, SWT.NONE);
- Button button1 = new Button(group, SWT.PUSH);
- Button button2 = new Button(group, SWT.PUSH);
-
- button1.setText("Button1"); //$NON-NLS-1$
- button2.setText("Button2"); //$NON-NLS-1$
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- return group;
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[0];
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage2.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage2.java
deleted file mode 100644
index 78963f9..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPage2.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-
-public class TestPage2 extends DataModelWizardPage {
- public TestPage2(IDataModel model) {
- super(model, "Page2"); //$NON-NLS-1$
- setTitle("Title for test page2"); //$NON-NLS-1$
- setDescription("Description for test page 2"); //$NON-NLS-1$
- }
-
- public boolean canPageFinish() {
- return true;
- }
-
- public IDataModelOperation createOperation() {
- return null;
- }
-
- protected Composite createTopLevelComposite(Composite parent) {
- Composite group = new Composite(parent, SWT.NONE);
- Button button1 = new Button(group, SWT.PUSH);
- Button button2 = new Button(group, SWT.PUSH);
-
- button1.setText("Page 2 button1"); //$NON-NLS-1$
- button2.setText("Page 2 button2"); //$NON-NLS-1$
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- return group;
- }
-
- protected String[] getValidationPropertyNames() {
- return new String[0];
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPageGroup2.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPageGroup2.java
deleted file mode 100644
index 98a8355..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestPageGroup2.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.SimplePageGroup;
-
-public class TestPageGroup2 extends SimplePageGroup {
- private IDataModel dataModel;
-
- public TestPageGroup2(IDataModel dataModel) {
- super("group2", dataModel.getID(), true, "TestOperation"); //$NON-NLS-1$ //$NON-NLS-2$
- this.dataModel = dataModel;
-
- addPages(new IWizardPage[]{new TestPage2(this.dataModel)});
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestRootPageGroup.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestRootPageGroup.java
deleted file mode 100644
index ad285b9..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestRootPageGroup.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.SimplePageGroup;
-
-public class TestRootPageGroup extends SimplePageGroup {
- private IDataModel dataModel;
-
- public TestRootPageGroup(IDataModel dataModel) {
- super(dataModel.getID(), dataModel.getID());
- this.dataModel = dataModel;
-
- addPages(new IWizardPage[]{new TestPage1(this.dataModel)});
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestWizardTestcase.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestWizardTestcase.java
deleted file mode 100644
index 0d05a9b..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/wizard/TestWizardTestcase.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.tests.ui.wizard;
-
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-
-import junit.framework.TestCase;
-
-public class TestWizardTestcase extends TestCase {
- private TestDataWizard wizard_;
-
- protected void setUp() throws Exception {
- super.setUp();
-
- wizard_ = new TestDataWizard();
- }
-
- public void testSimpleWizard() throws Exception {
- WizardDialog dialog = new WizardDialog(null, wizard_);
-
- dialog.open();
- }
-
- public void test2DataModelWizard() throws Exception {
- Display.getDefault().syncExec( new Runnable(){
- public void run() {
- WizardDialog dialog = new WizardDialog(null, new Test2DataModelWizard());
- dialog.open();
- }
- });
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/.classpath b/tests/org.eclipse.wst.common.tests.validation.guard/.classpath
deleted file mode 100644
index 304e861..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/.project b/tests/org.eclipse.wst.common.tests.validation.guard/.project
deleted file mode 100644
index 0e255c9..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests.validation.guard</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.common.tests.validation.guard/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 73e4b8d..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sat Mar 29 07:53:31 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.common.tests.validation.guard/META-INF/MANIFEST.MF
deleted file mode 100644
index 4d5fefe..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.common.tests.validation.guard;singleton:=true
-Bundle-Version: 1.0.2.qualifier
-Bundle-Activator: org.eclipse.wst.common.tests.validation.guard.Activator
-Bundle-Vendor: %Bundle-Vendor.0
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.wst.validation;bundle-version="[1.1.103,1.3.0)",
- org.eclipse.core.resources
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/build.properties b/tests/org.eclipse.wst.common.tests.validation.guard/build.properties
deleted file mode 100644
index 30b2fc4..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- plugin.xml
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/plugin.properties b/tests/org.eclipse.wst.common.tests.validation.guard/plugin.properties
deleted file mode 100644
index 0b223e4..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-Bundle-Name.0 = Validation Framework Guard Test cases
-Bundle-Vendor.0 = Eclipse.org
-
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/plugin.xml b/tests/org.eclipse.wst.common.tests.validation.guard/plugin.xml
deleted file mode 100644
index 84daa2b..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="T3A" name="T3A">
- <validator
- build="false"
- class="org.eclipse.wst.common.tests.validation.guard.T3A"
- manual="false">
- </validator>
- </extension>
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="T3B" name="T3B">
- <validator class="org.eclipse.wst.common.tests.validation.guard.T3B">
- <include>
- <rules>
- <facet
- id="a.bogus.facet">
- </facet>
- </rules>
- </include>
- </validator>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/Activator.java b/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/Activator.java
deleted file mode 100644
index e512afe..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/Activator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.wst.common.tests.validation.guard;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * The purpose of this plug-in is to ensure that it never gets loaded. If it does it means that we are
- * activating validators too early.
- */
-public class Activator extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.wst.common.tests.validation.guard";
-
- // The shared instance
- private static Activator plugin;
-
- public Activator() {
- RuntimeException re = new RuntimeException("This plug-in should never be loaded. If it is it means that we are loading " +
- "validators too early, and causing unneccessary plug-in activation.");
- handleException(re);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Write this exception to the log.
- * <p>
- * We are in the transition of moving to a new approach for localized messages. This is the new
- * approach for exceptions.
- *
- * @param e the throwable, this can be null in which case it is a nop.
- */
- public void handleException(Throwable e){
- if (e == null)return;
- Status status = new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e);
- getLog().log(status);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3A.java b/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3A.java
deleted file mode 100644
index 7146182..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3A.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.wst.common.tests.validation.guard;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-
-/**
- * A test validator that we never expect to be activated. The reason we never expect it to be validated is that by
- * default it is turned off. The user can still explicitly turn it on, in which case it will run, and that would not
- * be considered an error.
- * @author karasiuk
- *
- */
-public class T3A extends AbstractValidator {
-
- private boolean _invoked;
-
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
- if (!_invoked){
- _invoked = true;
- throw new RuntimeException("The T3A validator should never be activated or called. If this validator was manually turned on " +
- "though the preferences, then this is not a real error.");
- }
-
- return null;
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3B.java b/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3B.java
deleted file mode 100644
index bb649ae..0000000
--- a/tests/org.eclipse.wst.common.tests.validation.guard/src/org/eclipse/wst/common/tests/validation/guard/T3B.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.eclipse.wst.common.tests.validation.guard;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-
-/**
- * A test validator that we never expect to be activated. The reason we never expect it to be validated is that it has a bogus facet filter.
- * @author karasiuk
- *
- */
-public class T3B extends AbstractValidator {
-
- private boolean _invoked;
-
- public ValidationResult validate(IResource resource, int kind, ValidationState state, IProgressMonitor monitor){
- if (!_invoked){
- _invoked = true;
- throw new RuntimeException("The T3B validator should never be activated or called. If this validator was manually chnaged " +
- "though the preferences, and the bogus filter was removed, then this isn't a real error.");
- }
-
- return null;
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/.classpath b/tests/org.eclipse.wst.common.tests/.classpath
deleted file mode 100644
index 0c793d6..0000000
--- a/tests/org.eclipse.wst.common.tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="commontests"/>
- <classpathentry kind="src" path="frameworktests"/>
- <classpathentry kind="src" path="apitools"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.common.tests/.cvsignore b/tests/org.eclipse.wst.common.tests/.cvsignore
deleted file mode 100644
index a36ac25..0000000
--- a/tests/org.eclipse.wst.common.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-temp.folder
-commontests.jar
-javaCompiler.commontests.jar.args
diff --git a/tests/org.eclipse.wst.common.tests/.project b/tests/org.eclipse.wst.common.tests/.project
deleted file mode 100644
index 78b0951..0000000
--- a/tests/org.eclipse.wst.common.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.common.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b1f0a3a..0000000
--- a/tests/org.eclipse.wst.common.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Thu May 10 18:38:31 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.wst.common.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.common.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 3fa2503..0000000
--- a/tests/org.eclipse.wst.common.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,37 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.common.tests; singleton:=true
-Bundle-Version: 1.2.1.qualifier
-Bundle-ClassPath: commontests.jar
-Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
-Bundle-Vendor: %Bundle-Vendor.0
-Export-Package: org.eclipse.etools.common.test.apitools,
- org.eclipse.etools.common.tests.xml,
- org.eclipse.wst.common.environment.tests,
- org.eclipse.wst.common.extras,
- org.eclipse.wst.common.frameworks.artifactedit.tests,
- org.eclipse.wst.common.frameworks.componentcore.tests,
- org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests,
- org.eclipse.wst.common.frameworks.datamodel.tests,
- org.eclipse.wst.common.frameworks.datamodel.tests.extended,
- org.eclipse.wst.common.frameworks.tests.bvt,
- org.eclipse.wst.common.tests
-Require-Bundle: org.junit;bundle-version="[3.8.2,4.0.0)";visibility:=reexport,
- org.eclipse.core.resources;visibility:=reexport,
- org.eclipse.core.runtime.compatibility,
- org.eclipse.wst.common.frameworks;visibility:=reexport,
- org.eclipse.wst.common.emfworkbench.integration,
- org.eclipse.emf.common,
- org.eclipse.emf.ecore,
- org.eclipse.core.commands,
- org.eclipse.wst.common.modulecore,
- org.eclipse.wst.common.tests.collector;visibility:=reexport,
- org.eclipse.jem.util,
- org.eclipse.wst.common.environment,
- org.eclipse.wst.common.emf,
- org.eclipse.wst.validation;bundle-version="1.2.0"
-Eclipse-LazyStart: true
-Plugin-Class: org.eclipse.wst.common.tests.CommonTestsPlugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Localization: plugin
diff --git a/tests/org.eclipse.wst.common.tests/about.html b/tests/org.eclipse.wst.common.tests/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/tests/org.eclipse.wst.common.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the RedistributorÂ’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/tests/org.eclipse.wst.common.tests/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java b/tests/org.eclipse.wst.common.tests/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java
deleted file mode 100644
index 5767d21..0000000
--- a/tests/org.eclipse.wst.common.tests/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.eclipse.etools.common.test.apitools;
-
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.internal.resources.ProjectDescription;
-import org.eclipse.core.internal.resources.ProjectDescriptionReader;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-public class ProjectUnzipUtil {
-
- private IPath zipLocation;
- private String[] projectNames;
- private IPath rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- private static final String META_PROJECT_NAME = ".project";
-
-
-
- public ProjectUnzipUtil(IPath aZipLocation, String[] aProjectNames) {
- zipLocation = aZipLocation;
- projectNames = aProjectNames;
-
- }
-
- public boolean createProjects() {
- try {
- expandZip();
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
- buildProjects();
- } catch (CoreException e) {
- e.printStackTrace();
- return false;
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
-
- return true;
-
- }
-
- private IProgressMonitor getProgessMonitor() {
- return new NullProgressMonitor();
- }
-
- private void expandZip() throws CoreException, IOException {
- IProgressMonitor monitor = getProgessMonitor();
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(zipLocation.toFile());
- } catch (IOException e1) {
- throw e1;
- }
- Enumeration entries = zipFile.entries();
- while (entries.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- monitor.subTask(entry.getName());
- File aFile = computeLocation(entry.getName()).toFile();
- File parentFile = null;
- try {
- if (entry.isDirectory()) {
- aFile.mkdirs();
- } else {
- parentFile = aFile.getParentFile();
- if (!parentFile.exists())
- parentFile.mkdirs();
- if (!aFile.exists())
- aFile.createNewFile();
- copy(zipFile.getInputStream(entry), new FileOutputStream(aFile));
- if (entry.getTime() > 0)
- aFile.setLastModified(entry.getTime());
- }
- } catch (IOException e) {
- throw e;
- }
- monitor.worked(1);
- }
- }
-
- private IPath computeLocation(String name) {
- return rootLocation.append(name);
- }
-
-
- public static void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[1024];
- try {
- int n = in.read(buffer);
- while (n > 0) {
- out.write(buffer, 0, n);
- n = in.read(buffer);
- }
- } finally {
- in.close();
- out.close();
- }
- }
-
- public void setRootLocation(IPath rootLocation) {
- this.rootLocation = rootLocation;
- }
-
- private void buildProjects() throws IOException, CoreException {
- for (int i = 0; i < projectNames.length; i++) {
- ProjectDescriptionReader pd = new ProjectDescriptionReader();
- IPath projectPath = new Path("/" + projectNames[i] + "/" + META_PROJECT_NAME);
- IPath path = rootLocation.append(projectPath);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectNames[i]);
- ProjectDescription description;
- try {
- description = pd.read(path);
- project.create(description, (getProgessMonitor()));
- project.open(getProgessMonitor());
-
- } catch (IOException e) {
- throw e;
- } catch (CoreException e) {
- throw e;
- }
- }
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/build.properties b/tests/org.eclipse.wst.common.tests/build.properties
deleted file mode 100644
index c8e1e20..0000000
--- a/tests/org.eclipse.wst.common.tests/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-bin.includes = commontests.jar,\
- plugin.xml,\
- testData/,\
- test.xml,\
- about.html,\
- META-INF/,\
- plugin.properties
-source.commontests.jar = commontests/,\
- frameworktests/,\
- apitools/
-output.commontests.jar = bin/
diff --git a/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties b/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties
deleted file mode 100644
index 8db5dee..0000000
--- a/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-CONTACT=danberg@us.ibm.com
-ComponentShortName=commontests
-ComponentFullName=Common Tests
-ComponentCompetency=Common Tests
-JavaCompile.1=srcjar
-BuildVerification.1=call webbvt.bat
-Export.jarFile=commontests.jar
diff --git a/tests/org.eclipse.wst.common.tests/build/package.xml b/tests/org.eclipse.wst.common.tests/build/package.xml
deleted file mode 100644
index d5988c4..0000000
--- a/tests/org.eclipse.wst.common.tests/build/package.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<project name="org.eclipse.wst.common.tests" default="packagingPlugin" basedir="./..">
- <target name="init">
- <property name="packageDir" value=""/>
- <property name="plugin.directory" value="${basedir}"/>
- <property name="plugin.id" value="org.eclipse.wst.common.tests"/>
- <property name="plugin.version" value=""/>
- </target>
- <target name="packagingPlugin" depends="init">
- <echo message="${plugin.id}"/>
- <copy todir="${packageDir}/plugins/${plugin.id}_${plugin.version}">
- <fileset dir="${plugin.directory}">
- <include name="plugin.xml"/>
- <include name="runtime/commontests.jar"/>
- </fileset>
- </copy>
- </target>
-</project>
diff --git a/tests/org.eclipse.wst.common.tests/build/wsBuild.xml b/tests/org.eclipse.wst.common.tests/build/wsBuild.xml
deleted file mode 100644
index 77c0b82..0000000
--- a/tests/org.eclipse.wst.common.tests/build/wsBuild.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE project [
- <!ENTITY baseBuild SYSTEM "file:../../wsBuildDef.xml">
-]>
-
-<project name="buildPlugin" default="build" basedir="./..">
-
-<!-- include the common xml build file -->
-&baseBuild;
-
-<target name="build" depends="prepare" if="plugin.id">
- <antcall target="buildjar">
- <param name="jarname" value="${defaultjarname}"/>
- <param name="jarclasspath" value="${plugin.classpath}"/>
- </antcall>
-</target>
-</project>
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java
deleted file mode 100644
index 7d984d1..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Created on Mar 17, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.etools.common.tests.xml;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CharacterData;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-/**
- * THE MASTER COPY of this class is in com.ibm.etools.commontests
- * Please update the copy in commontests and then copy this class to
- * where you need it if you are looking at a different copy
- *
- * @author jsholl
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DomComparitor {
- private static HashSet attributeList;
-
- public static String compareDoms(InputSource source1, InputSource source2, HashSet ignorableAtts, EntityResolver entityResolver) throws Exception {
-// attributeList = ignorableAtts;
-// DOMParser parser = new DOMParser();
-// if (entityResolver == null) {
-// parser.setEntityResolver(new EntityResolver() {
-// public InputSource resolveEntity(String arg0, String arg1) throws SAXException, IOException {
-// return null;
-// }
-// });
-// } else {
-// parser.setEntityResolver(entityResolver);
-// }
-// parser.parse(source1);
-// Document doc1 = parser.getDocument();
-// parser.parse(source2);
-// Document doc2 = parser.getDocument();
-// return compareNodes(doc1, doc2);
- return null;
- }
- public static String compareDoms(InputSource source1, InputSource source2, HashSet ignorableAtts) throws Exception {
- return compareDoms(source1, source2, ignorableAtts, null);
- }
-
- public static String compareDoms(InputSource source1, InputSource source2) throws Exception {
- return compareDoms(source1, source2, null);
- }
-
- public static String compareNodes(Node node1, Node node2) throws Exception {
- // System.out.println("checking A:" + node1);
- // System.out.println("checking B:" + node2);
- // System.out.println("nodeType=" + node1.getNodeType());
- // System.out.println("getNodeName=" + node1.getNodeName());
- // System.out.println("getNodeValue=" + node1.getNodeValue());
-
- //Generic Node Testing
- // if (node1 == null && node2 == null)
- // return null;
- // else
- if ((node1 != null && node2 == null) || node1 == null && node2 != null)
- return nullNodeEncountered(node1, node2);
- else if (node1.getNodeType() != node2.getNodeType()) {
- return mismatch("Node.getNodeType() " + node1.getNodeType() + " " + node2.getNodeType(), node1, node2);
- } else if (node1.getNodeName() != node2.getNodeName()) {
- return mismatch("Node.getNodeName() <" + node1.getNodeName() + "> <" + node2.getNodeName() + ">", node1, node2);
- } else if (!(node1.getNodeValue() == null && node2.getNodeValue() == null)) {
- if (node1.getNodeValue() == null) {
- return mismatch("Node.getNodeValue() node A is null", node1, node2);
- } else if (node2.getNodeValue() == null) {
- return mismatch("Node.getNodeValue() node B is null", node1, node2);
- } else if (!node1.getNodeValue().trim().equals(node2.getNodeValue().trim())) {
- return mismatch("Node.getNodeValue() <" + node1.getNodeValue() + "> <" + node2.getNodeValue() + ">", node1, node2);
- }
- }
- //TODO strengthen node comparisons as necessary
- //Specialized Node Testing
- switch (node1.getNodeType()) {
- case Node.TEXT_NODE :
- case Node.CDATA_SECTION_NODE :
- CharacterData cdata1 = (CharacterData) node1;
- CharacterData cdata2 = (CharacterData) node2;
- if (!cdata1.getData().trim().equals(cdata2.getData().trim())) {
- return mismatch("CharacterData.getData() " + cdata1.getData() + " " + cdata2.getData(), node1, node2);
- }
- break;
- case Node.ATTRIBUTE_NODE :
- Attr attr1 = (Attr) node1;
- Attr attr2 = (Attr) node2;
- if (!attr1.getName().equals(attr2.getName())) {
- return mismatch("Attr.getName() " + attr1.getName() + " " + attr2.getName(), node1, node2);
- } else if (!attr1.getValue().equals(attr2.getValue())) {
- return mismatch("Attr.getValue() " + attr1.getValue() + " " + attr2.getValue(), node1, node2);
- } else if (attr1.getSpecified() != attr2.getSpecified()) {
- return mismatch("Attr.getSpecified() " + attr1.getSpecified() + " " + attr2.getSpecified(), node1, node2);
- }
- break;
- case Node.DOCUMENT_NODE :
- Document doc1 = (Document) node1;
- Document doc2 = (Document) node2;
- String result = compareNodes(doc1.getDoctype(), doc2.getDoctype());
- if (result != null) {
- return result;
- }
- break;
- case Node.DOCUMENT_TYPE_NODE :
- DocumentType docType1 = (DocumentType) node1;
- DocumentType docType2 = (DocumentType) node2;
- if (!docType1.getPublicId().equals(docType2.getPublicId())) {
- return mismatch("DocumentType.getPublicId() " + docType1.getPublicId() + " " + docType2.getPublicId(), node1, node2);
- }
- break;
- case Node.PROCESSING_INSTRUCTION_NODE :
- ProcessingInstruction pInst1 = (ProcessingInstruction) node1;
- ProcessingInstruction pInst2 = (ProcessingInstruction) node2;
- //System.out.println("ProcessingInstruction todo");
- break;
- case Node.DOCUMENT_FRAGMENT_NODE :
- DocumentFragment frag1 = (DocumentFragment) node1;
- DocumentFragment frag2 = (DocumentFragment) node2;
- //System.out.println("DocumentFragment todo");
- break;
-
- case Node.ELEMENT_NODE :
- case Node.COMMENT_NODE :
- case Node.ENTITY_NODE :
- case Node.NOTATION_NODE :
- break;
-
- }
-
- //Recursion
- NamedNodeMap attributes1 = node1.getAttributes();
- NamedNodeMap attributes2 = node2.getAttributes();
-
- if (attributes1 != null && attributes2 != null) {
- ignoreAttributes(attributes1, attributes2);
- if (attributes1.getLength() != attributes2.getLength()) {
- return mismatch("getAttributes().getLength() " + attributes1.getLength() + " " + attributes2.getLength(), node1, node2);
- }
- for (int i = 0; i < attributes1.getLength(); i++) {
- Attr attr1 = (Attr) attributes1.item(i);
- Attr attr2 = (Attr) attributes2.item(i);
- String results = compareNodes(attr1, attr2);
- if (null != results) {
- return results;
- }
- }
-
- } else if (attributes1 != null || attributes2 != null) {
- return mismatch("getAttributes() null", node1, node2);
- }
-
- ArrayList children1 = getAsArrayList(node1.getChildNodes());
- ArrayList children2 = getAsArrayList(node2.getChildNodes());
-
- ignoreComments(children1);
- ignoreComments(children2);
-
- ignoreEmptyTextNodes(children1);
- ignoreEmptyTextNodes(children2);
-
- if (children1.size() != children2.size()) {
- return mismatch("Node.hasChildNodes() " + children1.size() + " " + children2.size(), node1, node2);
- }
-
- for (int i = 0; i < children1.size(); i++) {
- Node child1 = (Node) children1.get(i);
- Node child2 = (Node) children2.get(i);
- String results = compareNodes(child1, child2);
- if (null != results) {
- return results;
- }
- }
- return null;
- }
-
- private static ArrayList getAsArrayList(NodeList originalList) {
- ArrayList newList = new ArrayList();
- if (originalList != null) {
- for (int i = 0; i < originalList.getLength(); i++) {
- newList.add(originalList.item(i));
- }
- }
- return newList;
- }
-
- private static void ignoreComments(ArrayList list) {
- ArrayList toRemove = new ArrayList();
- for (int i = 0; i < list.size(); i++) {
- Node node = (Node) list.get(i);
- if (node.getNodeType() == Node.COMMENT_NODE) {
- toRemove.add(node);
- }
- }
- for (int i = 0; i < toRemove.size(); i++) {
- list.remove(toRemove.get(i));
- }
- }
-
- private static void ignoreEmptyTextNodes(ArrayList list) {
- ArrayList toRemove = new ArrayList();
- for (int i = 0; i < list.size(); i++) {
- Node node = (Node) list.get(i);
- if (node.getNodeType() == Node.TEXT_NODE && (node.getNodeValue() == null || node.getNodeValue().trim().equals(""))) {
- toRemove.add(node);
- }
- }
- for (int i = 0; i < toRemove.size(); i++) {
- list.remove(toRemove.get(i));
- }
- }
-
- /**
- * @param attributes1
- */
- private static void ignoreAttributes(NamedNodeMap attributes1, NamedNodeMap attributes2) {
- if (attributeList != null) {
- Iterator it = attributeList.iterator();
- String ignore;
- while (it.hasNext()) {
- ignore = (String) it.next();
- if (attributes1.getNamedItem(ignore) != null)
- attributes1.removeNamedItem(ignore);
- if (attributes2.getNamedItem(ignore) != null)
- attributes2.removeNamedItem(ignore);
- }
- }
- }
-
- public static String nullNodeEncountered(Node node1, Node node2) {
- String message = "Null node encountered";
- Node nonNullNode = node1 == null ? node2 : node1;
- char source = node1 == null ? 'B' : 'A';
- while (nonNullNode != null) {
- message += source + nonNullNode.getNodeName() + "\n";
- nonNullNode = nonNullNode.getParentNode();
- }
- return message;
- }
-
- public static String nodeNotCompared(Node node) {
- String message = "Node node compared:";
- while (node != null) {
- message += node.getNodeName() + "\n";
- node = node.getParentNode();
- }
-
- return message;
- }
-
- public static String mismatch(String mismatchtype, Node node1, Node node2) throws Exception {
- String message = "Nodes A and B do not match because of node." + mismatchtype + "\n";
- while (node1 != null && node2 != null) {
- message += "A:" + node1.getNodeName() + "\n";
- message += "B:" + node2.getNodeName() + "\n";
- node1 = node1.getParentNode();
- node2 = node2.getParentNode();
- }
-
- return message;
- }
-
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java
deleted file mode 100644
index f728081..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Created on Apr 3, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.etools.common.tests.xml;
-
-import java.io.File;
-import java.io.FileReader;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.xml.sax.InputSource;
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class DomComparitorTest extends TestCase {
-
- String baseDir = System.getProperty("user.dir") + java.io.File.separatorChar;
- String testData = baseDir + "testData" + java.io.File.separatorChar;
-
- public DomComparitorTest(String name) {
- super(name);
- }
-
- public void testEqualDoms_01() {
- checkEqual("baseData_01.xml", "baseData_01.xml");
- }
-
- public void testEqualDoms_01_01() {
- checkEqual("baseData_01.xml", "equalTo_01_case_01.xml");
- }
-
- public void testEqualDoms_01_02() {
- checkEqual("baseData_01.xml", "equalTo_01_case_02.xml");
- }
-
- public void testUnequalDom_01_01() {
- checkUnequal("baseData_01.xml", "unequalTo_01_case_01.xml");
- }
-
- public void testUnequalDom_01_02() {
- checkUnequal("baseData_01.xml", "unequalTo_01_case_02.xml");
- }
-
- public void testUnequalDom_01_03() {
- checkUnequal("baseData_01.xml", "unequalTo_01_case_03.xml");
- }
-
- public void testUnequalDom_01_04() {
- checkUnequal("baseData_01.xml", "unequalTo_01_case_04.xml");
- }
-
- //TODO figure out how to compare encodings
- // public void testUnequalDom_01_05() {
- // checkUnequal("baseData_01.xml", "unequalTo_01_case_05.xml");
- // }
-
- private void checkEqual(String fileName1, String fileName2) {
- try {
- InputSource source1 = new InputSource(new FileReader(new File(testData + fileName1)));
- InputSource source2 = new InputSource(new FileReader(new File(testData + fileName2)));
-// String results = DomComparitor.compareDoms(source1, source2);
-// if (results != null) {
-// Assert.fail("Equal doms compared as unequal " + fileName1 + " " + fileName2 + "\ncompare results = " + results);
-// }
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
- private void checkUnequal(String fileName1, String fileName2) {
- try {
- InputSource source1 = new InputSource(new FileReader(new File(testData + fileName1)));
- InputSource source2 = new InputSource(new FileReader(new File(testData + fileName2)));
-// String results = DomComparitor.compareDoms(source1, source2);
-// if (results == null) {
-// Assert.fail("Unequal doms compared as equal " + fileName1 + " " + fileName2);
-// }
- } catch (Exception e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java
deleted file mode 100644
index c1d7c96..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.eclipse.wst.common.extras;
-
-
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-/*
- * Licensed Material - Property of IBM
- * (C) Copyright IBM Corp. 2002 - All Rights Reserved.
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
-public class MemoryUsageTestSuite extends TestSuite {
- //protected String GLOBAL_OUTPUT_FILENAME = "d:/eclipse/common_archive/memoryUsage/CommonArchive_MOF5.out";
- protected String GLOBAL_OUTPUT_FILENAME = "./EMF_Data.txt";
- protected boolean TRACK_MEMORY = true;
- protected String outputFileName;
- /**
- * Constructor for MemoryUsageTestSuite.
- */
- public MemoryUsageTestSuite() {
- super();
- }
- /**
- * Constructor for MemoryUsageTestSuite.
- * @param theClass
- */
- public MemoryUsageTestSuite(Class theClass) {
- super(theClass);
- }
- /**
- * Constructor for MemoryUsageTestSuite.
- * @param name
- */
- public MemoryUsageTestSuite(String name) {
- super(name);
- }
-
- public void run(TestResult result) {
-// TimerStep step = null;
-// if (TRACK_MEMORY) {
-// step = TimerStep.instance();
-// step.setLogFile(getOutputName());
-// if (!step.isOn())
-// step.setIsOn(true);
-// step.write("", "Before " + getMemoryName() + " Test Run");
-// step.totalMemory(0);
-// step.usedMemory(0);
-// }
-// super.run(result);
-// if (TRACK_MEMORY) {
-// step.write("", "After " + getMemoryName() + " Test Run");
-// step.totalMemory(0);
-// step.usedMemory(0);
-// }
-
- super.run(result);
- }
-
- /**
- * Method getOutputName.
- * @return String
- */
- private String getOutputName() {
- if (outputFileName != null && outputFileName.length() > 0)
- return outputFileName;
- return GLOBAL_OUTPUT_FILENAME;
- }
-
-
- /**
- * Method getMemoryName.
- * @return String
- */
- private String getMemoryName() {
- if (getName() != null && getName().length() > 0)
- return getName();
- if (getClass() != null)
- return getClass().getName();
- return "Unknown Test";
- }
-
- /**
- * Sets the outputFileName.
- * @param outputFileName The outputFileName to set
- */
- public void setOutputFileName(String outputFileName) {
- this.outputFileName = outputFileName;
- }
-
- /**
- * Returns the gLOBAL_OUTPUT_FILENAME.
- * @return String
- */
- public String getGLOBAL_OUTPUT_FILENAME() {
- return GLOBAL_OUTPUT_FILENAME;
- }
-
- /**
- * Sets the gLOBAL_OUTPUT_FILENAME.
- * @param gLOBAL_OUTPUT_FILENAME The fileName to set
- */
- public void setGLOBAL_OUTPUT_FILENAME(String fileName) {
- GLOBAL_OUTPUT_FILENAME = fileName;
- }
-
- /**
- * Sets the tRACK_MEMORY.
- * @param tRACK_MEMORY The aBoolean to set
- */
- public void setTRACK_MEMORY(boolean aBoolean) {
- TRACK_MEMORY = aBoolean;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/AssertWarn.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/AssertWarn.java
deleted file mode 100644
index 1b7e79a..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/AssertWarn.java
+++ /dev/null
@@ -1,286 +0,0 @@
-package org.eclipse.wst.common.tests;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.AssertionFailedError;
-
-
-public class AssertWarn extends Assert {
- private static List<AssertionFailedError> warnings = new ArrayList<AssertionFailedError>();
-
- public static void warnEquals(boolean expected, boolean actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(byte expected, byte actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(char expected, char actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(double expected, double actual, double delta) {
- try{
- assertEquals(expected, actual, delta);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(float expected, float actual, float delta) {
- try{
- assertEquals(expected, actual, delta);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(int expected, int actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(Object expected, Object actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(long expected, long actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(short expected, short actual) {
- try{
- assertEquals(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, boolean expected, boolean actual) {
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, byte expected, byte actual) {
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, char expected, char actual) {
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, double expected, double actual, double delta) {
- try{
- assertEquals(message, expected, actual, delta);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, float expected, float actual, float delta) {
- try{
- assertEquals(message, expected, actual, delta);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, int expected, int actual){
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, Object expected, Object actual){
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, String expected, String actual){
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, long expected, long actual){
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnEquals(String message, short expected, short actual){
- try{
- assertEquals(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnFalse(boolean condition){
- try{
- assertFalse(condition);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnFalse(String message, boolean condition){
- try{
- assertFalse(message, condition);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNotNull(Object object) {
- try{
- assertNotNull(object);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNotNull(String message, Object object) {
- try{
- assertNotNull(message, object);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNotSame(Object expected, Object actual) {
- try{
- assertNotSame(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNotSame(String message, Object expected, Object actual) {
- try{
- assertNotSame(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNull(Object object) {
- try{
- assertNull(object);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnNull(String message, Object object) {
- try{
- assertNull(message, object);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnSame(Object expected, Object actual) {
- try{
- assertSame(expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnSame(String message, Object expected, Object actual) {
- try{
- assertSame(message, expected, actual);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnTrue(boolean condition){
- try{
- assertTrue(condition);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warnTrue(String message, boolean condition){
- try{
- assertTrue(message, condition);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warn() {
- try{
- fail();
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void warn(String message) {
- try{
- fail(message);
- } catch(AssertionFailedError e){
- warnings.add(e);
- }
- }
-
- public static void clearWarnings(){
- warnings.clear();
- }
-
- public static List <AssertionFailedError> getWarnings() {
- return Collections.unmodifiableList(warnings);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java
deleted file mode 100644
index 3ec153b..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Created on Nov 24, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.tests;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-import junit.framework.TestFailure;
-import junit.framework.TestResult;
-
-import org.eclipse.core.runtime.IStatus;
-
-public class BaseTestCase extends TestCase {
-
- private static boolean fFailOnLoggedStatus = true;
-
- /**
- *
- */
- public BaseTestCase() {
- super();
- }
-
- /**
- * @param name
- */
- public BaseTestCase(String name) {
- super(name);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- public void setUpTest() throws Exception {
- setUp();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#tearDown()
- */
- public final void tearDownTest() throws Exception {
- tearDown();
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#runBare()
- */
- public final void runCoreTest() throws Throwable {
- runTest();
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- //TODO register any plugins with the JUnitLogListener here that you want to fail on when their log is written too
- //EX: CommonTestsPlugin.instance.getLog().addLogListener(JUnitLogListener.INSTANCE);
-
- //list of plugins whos logs if written to will cause JUnits to fail
-// ArrayList<String> pluginIDs = new ArrayList<String>();
-
- //TODO uncomment these to make tests start failing on logged errors
-// pluginIDs.add(JEMUtilPlugin.ID);
-// pluginIDs.add("org.eclipse.jst.common.annotations.controller");
-// pluginIDs.add("org.eclipse.jst.common.annotations.core");
-// pluginIDs.add("org.eclipse.jst.common.annotations.ui");
-// pluginIDs.add(CommonFrameworksPlugin.PLUGIN_ID);
-// pluginIDs.add(EJBUIPlugin.PLUGIN_ID);
-// pluginIDs.add(J2EEPlugin.PLUGIN_ID);
-// pluginIDs.add(J2EECorePlugin.PLUGIN_ID);
-// pluginIDs.add(EjbPlugin.PLUGIN_ID);
-// pluginIDs.add(ModelPlugin.PLUGINID);
-// pluginIDs.add("org.eclipse.jst.j2ee.ejb.annotations.emitter");
-// pluginIDs.add(XDocletAnnotationPlugin.PLUGINID);
-// pluginIDs.add(JcaPlugin.PLUGIN_ID);
-// pluginIDs.add(JCAUIPlugin.PLUGIN_ID);
-// pluginIDs.add(J2EENavigatorPlugin.PLUGIN_ID);
-// pluginIDs.add(J2EEUIPlugin.PLUGIN_ID);
-// pluginIDs.add(WebPlugin.PLUGIN_ID);
-// pluginIDs.add(WebServicePlugin.PLUGIN_ID);
-// pluginIDs.add(WebServiceUIPlugin.PLUGIN_ID);
-// pluginIDs.add(JEEPlugin.PLUGIN_ID);
-// pluginIDs.add(Activator.PLUGIN_ID);
-// pluginIDs.add(J2EEUIPlugin.PLUGIN_ID);
-// pluginIDs.add(org.eclipse.jst.jee.web.Activator.PLUGIN_ID);
-// pluginIDs.add(ServletUIPlugin.PLUGIN_ID);
-// pluginIDs.add(PropertiesValidatorPlugin.PLUGIN_ID);
-// pluginIDs.add(BVTValidationPlugin.PLUGIN_ID);
-// pluginIDs.add(EcoreUtilitiesPlugin.ID);
-// pluginIDs.add(EMFWorkbenchEditPlugin.ID);
-// pluginIDs.add(WTPCommonPlugin.PLUGIN_ID);
-// pluginIDs.add(WTPUIPlugin.PLUGIN_ID);
-// pluginIDs.add(ModulecorePlugin.PLUGIN_ID);
-// pluginIDs.add(ValidationPlugin.PLUGIN_ID);
-// pluginIDs.add(ValidationUIPlugin.PLUGIN_ID);
-// pluginIDs.add(WSTWebPlugin.PLUGIN_ID);
-// pluginIDs.add(WSTWebUIPlugin.PLUGIN_ID);
-// pluginIDs.add("org.eclipse.wst.xml.core");
-// pluginIDs.add("org.eclipse.jem");
-// pluginIDs.add(BeaninfoPlugin.PI_BEANINFO_PLUGINID);
-// pluginIDs.add("org.eclipse.jem.proxy");
-// pluginIDs.add("org.eclipse.jem.ui");
-// pluginIDs.add("org.eclipse.jem.workbench");
-// pluginIDs.add("org.eclipse.jem.tests");
-// pluginIDs.add("org.eclipse.jst.standard.schemas");
-// pluginIDs.add(CommonTestsPlugin.PLUGIN_ID);
-// pluginIDs.add("org.eclipse.wst.common.tests.collector");
-// pluginIDs.add("org.eclipse.wst.common.tests.ui");
-// pluginIDs.add("org.eclipse.jst.j2ee.core.tests");
-// pluginIDs.add("org.eclipse.jst.j2ee.core.tests.performance");
-// pluginIDs.add("org.eclipse.jst.j2ee.tests");
-// pluginIDs.add("org.eclipse.jst.j2ee.tests.performance");
-// pluginIDs.add("org.eclipse.jst.servlet.tests");
-
-// for(String pluginID : pluginIDs) {
-// InternalPlatform.getDefault().getLog(InternalPlatform.getDefault().getBundle(pluginID)).addLogListener(JUnitLogListener.INSTANCE);
-// }
- }
-
- /**
- * Set weather to fail junit tests on status logged to plugins registered with the <code>JUnitLogListener</code>
- * Default value is set to true.
- *
- * @param failOnLoggedStatus
- * if <code>true</code> then fail tests when statuses logged to plugins registered with <code>JUnitLogListener</code>,
- * if <code>false</code> then dont fail on logged statuses.
- */
- protected static void failOnLoggedStatus(boolean failOnLoggedStatus) {
- fFailOnLoggedStatus = failOnLoggedStatus;
- }
-
- @Override
- public void run(TestResult result) {
- try{
- AssertWarn.clearWarnings();
- super.run(result);
-
- } finally {
- List <StackTraceElement> stackTrace = new ArrayList<StackTraceElement>();
-
- //check to see if this test already failed with an error
- //if so add error to stack trace
- Enumeration errorsEnum = result.errors();
- TestFailure errorOrFailure = null;
- boolean hadError = false;
- for(int i = 0; errorsEnum.hasMoreElements() && !hadError; i++) {
- Object o = errorsEnum.nextElement();
- errorOrFailure = (TestFailure)o;
- if(errorOrFailure.failedTest() == this) {
- hadError = true;
-
- Throwable thrown = errorOrFailure.thrownException();
- List<StackTraceElement> errorTrace = Arrays.asList(thrown.getStackTrace());
- stackTrace.addAll(errorTrace);
- }
- }
-
- //check to see if this test already failed with a failure if it didn't
- // fail with an error. if so add failure to stack trace
- boolean hadFailure = false;
- if(!hadError) {
- Enumeration failuresEnum = result.failures();
- for(int i = 0; failuresEnum.hasMoreElements() && !hadFailure; i++) {
- Object o = failuresEnum.nextElement();
- errorOrFailure = (TestFailure)o;
- if(errorOrFailure.failedTest() == this) {
- hadFailure = true;
-
- Throwable thrown = errorOrFailure.thrownException();
- List<StackTraceElement> failureTrace = Arrays.asList(thrown.getStackTrace());
- stackTrace.addAll(failureTrace);
- }
- }
- }
-
- //add any warnings to the stack trace and deal with if this test already failed
- List <AssertionFailedError> warnings = AssertWarn.getWarnings();
- boolean hadWarnings = warnings.size() != 0;
- if(hadWarnings) {
- int warningNum = 1;
- List<StackTraceElement> warningTrace = null;
- for(AssertionFailedError e : warnings){
- stackTrace.add(new StackTraceElement("---------->","", "WARNING MESSAGE: " + e.getMessage() + ") (WARNING NUMBER", warningNum++));
-
- warningTrace = Arrays.asList(e.getStackTrace());
- stackTrace.addAll(warningTrace);
- }
- }
-
- //add any logged statuses to the stack trace, as long as fFailOnLoggedStatus == true
- HashMap<IStatus,String> loggedStatuses = JUnitLogListener.INSTANCE.getLoggedStatuses();
- boolean hadLoggedStatuses = loggedStatuses.size() != 0;
- if(hadLoggedStatuses && fFailOnLoggedStatus) {
- int loggedMessageNum = 1;
- List<StackTraceElement> loggedMessageTrace = null;
-
- Set<IStatus> loggedStatusesKeys = loggedStatuses.keySet();
- String statusType;
- for(IStatus status : loggedStatusesKeys) {
- stackTrace.add(new StackTraceElement("---------->","", "LOGGED " + statusTypeToString(status.getSeverity()) + " STATUS: " + loggedStatuses.get(status) + ": " + status.getMessage() + ") (LOGGED STATUS NUMBER", loggedMessageNum++));
-
- if(status.getException() != null) {
- loggedMessageTrace = Arrays.asList(status.getException().getStackTrace());
- stackTrace.addAll(loggedMessageTrace);
- }
- }
- }
-
- //deal with making a new formated failure and added it to the result
- String message = "";
- String warningsMessage = "Test had " + warnings.size() + " warnings occur";
- String loggedStatusesMessage = "Test logged " + loggedStatuses.size() + " statuses";
- if(hadError || hadFailure) {
- message = errorOrFailure.exceptionMessage();
-
- if(hadWarnings) {
- message += " (" + warningsMessage + ")";
- }
-
- if(hadLoggedStatuses && fFailOnLoggedStatus) {
- message += " (" + loggedStatusesMessage + ")";
- }
- } else if(hadWarnings) {
- message = warningsMessage;
-
- if(hadLoggedStatuses && fFailOnLoggedStatus) {
- message += " (" + loggedStatusesMessage + ")";
- }
- } else if(hadLoggedStatuses && fFailOnLoggedStatus) {
- message = loggedStatusesMessage;
- }
-
- if(hadError || hadFailure || hadWarnings || (hadLoggedStatuses && fFailOnLoggedStatus)) {
- AssertionFailedError error = new AssertionFailedError(message);
- StackTraceElement[] stackTraceArray = stackTrace.toArray(new StackTraceElement[stackTrace.size()]);
- error.setStackTrace(stackTraceArray);
-
- if(hadError) {
- result.addError(this, error);
- } else {
- result.addFailure(this, error);
- }
- }
-
-
- }
- }
-
- private String statusTypeToString(int statusType) {
- String sStatusType = "";
- switch (statusType) {
- case IStatus.ERROR :
- sStatusType = "ERROR";
- break;
- case IStatus.CANCEL :
- sStatusType = "CANCEL";
- break;
- case IStatus.WARNING :
- sStatusType = "WARNING";
- break;
- }
-
- return sStatusType;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java
deleted file mode 100644
index c41276b..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Created on Nov 3, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests;
-
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class CommonTestsPlugin extends Plugin {
- public static String PLUGIN_ID = "org.eclipse.wst.common.tests";
- public static CommonTestsPlugin instance = null;
- public IExtensionPoint dataModelVerifierExt = null;
-
- /**
- * @param descriptor
- */
- public CommonTestsPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
- dataModelVerifierExt = descriptor.getExtensionPoint("DataModelVerifier");
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java
deleted file mode 100644
index 1d03d53..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Created on Jan 5, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.tests;
-
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class DataModelVerifier {
-
- public void verify(IDataModel model) throws Exception {
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java
deleted file mode 100644
index a9b6501..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Created on Jan 5, 2004
- *
- * To change the template for this generated file go to Window - Preferences - Java - Code
- * Generation - Code and Comments
- */
-package org.eclipse.wst.common.tests;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jem.util.RegistryReader;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * @author Administrator
- * @author Ian Tewksbury (ictewksb@us.ibm.com)
- *
- * To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Generation - Code and Comments
- */
-public class DataModelVerifierFactory extends RegistryReader{
- static final String DATA_MODEL_VERIFIER_LIST_EXT = "dataModelVerifierList";
- static final String LIST_CLASS = "listClass";
- private Map dataModelVerifiersMap = null;
- private static DataModelVerifierFactory instance = null;
- private DataModelVerifier defaultDataModelVerifier = new DataModelVerifier();
-
- public DataModelVerifierFactory() {
- super(CommonTestsPlugin.PLUGIN_ID, "DataModelVerifier");//$NON-NLS-1$
- }
-
- public static DataModelVerifierFactory getInstance() {
- if (instance == null){
- instance = new DataModelVerifierFactory();
- instance.readRegistry();
- }
- return instance;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jem.util.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
- */
- public boolean readElement(IConfigurationElement element) {
- if (!element.getName().equals(DATA_MODEL_VERIFIER_LIST_EXT))
- return false;
- try {
- DataModelVerifierList list = (DataModelVerifierList)element.createExecutableExtension(LIST_CLASS);
- addToDataModelVerifiersMap(list.getDataModelVerifiers());
- }
- catch(CoreException e){
- e.printStackTrace();
- }
- return true;
-
- }
-
- public void addToDataModelVerifiersMap(Map dataModelVerifiers){
- if (dataModelVerifiersMap == null)
- dataModelVerifiersMap = initDataModelVerifiersMap();
- dataModelVerifiersMap.putAll(dataModelVerifiers);
- }
-
- /**
- * @return Returns the dataModelVerifiersMap.
- */
- public Map getDataModelVerifiersMap() {
- if (dataModelVerifiersMap == null) {
- dataModelVerifiersMap = initDataModelVerifiersMap();
- }
- return dataModelVerifiersMap;
- }
-
- protected Map initDataModelVerifiersMap() {
- return new HashMap();
- }
-
- /**
- * @return Returns the defaultDataModelVerifier.
- */
- protected DataModelVerifier getDefaultDataModelVerifier() {
- return defaultDataModelVerifier;
- }
-
- /*private void loadConfiguration() {
- //TestCollectorPlugin plugin = TestCollectorPlugin.instance;
- CommonTestsPlugin plugin = CommonTestsPlugin.instance;
- IExtension[] dataModelVerifierExts = plugin.dataModelVerifierExt.getExtensions();
-
- for (int i = 0; i < dataModelVerifierExts.length; i++) {
- IExtension extension = dataModelVerifierExts[i];
- IConfigurationElement[] factories = extension.getConfigurationElements();
- for (int j = 0; j < factories.length; j++) {
- try {
- IConfigurationElement element = factories[j];
- DataModelVerifierList list = (DataModelVerifierList)element.createExecutableExtension("listClass");
- //ClassLoader classLoader = (ClassLoader) extension.getDeclaringPluginDescriptor().getPluginClassLoader();
- //DataModelVerifierList list = (DataModelVerifierList) classLoader.loadClass(factoryClass).newInstance();
- addToDataModelVerifiersMap(list.getDataModelVerifiers());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }*/
-
- public DataModelVerifier createVerifier(IDataModel model) {
- DataModelVerifier verifier = getDefaultDataModelVerifier();
-
- if (model != null) {
- Object verifierObject = getDataModelVerifiersMap().get(model.getID());
- if(verifierObject != null){
- try {
- if(verifierObject instanceof Class){
- return (DataModelVerifier)((Class)verifierObject).newInstance();
- } else if(verifierObject instanceof String){
- Class verifierClass = Class.forName((String)verifierObject);
- verifier = (DataModelVerifier) verifierClass.newInstance();
- }
- } catch (Exception e) {
- verifier = getDefaultDataModelVerifier();
- }
- }
- }
- return verifier;
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java
deleted file mode 100644
index dc822e0..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Created on Dec 6, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.tests;
-
-import java.util.Map;
-
-/**
- * @author eteration
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public abstract class DataModelVerifierList {
-
- public abstract Map getDataModelVerifiers();
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/JUnitLogListener.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/JUnitLogListener.java
deleted file mode 100644
index 7b3f9f2..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/JUnitLogListener.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- *
- */
-package org.eclipse.wst.common.tests;
-
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * @author itewk
- *
- */
-public class JUnitLogListener implements ILogListener {
-
- public static final JUnitLogListener INSTANCE = new JUnitLogListener();
- private HashMap<IStatus, String> loggedStatuses = new HashMap<IStatus, String>();
-
- private JUnitLogListener() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ILogListener#logging(org.eclipse.core.runtime.IStatus, java.lang.String)
- */
- public void logging(IStatus status, String plugin) {
- int severity = status.getSeverity();
- if(severity == IStatus.CANCEL || severity == IStatus.ERROR || severity == IStatus.WARNING) {
- loggedStatuses.put(status, plugin);
- }
- }
-
- /**
- *
- * @return the current list of logged statuses, clears list after return.
- */
- public HashMap<IStatus,String> getLoggedStatuses() {
- HashMap<IStatus,String> returnStatuses = new HashMap<IStatus,String>(loggedStatuses);
- loggedStatuses.clear();
- return returnStatuses;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java
deleted file mode 100644
index f3d028e..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Created on Jun 30, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class LogUtility implements ILogListener {
-
- private static LogUtility instance = new LogUtility();
- private ArrayList loggedMessages = new ArrayList();
- private boolean logging = false;
-
- private LogUtility() {
- registerPlugins();
- }
-
- private void registerPlugins() {
-// TODO DCB Disable for now due to other plugins failing.
-// IPluginRegistry registry = Platform.getPluginRegistry();
-// IPluginDescriptor[] descriptors = registry.getPluginDescriptors();
-// for (int i = 0; i < descriptors.length; i++) {
-// try {
-// Plugin plugin = descriptors[i].getPlugin();
-// ILog log = plugin.getLog();
-// log.addLogListener(this);
-// } catch (Exception e) {
-// }
-// }
- }
-
- public static LogUtility getInstance() {
- return instance;
- }
-
- public void clearLogs() {
- loggedMessages.clear();
- }
-
- public void resetLogging() {
- stopLogging();
- clearLogs();
- startLogging();
- }
-
- public void startLogging() {
- logging = true;
- }
-
- public void stopLogging() {
- logging = false;
- }
-
- public void verifyNoWarnings() {
- //TODO DCB Disable for now due to other plugins failing.
-// String warnings = "";
-// for (int i = 0; i < loggedMessages.size(); i++) {
-// IStatus status = (IStatus) loggedMessages.get(i);
-// if (status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.ERROR) {
-// warnings += "\nLogUtility: " + ((status.getSeverity() == IStatus.WARNING) ? "WARNING " : "ERROR ");
-// warnings += "\nFrom plugin: " + ((null != status.getPlugin()) ? status.getPlugin() : "null");
-// warnings += "\nMessage: " + ((null != status.getMessage()) ? status.getMessage() : "null");
-// warnings += "\nStack:\n";
-// try {
-// ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-// status.getException().printStackTrace(new PrintStream(outputStream));
-// warnings += outputStream.toString();
-// } catch (Exception e) {
-// warnings += " Stack not available";
-// }
-//
-// }
-// }
-// if (!warnings.equals("")) {
-// Assert.fail(warnings);
-// }
- }
-
- public void logging(IStatus status, String plugin) {
- if (logging) {
- loggedMessages.add(status);
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java
deleted file mode 100644
index c688ba3..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Created on Nov 6, 2003
- *
- * To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and
- * Comments
- */
-package org.eclipse.wst.common.tests;
-
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IWorkspaceRunnableWithStatus;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-import org.eclipse.wst.validation.internal.operations.ValidationBuilder;
-
-
-/**
- * @author jsholl
- * @author itewk
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public abstract class OperationTestCase extends BaseTestCase {
-
- public static final String VALIDATOR_JOB_FAMILY = "validators";
- public static String fileSep = System.getProperty("file.separator"); //$NON-NLS-1$
- public static IStatus OK_STATUS = new Status(IStatus.OK, "org.eclipse.jem.util", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
-
- protected void setUp() throws Exception {
- super.setUp();
- try{
- deleteAllProjects();
- } finally {
- RendererFactory.getDefaultRendererFactory().setValidating(false);
- }
- }
-
- public static void deleteAllProjects() {
- try {
- waitOnJobs();
- } catch (InterruptedException e1) {
-
- }
- IWorkspaceRunnableWithStatus workspaceRunnable = new IWorkspaceRunnableWithStatus(null) {
- public void run(IProgressMonitor pm) throws CoreException {
- try {
- ProjectUtility.deleteAllProjects();
- } catch (Exception e) {
- }
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(workspaceRunnable, null);
- } catch (CoreException e) {
-
- }
- }
-
- public OperationTestCase() {
- super("OperationsTestCase"); //$NON-NLS-1$
- }
-
- public OperationTestCase(String name) {
- super(name);
- }
-
- public static void runAndVerify(IDataModel dataModel) throws Exception {
- OperationTestCase.runAndVerify(dataModel, true, true);
- }
- public static void runDataModel(IDataModel dataModel) throws Exception {
- OperationTestCase.runDataModel(dataModel, true, true);
- }
-
- public static void runDataModel(IDataModel dataModel, boolean checkTasks, boolean checkLog) throws Exception {
- OperationTestCase.runDataModel(dataModel, checkTasks, checkLog, null, true, false);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, null, true, false);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog, boolean waitForBuildToComplete) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, null, true, waitForBuildToComplete);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, errorOKList, reportIfExpectedErrorNotFound, false);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, errorOKList, reportIfExpectedErrorNotFound, waitForBuildToComplete, false);
- }
-
- public static void runDataModel(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete) throws Exception {
- runDataModel(dataModel, checkTasks, checkLog, errorOKList, reportIfExpectedErrorNotFound, waitForBuildToComplete, false);
- }
-
- /**
- * Guaranteed to close the dataModel
- *
- * @param dataModel
- * @throws Exception
- */
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete, boolean removeAllSameTypesOfErrors) throws Exception {
- PostBuildListener listener = null;
- IWorkspaceDescription desc = null;
- try {
- if (waitForBuildToComplete) {
- listener = new PostBuildListener();
- desc = ResourcesPlugin.getWorkspace().getDescription();
- desc.setAutoBuilding(false);
- ResourcesPlugin.getWorkspace().setDescription(desc);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_BUILD);
- }
-
- //deal with weather to fail on logged statuses or not
- BaseTestCase.failOnLoggedStatus(checkLog);
-
- IStatus operationStatus = dataModel.getDefaultOperation().execute(new NullProgressMonitor(), null);
-
- if (waitForBuildToComplete) {
- desc.setAutoBuilding(true);
- ResourcesPlugin.getWorkspace().setDescription(desc);
- while (!listener.isBuildComplete()) {
- Thread.sleep(3000);// do nothing till all the jobs are completed
- }
- }
-
- // bug 173933 - runAndVerify() fails to check return IStatus
- if (operationStatus.getSeverity() == IStatus.ERROR) {
- Throwable throwable = operationStatus.getException();
- String throwableStr = null;
- if(throwable != null){
- throwable.printStackTrace();
- throwableStr = getStackTrace(throwable);
- }
- if(throwableStr == null){
- throwableStr = "no message";
- }
- Assert.fail(operationStatus.getMessage()+"\n caused by: "+throwableStr);
- }
-
- //run data model verifications
- DataModelVerifierFactory verifierFactory = DataModelVerifierFactory.getInstance();
- DataModelVerifier verifier = verifierFactory.createVerifier(dataModel);
- verifier.verify(dataModel);
-
- if (checkTasks && (errorOKList == null || errorOKList.isEmpty())) {
- checkTasksList();
- } else if (checkTasks && errorOKList != null && !errorOKList.isEmpty()) {
- TaskViewUtility.verifyErrors(errorOKList, reportIfExpectedErrorNotFound, removeAllSameTypesOfErrors);
- }
-
- } finally {
- if (listener != null)
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(listener);
- dataModel.dispose();
- }
- }
-
- public static String getStackTrace(Throwable throwable){
- StringBuffer buffer = new StringBuffer(throwable.toString()+"\n");
- StackTraceElement[] stack = throwable.getStackTrace();
- for (int i=0; i<stack.length; i++)
- buffer.append("\tat " + stack[i]+"\n");
-
- StackTraceElement[] parentStack = stack;
- throwable = throwable.getCause();
- while (throwable != null) {
- buffer.append("Caused by: ");
- buffer.append(throwable);
- buffer.append("\n");
- StackTraceElement[] currentStack = throwable.getStackTrace();
- parentStack = currentStack;
- throwable = throwable.getCause();
- }
- return buffer.toString();
- }
- /**
- * Guaranteed to close the dataModel
- *
- * @param dataModel
- * @throws Exception
- */
- public static void runDataModel(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete, boolean removeAllSameTypesOfErrors) throws Exception {
- PostBuildListener listener = null;
- IWorkspaceDescription desc = null;
- try {
- if (waitForBuildToComplete) {
- listener = new PostBuildListener();
- desc = ResourcesPlugin.getWorkspace().getDescription();
- desc.setAutoBuilding(false);
- ResourcesPlugin.getWorkspace().setDescription(desc);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_BUILD);
- }
-
- //deal with weather to fail on logged statuses or not
- BaseTestCase.failOnLoggedStatus(checkLog);
-
- dataModel.getDefaultOperation().execute(new NullProgressMonitor(), null);
-
- if (waitForBuildToComplete) {
- desc.setAutoBuilding(true);
- ResourcesPlugin.getWorkspace().setDescription(desc);
- while (!listener.isBuildComplete()) {
- Thread.sleep(3000);// do nothing till all the jobs are completeled
- }
- }
- if (checkTasks && (errorOKList == null || errorOKList.isEmpty())) {
- checkTasksList();
- } else if (checkTasks && errorOKList != null && !errorOKList.isEmpty()) {
- TaskViewUtility.verifyErrors(errorOKList, reportIfExpectedErrorNotFound, removeAllSameTypesOfErrors);
- }
-
- } finally {
- if (listener != null)
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(listener);
- dataModel.dispose();
- }
- }
-
-
- protected static void checkTasksList() {
- //TaskViewUtility.verifyNoErrors();
- }
-
- public static void verifyValidDataModel(IDataModel dataModel) {
- IStatus status = dataModel.validate();
-
- if (!status.isOK() && status.getSeverity() == IStatus.ERROR) {
- Assert.assertTrue("DataModel is invalid operation will not run:" + status.toString(), false); //$NON-NLS-1$
- }
- }
-
- public static void verifyInvalidDataModel(IDataModel dataModel) {
- IStatus status = dataModel.validate();
- if (status.isOK()) {
- Assert.assertTrue("DataModel should be invalid:" + status.getMessage(), false); //$NON-NLS-1$
- }
- }
- protected void tearDown() throws Exception {
- super.tearDown();
- // Wait for all validation jobs to end before ending test....
- waitOnJobs();
-
- }
-
- public static void waitOnJobs() throws InterruptedException {
- IProject[] projects = ProjectUtility.getAllProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- Job.getJobManager().join(project.getName() + VALIDATOR_JOB_FAMILY,null);
- }
- Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD,null);
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD,null);
- Job.getJobManager().join(ValidationBuilder.FAMILY_VALIDATION_JOB,null);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PlatformModuleURLTest.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PlatformModuleURLTest.java
deleted file mode 100644
index bfbbdb3..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PlatformModuleURLTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Created on Jan 21, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.tests;
-
-import java.net.URL;
-import java.net.URLConnection;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
-
-public class PlatformModuleURLTest extends TestCase {
-
- public PlatformModuleURLTest(String name) {
- super(name);
- }
-
-
- public static Test suite() {
- return new TestSuite(PlatformModuleURLTest.class);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- PlatformURLModuleConnection.startup();
- }
-
- /**
- *
- */
- public void testURLResolve() throws Exception {
- URL url = new URL("platform:/module:/MyModule/META-INF/ejb-jar.xml");
- URLConnection conx = url.openConnection();
- System.out.println(conx.getURL());
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java
deleted file mode 100644
index 3db4657..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Created on Oct 20, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.tests;
-
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-
-/**
- * @author nirav
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class PostBuildListener implements IResourceChangeListener {
- private boolean buildComplete = false;
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- if (event.getType() == IResourceChangeEvent.POST_BUILD){
- buildComplete = true;
- }
- }
-
- public boolean isBuildComplete() {
- return buildComplete;
- }
-
- public void testComplete() {
- buildComplete = false;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java
deleted file mode 100644
index 88febea..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java
+++ /dev/null
@@ -1,214 +0,0 @@
-package org.eclipse.wst.common.tests;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jem.util.logger.proxy.Logger;
-/**
- * @author jsholl
- *
- * 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 ProjectUtility {
- public static IProject[] getAllProjects() {
- IProject[] projects = new IProject[0];
- try {
- projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- } catch (AssertionFailedException ex) {
- // Catch Malformed tree exception that occurs from time to time...
- }
- return projects;
- }
- public static boolean projectExists(String projectName) {
- return getProject(projectName) != null;
- }
- public static IProject verifyAndReturnProject(String projectName, boolean exists) {
- IProject project = getProject(projectName);
- if (exists) {
- Assert.assertTrue("Project Does Not Exist:" + projectName, project.exists());
- } else {
- Assert.assertTrue("Project Exists:" + projectName, !project.exists());
- }
- return project;
- }
- public static void verifyProject(String projectName, boolean exists) {
- IProject project = getProject(projectName);
- if (exists) {
- Assert.assertTrue("Project Does Not Exist:" + projectName, project.exists());
- } else {
- Assert.assertTrue("Project Exists:" + projectName, !project.exists());
- }
- }
- public static IProject getProject(String projectName) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- String pathString = projectName;
- if (!(workspace.getRoot().getProject(pathString) == null))
- return workspace.getRoot().getProject(pathString);
- else
- return null;
- }
- public static void verifyNoProjects() {
- IProject[] projects = getAllProjects();
- String projectNames = "";
- for (int i = 0; i < projects.length; i++) {
- projectNames += " " + projects[i].getName();
- }
- Assert.assertTrue("All projects not deleted" + projectNames, projects.length == 0);
- }
- public static void deleteProjectIfExists(String projectName) {
- if (projectName == null)
- return;
- IProject project = getProject(projectName);
- if (project != null && project.isAccessible()) {
- try {
- project.close(null);
- project.delete(true, true, null);
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception e) {
- Assert.fail(e.getMessage());
- }
- }
- }
- public static void deleteAllProjects() throws Exception {
- //closing projects and tread work in here is a hack because of a BeanInfo bug holding
- //onto jars loaded in another VM
-
-// for (int i = 0; i < projects.length; i++) {
-// if (projects[i].exists()) {
-// projects[i].close(null); // This should signal the extra VM to kill itself
-// }
-// }
- // Thread.yield(); // give the VM a chance to die
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
-
- public void run(IProgressMonitor monitor) {
- IProject[] projects = getAllProjects();
- for (int i = 0; i < projects.length; i++) {
- IProject project = projects[i];
- boolean success = false;
- Exception lastException = null;
- // Don't make 2^12 is about 4 seconds which is the max we
- // will wait for the VM to die
- for (int j = 0; j < 13 && !success; j++) {
- try {
- if (project.exists()) {
- project.delete(true, true, null);
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
- }
- success = true;
- } catch (Exception e) {
- lastException = e;
- if (project.exists()) {
- try {
- project.close(null);
- project.open(null);
- } catch (Exception e2) {
- }
- }
- try {
- Thread.sleep((int) Math.pow(2, j));
- } catch (InterruptedException e1) {
- } // if the VM
- // isn't dead,
- // try sleeping
- }
- }
- if (!success && lastException != null) {
- Logger.getLogger().log("Problem while deleting: " + lastException.getMessage());
- // Assert.fail("Caught Exception=" +
- // lastException.getMessage() + " when deleting
- // project=" + project.getName());
- }
- }
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null);
- } catch (CoreException ce) {
- }
- //verifyNoProjects();
- }
- /**
- * Return the absolute path Strings to the files based on the fileSuffix and
- * path within the plugin.
- *
- * @param path
- * @param fileSuffix
- * the file ending with the "." if required (the suffix will be
- * used as is)
- * @return
- */
- public static List getSpecificFilesInDirectory(Plugin plugin, String path, final String fileSuffix) {
- URL entry = null;
- entry = plugin.getBundle().getEntry(path);
- List result = null;
- File folder = null;
- if (entry != null) {
- try {
- entry = Platform.asLocalURL(entry);
- folder = new File(new URI(entry.toString()));
- } catch (Exception e1) {
- e1.printStackTrace();
- return Collections.EMPTY_LIST;
- }
- List files = Arrays.asList(folder.list());
- if (!files.isEmpty()) {
- String folderPath = folder.getAbsolutePath() + File.separator;
- result = new ArrayList();
- for (int i = 0; i < files.size(); i++) {
- String fileName = (String) files.get(i);
- if (!fileName.endsWith(fileSuffix))
- continue;
- result.add(folderPath + fileName);
- }
- }
- }
- if (result == null)
- result = Collections.EMPTY_LIST;
- return result;
- }
- public static List getJarsInDirectory(Plugin plugin, String path) {
- return getSpecificFilesInDirectory(plugin, path, ".jar");
- }
- public static List getRarsInDirectory(Plugin plugin, String path) {
- return getSpecificFilesInDirectory(plugin, path, ".rar");
- }
- public static List getEarsInDirectory(Plugin plugin, String path) {
- return getSpecificFilesInDirectory(plugin, path, ".ear");
- }
- public static List getWarsInDirectory(Plugin plugin, String path) {
- return getSpecificFilesInDirectory(plugin, path, ".war");
- }
- public static String getFullFileName(Plugin plugin, String pluginRelativeFileName) throws IOException {
- IPath path = new Path(pluginRelativeFileName);
- if (path.getDevice() != null)
- return pluginRelativeFileName;
- URL url = plugin.getBundle().getEntry(pluginRelativeFileName);
- if (url != null) {
- url = Platform.asLocalURL(url);
- IPath iPath = new Path(url.getPath());
- return iPath.toOSString();
- }
- return null;
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java
deleted file mode 100644
index 5fe16e6..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Created on Feb 2, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.tests;
-
-import junit.framework.TestSuite;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class SimpleTestSuite extends TestSuite {
-
- public SimpleTestSuite(Class theClass) {
- super(theClass, getShortName(theClass));
- }
-
- public static String getShortName(Class c){
- String name = c.getName();
- if(name.lastIndexOf('.') > 0){
- name = name.substring(name.lastIndexOf('.')+1);
- }
- return name;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java
deleted file mode 100644
index 821355c..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.eclipse.wst.common.tests;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * @author jsholl
- *
- * 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 TaskViewUtility {
-
- public static IResource getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- public static void verifyNoNewTasks(HashSet hashSet) {
- verifyNoNewTasks(null, hashSet);
- }
-
- public static void verifyNoNewTasks(IResource resource, HashSet hashSet) {
- verifyNoNewTasksImpl(resource, hashSet, true);
- }
-
- private static void verifyNoNewTasksImpl(IResource resource, HashSet hashSet, boolean failOnFailure) {
- IResource markerSource = resource == null ? getWorkspaceRoot() : resource;
- IMarker[] markers = null;
- try {
- markers = markerSource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
- } catch (CoreException e1) {
- e1.printStackTrace();
- Assert.fail();
- }
- for (int j = 0; markers != null && j < markers.length; j++) {
- String message = markers[j].toString();
- try {
- message = (String) markers[j].getAttribute(IMarker.MESSAGE);
- } catch (Exception e) {
- }
-
- if (null == hashSet) {
- String failMsg = "Task in Tasks List: " + message;
- if (failOnFailure) {
- Assert.fail(failMsg);
- } else {
- System.out.println(failMsg);
- }
- } else if (!hashSet.contains(markers[j])) {
- String failMsg = "New Task in Tasks List: " + message;
- if (failOnFailure) {
- Assert.fail(failMsg);
- } else {
- System.out.println(failMsg);
- }
-
- }
- }
- }
-
- public static void verifyNoErrors() {
- verifyNoErrors(null);
- }
-
- public static void verifyNoErrors(IResource resource) {
- List markers = getErrors(resource);
- if (null != markers && markers.size() > 0) {
- int size = markers.size();
- String message = "" + size + " errors in tasks view:";
- IMarker marker;
- for (int i = 0; i < size; i++) {
- marker = (IMarker) markers.get(i);
- try {
- message += "\n" + i + " " + (String) marker.getAttribute(IMarker.MESSAGE);
- } catch (Exception e) {
- }
- }
- Assert.fail(message);
- }
- }
-
- /**
- * @param resource
- * @return
- */
- public static List getErrors(IResource resource) {
- IResource markerSource = resource == null ? getWorkspaceRoot() : resource;
- List markers = null;
- try {
- markers = findSeverityMarkers(markerSource, IMarker.SEVERITY_ERROR);
- } catch (CoreException e1) {
- e1.printStackTrace();
- }
- return markers;
- }
-
- private static List findSeverityMarkers(IResource markerSource, int severityLevel) throws CoreException {
- IMarker[] markers = markerSource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
- List results = null;
- Integer severity;
- for (int i = 0; i < markers.length; i++) {
- severity = (Integer) markers[i].getAttribute(IMarker.SEVERITY);
- if (severity.intValue() == severityLevel) {
- if (results == null)
- results = new ArrayList();
- results.add(markers[i]);
- }
- }
- if (results == null)
- results = Collections.EMPTY_LIST;
- return results;
- }
-
- public static void verifyNoWarnings() {
-
- }
-
- public static void verifyNoTasks() {
- verifyNoTasks(null);
- }
-
- public static void verifyNoTasks(IResource resource) {
- verifyNoNewTasksImpl(resource, null, true);
- }
-
- public static void verifyNoTasks(boolean failOnFailure) {
- verifyNoTasks(null, failOnFailure);
- }
-
- public static void verifyNoTasks(IResource resource, boolean failOnFailure) {
- verifyNoNewTasksImpl(resource, null, failOnFailure);
- }
- public static void verifyErrors(List markerDescriptionsExpected) {
- verifyErrors(markerDescriptionsExpected,true,false);
- }
-
-
- public static void verifyErrors(List markerDescriptionsExpected, boolean reportIfExpectedErrorNotFound, boolean removeAllSameTypesOfError) {
- List markerDescriptionsFound = null;
- try {
- List markersFound = findSeverityMarkers(getWorkspaceRoot(), IMarker.SEVERITY_ERROR);
- markerDescriptionsFound = new ArrayList(markersFound.size());
- for (int i = 0; i < markersFound.size(); i++) {
- markerDescriptionsFound.add(((IMarker) markersFound.get(i)).getAttribute("message"));
- }
- } catch (CoreException e1) {
- e1.printStackTrace();
- Assert.fail();
- }
-
- ArrayList markerDescriptionsNotFound = new ArrayList();
- List markersDescriptionsToRemove = new ArrayList();
- for (int i = 0; i < markerDescriptionsExpected.size(); i++) {
- String messageToFind = (String)markerDescriptionsExpected.get(i);
- boolean found = false;
- for(int j=0;j<markerDescriptionsFound.size() &&(!found || removeAllSameTypesOfError);j++){
- if(messageToFind.equals(markerDescriptionsFound.get(j))){
- found = true;
- markersDescriptionsToRemove.add(markerDescriptionsFound.get(j));
- }
- }
- if (!found) {
- markerDescriptionsNotFound.add(messageToFind);
- }
- }
- markerDescriptionsFound.removeAll(markersDescriptionsToRemove);
- if (markerDescriptionsNotFound.size() > 0 || markerDescriptionsFound.size() > 0) {
- String messages = "";
- if (reportIfExpectedErrorNotFound){
- for (int i = 0; i < markerDescriptionsNotFound.size(); i++) {
- messages += "\nError not found:\"" + markerDescriptionsNotFound.get(i)+"\"";
- }
- }
- for (int i = 0; i < markerDescriptionsFound.size(); i++) {
- messages += "\nUnexpected error found:\"" + markerDescriptionsFound.get(i)+"\"";
- }
- if (!messages.equals(""))
- Assert.fail(messages);
- }
-
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java
deleted file mode 100644
index 9edc779..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Created on Jun 5, 2003
- *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests;
-
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class WindowUtility {
-
-// public static void closeAllOpenWindows() {
-// IWorkbench workbench = WorkbenchPlugin.getDefault().getWorkbench();
-// IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
-//
-// for (int i = 0; i < windows.length; i++) {
-// final IWorkbenchWindow window = windows[i];
-// final Shell shell = window.getShell();
-// shell.getDisplay().syncExec(new Runnable() {
-// public void run() {
-// Shell[] otherShells = shell.getDisplay().getShells();
-// //this can be imporoved, but basically this is to work out shell dependencies.
-// for (int j = 0; j < otherShells.length; j++) {
-// //step through shells backwards in case one shell opens another -- this is how they are usually odered
-// for (int i = otherShells.length - 1; i > 0; i--) {
-// int index = (i+j) % otherShells.length; // mix things up a little to work out shell dependencies
-// if (otherShells[index] != shell && otherShells[index].isVisible() && !otherShells[index].isDisposed()) {
-// otherShells[index].close();
-// }
-// }
-// }
-// }
-// });
-// }
-// }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseSchemeTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseSchemeTests.java
deleted file mode 100644
index cf2ff0b..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseSchemeTests.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.environment.tests;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.uri.IURI;
-import org.eclipse.wst.common.environment.uri.IURIScheme;
-import org.eclipse.wst.common.environment.uri.URIException;
-
-public class EclipseSchemeTests extends TestCase
-{
- private final String projectName_ = "TestProject";
-
- public EclipseSchemeTests(String name)
- {
- super(name);
- }
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(EclipseSchemeTests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new EclipseSchemeTests(methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- /**
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- if( project != null && project.exists() )
- {
- project.delete( true, null );
- }
-
- // Create the project
- IProjectDescription desc = workspaceRoot.getWorkspace().newProjectDescription( projectName_ );
- project.create( desc, null );
- project.open( null );
- }
- /**
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- project.delete( true, null );
- }
-
- public static Test getTest()
- {
- return new EclipseSchemeTests("EclipseSchemeTests");
- }
-
- public void testBadURIs()
- {
- IURIScheme scheme = EnvironmentService.getEclipseScheme();
-
- try
- {
- IURI newURI = scheme.newURI( "bogus:/somefolder/somefile.txt");
- assertTrue( "Non platform protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( ":/somefolder/somefile.txt");
- assertTrue( "Non platform protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
-
- try
- {
- IURI newURI = scheme.newURI( (String)null );
- assertTrue( "Non platform protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( (URL)null );
- assertTrue( "Non platform protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( (IURI)null );
- assertTrue( "Non platform protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
- }
-
- public void testNewURI()
- {
- IURIScheme scheme = EnvironmentService.getEclipseScheme() ;
-
- try
- {
- IURI uri1 = scheme.newURI( "platform:/resource/" + projectName_ + "/myfile" );
- IURI uri2 = scheme.newURI( "relativedirectory/relativefile" );
- IURI uri3 = scheme.newURI( uri1 );
- IURI uri4 = scheme.newURI( uri2 );
- IURI uri5 = scheme.newURI( new URL( uri1.asString() ) );
-
- File file1 = uri1.asFile();
-
- uri1.touchLeaf();
-
- assertTrue( "Is a file", file1.isFile() );
- assertTrue( "File names not the same", uri1.asString().equals( uri3.toString() ));
- assertTrue( "File names not the same", uri2.asString().equals( uri4.toString() ));
- assertTrue( "File names not the same", uri1.asString().equals( uri5.toString() ));
- assertTrue( "Protocol not platform", uri1.getURIScheme().toString().equals("platform"));
- assertTrue( "Protocol not platform", uri3.getURIScheme().toString().equals("platform"));
- assertTrue( "Protocol not platform", uri5.getURIScheme().toString().equals("platform"));
- assertTrue( "Protocol not relative", uri2.getURIScheme().toString().equals("relative"));
- assertTrue( "Protocol not relative", uri4.getURIScheme().toString().equals("relative"));
-
- uri1.erase();
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testHierarchical()
- {
- IURIScheme scheme = EnvironmentService.getEclipseScheme() ;
-
- assertTrue( "Not hierarchical", scheme.isHierarchical() == true );
- }
-
- public void testValidURIs()
- {
- try
- {
- IURIScheme scheme = EnvironmentService.getEclipseScheme();
- IURI uri1 = scheme.newURI( "platform:/resource/somedir/somefile" );
- IURI uri2 = scheme.newURI( "platform:/resource/somedir" );
- IURI uri3 = scheme.newURI( "somerel" );
- IURI uri4 = scheme.newURI( "somerel/somemorerel" );
- IURI uri5 = scheme.newURI( "./somerel/somemore" );
-
- assertTrue( "URI not valid", scheme.isValid( uri1 ) );
- assertTrue( "URI not valid", scheme.isValid( uri2 ) );
- assertTrue( "URI not valid", scheme.isValid( uri3 ) );
- assertTrue( "URI not valid", scheme.isValid( uri4 ) );
- assertTrue( "URI not valid", scheme.isValid( uri5 ) );
- assertTrue( "URI has not valid status", scheme.validate( uri1 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri2 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri3 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri4 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri5 ).getSeverity() == IStatus.OK );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testInvalidURIs()
- {
- try
- {
- IURIScheme eclipseScheme = EnvironmentService.getEclipseScheme();
- IURIScheme fileScheme = EnvironmentService.getFileScheme();
-
- IURI uri1 = fileScheme.newURI( "file:/c:/temp/somedir/somefile" );
-
- assertTrue( "URI valid", !eclipseScheme.isValid( uri1 ) );
- assertTrue( "URI has a valid status", eclipseScheme.validate( uri1 ).getSeverity() == IStatus.ERROR );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseURITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseURITests.java
deleted file mode 100644
index b96bd5f..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EclipseURITests.java
+++ /dev/null
@@ -1,928 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060217 128456 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.common.environment.tests;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.uri.IURI;
-import org.eclipse.wst.common.environment.uri.IURIFactory;
-import org.eclipse.wst.common.environment.uri.IURIFilter;
-import org.eclipse.wst.common.environment.uri.IURIScheme;
-import org.eclipse.wst.common.environment.uri.IURIVisitor;
-import org.eclipse.wst.common.environment.uri.URIException;
-
-public class EclipseURITests extends TestCase
-{
- private final String projectName_ = "TestProject";
- private File tempFile;
- private File tempDir;
-
- public EclipseURITests(String name)
- {
- super(name);
- }
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(EclipseURITests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new EclipseURITests(methodName);
- System.out.println("Calling EclipseURITests."+methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- /**
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- tempFile = File.createTempFile("tmp", "tmp", null );
- tempDir = new File( tempFile.getParentFile(), "tmpDir" );
- tempDir.mkdir();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- if( project != null && project.exists() )
- {
- project.delete( true, null );
- }
-
- // Create the project
- IProjectDescription desc = workspaceRoot.getWorkspace().newProjectDescription( projectName_ );
- project.create( desc, null );
- project.open( null );
- }
- /**
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- project.delete( true, null );
- tempFile.delete();
- deleteDir( tempDir );
- }
-
- public static Test getTest()
- {
- return new EclipseURITests("EclipseURITests");
- }
- public void testAvailable()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testAvailable()");
-
- try
- {
- IURI uri1 = factory.newURI( "platform:/resource/" + projectName_ + "/myfile" );
- IURI uri2 = factory.newURI( getTmpFileURL( "somefile" ) );
- IURI uri3 = factory.newURI( "relativedirectory/relativefile" );
-
- assertTrue( "Not available as URL", uri1.isAvailableAsURL() );
- assertTrue( "Not available as URL", uri2.isAvailableAsURL() );
- assertTrue( "Available as URL", !uri3.isAvailableAsURL() );
-
- assertTrue( "Not available as File", uri1.isAvailableAsFile() );
- assertTrue( "Not available as File", uri2.isAvailableAsFile() );
- assertTrue( "Available as File", !uri3.isAvailableAsFile() );
-
- File file1 = uri1.asFile();
- File file2 = uri2.asFile();
- URL url1 = uri1.asURL();
- URL url2 = uri2.asURL();
-
- uri1.touchLeaf();
- uri2.touchLeaf();
-
- assertTrue( "Is a file", file1.isFile() );
- assertTrue( "Is a file", file2.isFile() );
- assertTrue( "Wrong protocol", url1.getProtocol().equals( "platform" ));
- assertTrue( "Wrong protocol", url2.getProtocol().equals( "file" ));
- assertTrue( uri1.asString().length() > 5 );
- assertTrue( uri2.asString().length() > 5 );
- assertTrue( uri1.toString().length() > 5 );
- assertTrue( uri2.toString().length() > 5 );
- uri1.erase();
- uri2.erase();
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testFactory()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testFactory()");
- try
- {
- factory.newURIScheme( null );
- assertTrue( "Null URI scheme should cause an exception", false );
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- factory.newURIScheme( "bogusProtocol:/somefolder/somefile.txt" );
- assertTrue( "An undefined protocol should cause an exception", false );
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- factory.newURIScheme( "/somefolder/somefile.txt" );
- assertTrue( "Absolute path with no protocol should cause an exception", false );
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURIScheme scheme1 = factory.newURIScheme( "platform:/resource/myproj/myfile" );
- IURIScheme scheme2 = factory.newURIScheme( getTmpFileURL( "somefile2" ) );
- IURIScheme scheme3 = factory.newURIScheme( "platform" );
- IURIScheme scheme4 = factory.newURIScheme( "file" );
- IURIScheme scheme5 = factory.newURI( "rel1/rel2" ).getURIScheme();
-
- IURI uri1 = factory.newURI( "platform:/resource/myproj/myfile" );
- IURI uri2 = factory.newURI( getTmpFileURL( "somefile3" ) );
- IURI uri3 = factory.newURI( "relativedirectory/relativefile" );
-
- IURI uri4 = factory.newURI( new URL( "platform:/resource/myproj/myfile" ));
- IURI uri5 = factory.newURI( new URL( getTmpFileURL( "somefile4" ) ) );
-
-
- assertTrue( "Scheme not platform protocol", scheme1.toString().equals("platform") );
- assertTrue( "Scheme not file protocol", scheme2.toString().equals("file") );
- assertTrue( "Scheme not platform", scheme3.toString().equals("platform") );
- assertTrue( "Scheme not file", scheme4.toString().equals("file") );
- assertTrue( "Scheme not relative", scheme5.toString().equals("relative") );
-
- assertTrue( "Scheme not platform protocol", uri1.getURIScheme().toString().equals("platform") );
- assertTrue( "Scheme not file protocol", uri2.getURIScheme().toString().equals("file") );
- assertTrue( "Scheme not relative", uri3.getURIScheme().toString().equals("relative") );
-
- assertTrue( "Scheme not platform protocol", uri4.getURIScheme().toString().equals("platform") );
- assertTrue( "Scheme not file protocol", uri5.getURIScheme().toString().equals("file") );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testTouchFolder()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testTouchFolder()");
- try
- {
- IPath folderPath = new Path( projectName_ ).append( "topFolder" ).makeAbsolute();
- IPath folderPath2 = folderPath.append( "space folder" );
- IURI uri = factory.newURI( getURLFromPath( folderPath ).toString() );
- IURI uri2 = factory.newURI( getURLFromPath( folderPath2 ).toString() );
-
- assertTrue( "topFolder should not exist", !uri.isPresent() );
-
- uri.touchFolder();
-
- assertTrue( "topFolder should exist", uri.isPresent() );
-
- IPath nestedPath = folderPath.append( "level1" ).append( "level2" );
- IURI nesteduri = factory.newURI( getURLFromPath( nestedPath ).toString() );
-
- assertTrue( "nestedFolder should not exist", !nesteduri.isPresent() );
-
- nesteduri.touchFolder();
-
- assertTrue( "nestedFolder should exist", nesteduri.isPresent() );
-
- IURI child1 = uri2.append( factory.newURI( "child1" ) );
- IURI child2 = uri2.append( factory.newURI( "child2" ) );
-
- child1.touchLeaf();
- child2.touchLeaf();
-
- assertTrue ( "Child 1 in blank folder should exist ", child1.isPresent() );
- assertTrue ( "Child 2 in blank folder should exist ", child2.isPresent() );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testList()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testList()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder2" ).makeAbsolute();
- IPath folderPath1 = new Path( projectName_ ).append( "topFolder2" ).append( "leaf1" ).makeAbsolute();
- IPath folderPath2 = new Path( projectName_ ).append( "topFolder2" ).append( "leaf2" ).makeAbsolute();
- IPath folderPath3 = new Path( projectName_ ).append( "topFolder2" ).append( "leaf3" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uri1 = factory.newURI( getURLFromPath( folderPath1 ).toString() );
- IURI uri2 = factory.newURI( getURLFromPath( folderPath2 ).toString() );
- IURI uri3 = factory.newURI( getURLFromPath( folderPath3 ).toString() );
-
- uri1.touchFolder();
- uri2.touchFolder();
- uri3.touchFolder();
-
- IURI[] babies = uri0.list();
-
- assertTrue( "folder path should have 3 children", babies.length == 3 );
-
- for( int index = 0; index < babies.length; index++ )
- {
- String folderName = babies[index].toString();
- String leafName = folderName.substring( folderName.length() - 5, folderName.length() );
- boolean Ok = leafName.equals( "leaf1") || leafName.equals( "leaf2" ) || leafName.equals( "leaf3" );
- assertTrue( "Wrong leaf baby uri:" + folderName + "," + leafName, Ok );
- }
-
- IURI[] babies2 = uri0.list( new IURIFilter()
- {
- public boolean accepts( IURI uri )
- {
- return !uri.toString().endsWith( "leaf2");
- }
- } );
-
- assertTrue( "folder path should have 2 filtered children", babies2.length == 2 );
-
- for( int index = 0; index < babies2.length; index++ )
- {
- String folderName = babies2[index].toString();
- String leafName = folderName.substring( folderName.length() - 5, folderName.length() );
- boolean Ok = leafName.equals( "leaf1") || leafName.equals( "leaf3" );
-
- assertTrue( "Wrong leaf baby uri:" + folderName + "," + leafName, Ok );
- }
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testGetURIScheme()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "testGetScheme" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURIScheme scheme = uri0.getURIScheme();
-
- assertTrue( "Scheme name is not platform", scheme.toString().equals( "platform" ) );
- }
- catch( URIException exc )
- {
- assertTrue( "Unexpected exception", false );
- }
- }
-
- public void testAppend()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testAppend()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder3" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "level2");
-
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchFolder();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "newURI should not be a leaf", !newURI.isLeaf() );
-
- // Ensure that append parameter is relative.
- try
- {
- IURI newURI2 = uri0.append( uri0 );
- assertTrue( "Appending using a non-relative should throw and exception", true );
-
- // This code should never run.
- newURI2.asFile();
- }
- catch( URIException exc )
- {
- }
-
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testTouchLeaf()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testTouchLeaf()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder4" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "newURI should be a leaf", newURI.isLeaf() );
-
- InputStream stream = newURI.getInputStream();
- int byteRead = 0;
-
- try
- {
- byteRead = stream.read(); // Returns a -1 if no bytes are read, which should be the case here.
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- finally
- {
- try
- {
- stream.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- assertTrue( "There should be no bytes in this stream", byteRead == -1 );
-
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testIOOperations()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
- OutputStreamWriter stream = null;
- PrintWriter writer = null;
- InputStreamReader inputStream = null;
- BufferedReader reader = null;
-
- System.out.println("EclipseURITests.testIOOperations()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder5" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
- assertTrue( "newURI should not be readable", !newURI.isReadable() );
- assertTrue( "newURI should be writable", !newURI.isWritable() );
-
- stream = new OutputStreamWriter( newURI.getOutputStream() );
- writer = new PrintWriter( stream );
-
- writer.println( "This is line 1 of the file." );
- writer.println( "This is line 2 of the file." );
- writer.println( "This is the end of the file." );
-
- writer.close();
- stream.close();
- writer = null;
- stream = null;
-
- assertTrue( "newURI should be readable", newURI.isReadable() );
- assertTrue( "newURI should be writable", newURI.isWritable() );
-
- // Now read back this new file.
- inputStream = new InputStreamReader( newURI.getInputStream() );
- reader = new BufferedReader( inputStream );
-
- assertTrue( "Bad first line of file", reader.readLine().equals("This is line 1 of the file.") );
- assertTrue( "Bad second line of file", reader.readLine().equals("This is line 2 of the file.") );
- assertTrue( "Bad last line of file", reader.readLine().equals("This is the end of the file.") );
- assertTrue( "Extra lines found in file", reader.readLine() == null );
-
- reader.close();
-
- //Now rename the folder.
- IURI level1 = uri0.append( uriRelative1 );
- IURI newLevel = uri0.append( factory.newURI("newLevel1") );
- IURI oldFile = newLevel.append( uriRelative2 );
- IURI newFile = newLevel.append( factory.newURI( "newFile" ) );
-
- assertTrue( "URI is not present", newURI.isPresent() );
- assertTrue( "URI is present", !newLevel.append(uriRelative2).isPresent() );
-
- level1.rename( newLevel );
-
- assertTrue( "URI is present", !newURI.isPresent() );
- assertTrue( "URI is not present", newLevel.append(uriRelative2).isPresent() );
-
- assertTrue( "URI is present", !newFile.isPresent() );
- assertTrue( "URI is not present", oldFile.isPresent() );
-
- oldFile.rename( newFile );
-
- assertTrue( "URI is not present", newFile.isPresent() );
- assertTrue( "URI is present", !oldFile.isPresent() );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- finally
- {
- if( stream != null )
- {
- try
- {
- writer.close();
- stream.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- if( inputStream != null )
- {
- try
- {
- inputStream.close();
- reader.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
- }
-
- }
-
- public void testRelative()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testRelative()");
-
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "relativeProj" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI level1URI = uri0.append( uriRelative1 );
-
- assertTrue( "Uri is relative", !uri0.isRelative() );
- assertTrue( "Uri is not relative", uriRelative1.isRelative() );
- assertTrue( "Uri is relative", !level1URI.isRelative() );
-
- assertTrue( "Uri is not hierarchical", uri0.isHierarchical() );
- assertTrue( "Uri is not hierarchical", uriRelative1.isHierarchical() );
- assertTrue( "Uri is not hierarchical", level1URI.isHierarchical() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testErase1()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testErase1()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder6" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
- IURI level1URI = uri0.append( uriRelative1 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
-
- newURI.erase();
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- assertTrue( "folder root should exist", uri0.isPresent() );
- assertTrue( "folder level1 should exist", level1URI.isPresent() );
-
- uri0.erase();
-
- assertTrue( "folder root should not exist", !uri0.isPresent() );
- assertTrue( "folder level1 should not exist", !level1URI.isPresent() );
-
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
-
- public void testIsLeaf()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("EclipseURITests.testIsLeaf()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "topFolder7" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
- IURI parent = newURI.parent();
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
- assertTrue( "parent should not exist", !parent.isPresent() );
- assertTrue( "newURI should not be a leaf yet", !newURI.isLeaf() );
- assertTrue( "parent should not be a leaf", !parent.isLeaf() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "parent should exist", parent.isPresent() );
- assertTrue( "newURI should be a leaf", newURI.isLeaf() );
- assertTrue( "parent should not be a leaf", !parent.isLeaf() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testVisit()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
- IURIScheme scheme = EnvironmentService.getEclipseScheme();
-
- System.out.println("EclipseURITests.testVisit()");
- try
- {
- IPath folderPath0 = new Path( projectName_ ).append( "root" ).makeAbsolute();
- IURI uri0 = factory.newURI( getURLFromPath( folderPath0 ).toString() );
-
- Hashtable table = buildTestEntries( scheme, uri0 );
-
- uri0.visit( new TestVisitor( table ) );
- verifyTable( table );
-
- resetTableForTest2( table );
- uri0.visit( new TestVisitor( table ) );
- verifyTable( table );
-
- resetTable( table );
- uri0.visit( new TestVisitor( table ), new TestFilter( table ) );
- verifyTable( table );
-
- resetTableForTest3( table );
- uri0.visit( new TestVisitor( table ), new TestFilter( table ) );
- verifyTable( table );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- private class TestVisitor implements IURIVisitor
- {
- private Hashtable table_;
-
- public TestVisitor( Hashtable table)
- {
- table_ = table;
- }
-
- public boolean visit( IURI uri )
- {
- NodeEntry entry = (NodeEntry)table_.get( getName( uri ) );
- entry.wasVisited_ = true;
- return !entry.stopTraversing_;
- }
- }
-
- private class TestFilter implements IURIFilter
- {
- private Hashtable table_;
-
- public TestFilter( Hashtable table)
- {
- table_ = table;
- }
-
- public boolean accepts( IURI uri )
- {
- NodeEntry entry = (NodeEntry)table_.get( getName( uri ) );
- return entry.visitNode_;
- }
- }
-
- private Hashtable buildTestEntries( IURIScheme scheme, IURI rootURI )
- {
- Hashtable table = new Hashtable();
-
- try
- {
- IURI rootc1 = rootURI.append( scheme.newURI( "rootc1") );
- IURI rootc2 = rootURI.append( scheme.newURI( "rootc2") );
- IURI rootc3 = rootURI.append( scheme.newURI( "rootc3") );
-
- IURI rootc2c1 = rootc2.append( scheme.newURI( "rootc2c1") );
- IURI rootc2c2 = rootc2.append( scheme.newURI( "rootc2c2") );
- IURI rootc2c3 = rootc2.append( scheme.newURI( "rootc2c3") );
-
- IURI rootc2c2c1 = rootc2c2.append( scheme.newURI( "rootc2c2c1") );
- IURI rootc2c2c2 = rootc2c2.append( scheme.newURI( "rootc2c2c2") );
-
- IURI rootc3c1 = rootc3.append( scheme.newURI( "rootc3c1") );
- IURI rootc3c2 = rootc3.append( scheme.newURI( "rootc3c2") );
-
- // Now that the URI's are created we need to create physical folders
- // and files to represent them.
- rootc3c1.touchLeaf();
- rootc3c2.touchLeaf();
-
- rootc2c2c1.touchLeaf();
- rootc2c2c2.touchLeaf();
-
- rootc2c1.touchLeaf();
- rootc2c3.touchLeaf();
-
- rootc1.touchFolder();
-
- // Now create the the table entries that will be used to visit
- // the URI nodes.
- table.put( "root", new NodeEntry() );
- table.put( "rootc1", new NodeEntry() );
- table.put( "rootc2", new NodeEntry() );
- table.put( "rootc3", new NodeEntry() );
- table.put( "rootc2c1", new NodeEntry() );
- table.put( "rootc2c2", new NodeEntry() );
- table.put( "rootc2c3", new NodeEntry() );
- table.put( "rootc2c2c1", new NodeEntry() );
- table.put( "rootc2c2c2", new NodeEntry() );
- table.put( "rootc3c1", new NodeEntry() );
- table.put( "rootc3c2", new NodeEntry() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
-
- return table;
- }
-
- private String getName( IURI uri )
- {
- String fullName = uri.toString();
- int slash = fullName.lastIndexOf( '/' );
- String name = fullName.substring( slash + 1, fullName.length() );
-
- return name;
- }
-
- private void verifyTable( Hashtable table )
- {
- Iterator entries = table.entrySet().iterator();
-
- while( entries.hasNext() )
- {
- Map.Entry entry = (Map.Entry)entries.next();
-
- String key = (String)entry.getKey();
- NodeEntry node = (NodeEntry)entry.getValue();
-
- assertTrue( "Bad table result for key:" + key + " visited=" + node.wasVisited_
- + " shouldbe=" + node.shouldBeVisited_,
- node.wasVisited_ == node.shouldBeVisited_ );
- }
- }
-
- private void resetTableForTest2( Hashtable table )
- {
- resetTable( table );
-
- NodeEntry rootc2 = (NodeEntry)table.get( "rootc2" );
- rootc2.stopTraversing_ = true;
-
- NodeEntry rootc2c1 = (NodeEntry)table.get( "rootc2c1" );
- rootc2c1.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2 = (NodeEntry)table.get( "rootc2c2" );
- rootc2c2.shouldBeVisited_ = false;
-
- NodeEntry rootc2c3 = (NodeEntry)table.get( "rootc2c3" );
- rootc2c3.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2c1 = (NodeEntry)table.get( "rootc2c2c1" );
- rootc2c2c1.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2c2 = (NodeEntry)table.get( "rootc2c2c2" );
- rootc2c2c2.shouldBeVisited_ = false;
- }
-
- private void resetTableForTest3( Hashtable table )
- {
- resetTable( table );
-
- NodeEntry rootc3 = (NodeEntry)table.get( "rootc3" );
- rootc3.visitNode_ = false;
- rootc3.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2 = (NodeEntry)table.get( "rootc2c2" );
- rootc2c2.visitNode_ = false;
- rootc2c2.shouldBeVisited_ = false;
-
- NodeEntry rootc3c1 = (NodeEntry)table.get( "rootc3c1" );
- rootc3c1.visitNode_ = false;
- rootc3c1.shouldBeVisited_ = false;
- }
-
- private void resetTable( Hashtable table )
- {
- Iterator entries = table.values().iterator();
-
- while( entries.hasNext() )
- {
- NodeEntry entry = (NodeEntry)entries.next();
- entry.wasVisited_ = false;
- entry.shouldBeVisited_=true;
- entry.stopTraversing_=false;
- entry.visitNode_=true;
- }
- }
-
- private String getURLFromPath( IPath absolutePath )
- {
- return "platform:/resource" + absolutePath;
- }
-
- private String getTmpFileURL( String fileName )
- {
- File newFile = new File( tempDir, fileName );
-
- return "file:/" + newFile.getAbsolutePath();
- }
-
- private void deleteDir( File fileOrDirectory )
- {
- File[] childFiles = fileOrDirectory.listFiles();
-
- if( childFiles != null )
- {
- // Delete all the child files or directories first before this one.
- for( int index = 0; index < childFiles.length; index++ )
- {
- deleteDir( childFiles[index] );
- }
- }
-
- fileOrDirectory.delete();
- }
-
- private class NodeEntry
- {
- public NodeEntry()
- {
- this( true, false, true );
- }
-
- public NodeEntry( boolean visitNode, boolean stop, boolean shouldBeVisited )
- {
- visitNode_ = visitNode;
- stopTraversing_ = stop;
- shouldBeVisited_ = shouldBeVisited;
- wasVisited_ = false;
- }
-
- public boolean visitNode_;
- public boolean stopTraversing_;
-
- public boolean wasVisited_;
- public boolean shouldBeVisited_;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EnvironmentTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EnvironmentTests.java
deleted file mode 100644
index abe8641..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/EnvironmentTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.environment.tests;
-
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class EnvironmentTests extends TestSuite
-{
-
- public static Test suite()
- {
- return new EnvironmentTests();
- }
-
- public EnvironmentTests()
- {
- super();
-
- addTest( EclipseSchemeTests.suite() );
- addTest( EclipseURITests.suite() );
- addTest( FileSchemeTests.suite() );
- addTest( FileURITests.suite() );
- addTest( StatusHandlerTests.suite() );
- addTest( LoggerTests.suite() );
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileSchemeTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileSchemeTests.java
deleted file mode 100644
index 44d7c14..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileSchemeTests.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.environment.tests;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.uri.IURI;
-import org.eclipse.wst.common.environment.uri.IURIScheme;
-import org.eclipse.wst.common.environment.uri.URIException;
-
-public class FileSchemeTests extends TestCase
-{
- private final String projectName_ = "TestProject";
-
- public FileSchemeTests(String name)
- {
- super(name);
- }
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(FileSchemeTests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new FileSchemeTests(methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- /**
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- if( project != null && project.exists() )
- {
- project.delete( true, null );
- }
-
- // Create the project
- IProjectDescription desc = workspaceRoot.getWorkspace().newProjectDescription( projectName_ );
- project.create( desc, null );
- project.open( null );
- }
- /**
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- // Create a test project in the workbench
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = workspaceRoot.getProject( projectName_ );
-
- project.delete( true, null );
- }
-
- public static Test getTest()
- {
- return new FileSchemeTests("FileSchemeTests");
- }
-
- public void testBadURIs()
- {
- IURIScheme scheme = EnvironmentService.getFileScheme();
-
- try
- {
- IURI newURI = scheme.newURI( "bogus:/somefolder/somefile.txt");
- assertTrue( "Non file protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( ":/somefolder/somefile.txt");
- assertTrue( "Non file protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
-
- try
- {
- IURI newURI = scheme.newURI( (String)null );
- assertTrue( "Non file protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( (URL)null );
- assertTrue( "Non file protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
-
- try
- {
- IURI newURI = scheme.newURI( (IURI)null );
- assertTrue( "Non file protocol should cause an exception", false );
-
- // This code should never run.
- newURI.asFile();
- }
- catch( URIException exc )
- {
- }
- }
-
- public void testNewURI()
- {
- IURIScheme scheme = EnvironmentService.getFileScheme() ;
-
- try
- {
- IURI uri1 = scheme.newURI( "file:/tmp/myfile" );
- IURI uri2 = scheme.newURI( "relativedirectory/relativefile" );
- IURI uri3 = scheme.newURI( uri1 );
- IURI uri4 = scheme.newURI( uri2 );
- IURI uri5 = scheme.newURI( new URL( uri1.asString() ) );
-
- File file1 = uri1.asFile();
-
- uri1.touchLeaf();
-
- assertTrue( "Is a file", file1.isFile() );
- assertTrue( "File names not the same", uri1.asString().equals( uri3.toString() ));
- assertTrue( "File names not the same", uri2.asString().equals( uri4.toString() ));
- assertTrue( "File names not the same", uri1.asString().equals( uri5.toString() ));
- assertTrue( "Protocol not file", uri1.getURIScheme().toString().equals("file"));
- assertTrue( "Protocol not file", uri3.getURIScheme().toString().equals("file"));
- assertTrue( "Protocol not file", uri5.getURIScheme().toString().equals("file"));
- assertTrue( "Protocol not relative", uri2.getURIScheme().toString().equals("relative"));
- assertTrue( "Protocol not relative", uri4.getURIScheme().toString().equals("relative"));
-
- uri1.erase();
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testHierarchical()
- {
- IURIScheme scheme = EnvironmentService.getFileScheme() ;
-
- assertTrue( "Not hierarchical", scheme.isHierarchical() == true );
- }
-
- public void testValidURIs()
- {
- try
- {
- IURIScheme scheme = EnvironmentService.getFileScheme();
- IURI uri1 = scheme.newURI( "file:/tmp/somedir/somefile" );
- IURI uri2 = scheme.newURI( "file:/tmp" );
- IURI uri3 = scheme.newURI( "somerel" );
- IURI uri4 = scheme.newURI( "somerel/somemorerel" );
- IURI uri5 = scheme.newURI( "./somerel/somemore" );
-
- assertTrue( "URI not valid", scheme.isValid( uri1 ) );
- assertTrue( "URI not valid", scheme.isValid( uri2 ) );
- assertTrue( "URI not valid", scheme.isValid( uri3 ) );
- assertTrue( "URI not valid", scheme.isValid( uri4 ) );
- assertTrue( "URI not valid", scheme.isValid( uri5 ) );
- assertTrue( "URI has not valid status", scheme.validate( uri1 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri2 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri3 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri4 ).getSeverity() == IStatus.OK );
- assertTrue( "URI has not valid status", scheme.validate( uri5 ).getSeverity() == IStatus.OK );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testInvalidURIs()
- {
- try
- {
- IURIScheme eclipseScheme = EnvironmentService.getEclipseScheme();
- IURIScheme fileScheme = EnvironmentService.getFileScheme();
-
- IURI uri1 = eclipseScheme.newURI( "platform:/resource/somedir/somefile" );
-
- assertTrue( "URI valid", !fileScheme.isValid( uri1 ) );
- assertTrue( "URI has a valid status", fileScheme.validate( uri1 ).getSeverity() == IStatus.ERROR );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java
deleted file mode 100644
index 5af05b1..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/FileURITests.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 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
- * yyyymmdd bug Email and other contact information
- * -------- -------- -----------------------------------------------------------
- * 20060217 128456 pmoogk@ca.ibm.com - Peter Moogk
- *******************************************************************************/
-package org.eclipse.wst.common.environment.tests;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.uri.IURI;
-import org.eclipse.wst.common.environment.uri.IURIFactory;
-import org.eclipse.wst.common.environment.uri.IURIFilter;
-import org.eclipse.wst.common.environment.uri.IURIScheme;
-import org.eclipse.wst.common.environment.uri.IURIVisitor;
-import org.eclipse.wst.common.environment.uri.URIException;
-
-public class FileURITests extends TestCase
-{
- private File tempFile;
- private File tempDir;
-
- public FileURITests(String name)
- {
- super(name);
- }
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(FileURITests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new FileURITests(methodName);
- System.out.println("Calling FileURITests."+methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- /**
- * @see TestCase#setUp()
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- tempFile = File.createTempFile("tmp", "tmp", null );
- tempDir = new File( tempFile.getParentFile(), "tmpDir" );
- tempDir.mkdir();
- }
-
- /**
- * @see TestCase#tearDown()
- */
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- deleteFiles( tempDir );
- tempFile.delete();
- }
-
- private void deleteFiles( File directory )
- {
- if (directory != null) {
- File[] children = directory.listFiles();
-
- /*
- * If 'directory' is not a directory, directory.listFiles can
- * return null.
- */
- if (children != null) {
- for (int index = 0; index < children.length; index++) {
- File child = children[index];
-
- if (child.isDirectory()) {
- deleteFiles(child);
- }
-
- child.delete();
- }
- }
- }
- }
-
- private String getTmpFileURL( String fileName )
- {
- File newFile = new File( tempDir, fileName );
-
- return "file:/" + newFile.getAbsolutePath();
- }
-
- public static Test getTest()
- {
- return new FileURITests("FileURITests");
- }
- public void testAvailable()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testAvailable()");
-
- try
- {
- IURI uri2 = factory.newURI( getTmpFileURL( "somefile" ) );
- IURI uri3 = factory.newURI( "relativedirectory/relativefile" );
-
- assertTrue( "Not available as URL", uri2.isAvailableAsURL() );
- assertTrue( "Available as URL", !uri3.isAvailableAsURL() );
-
- assertTrue( "Not available as File", uri2.isAvailableAsFile() );
- assertTrue( "Available as File", !uri3.isAvailableAsFile() );
-
- File file2 = uri2.asFile();
- URL url2 = uri2.asURL();
-
- uri2.touchLeaf();
-
- assertTrue( "Is a file", file2.isFile() );
- assertTrue( "Wrong protocol", url2.getProtocol().equals( "file" ));
- assertTrue( uri2.asString().length() > 5 );
- assertTrue( uri2.toString().length() > 5 );
- uri2.erase();
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testTouchFolder()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testTouchFolder()");
- try
- {
- File folderPath = new File( tempDir, "topFolder" );
- File folderPath2 = new File( folderPath, "space folder" );
- IURI uri = factory.newURI( folderPath.toURL().toString() );
- IURI uri2 = factory.newURI( folderPath2.toURL().toString() );
-
- assertTrue( "topFolder should not exist", !uri.isPresent() );
-
- uri.touchFolder();
-
- assertTrue( "topFolder should exist", uri.isPresent() );
-
- File nestedPath = new File( new File( folderPath, "level1" ), "level2" );
- IURI nesteduri = factory.newURI( nestedPath.toURL().toString() );
-
- assertTrue( "nestedFolder should not exist", !nesteduri.isPresent() );
-
- nesteduri.touchFolder();
-
- assertTrue( "nestedFolder should exist", nesteduri.isPresent() );
-
- IURI child1 = uri2.append( factory.newURI( "child1" ) );
- IURI child2 = uri2.append( factory.newURI( "child2" ) );
-
- child1.touchLeaf();
- child2.touchLeaf();
-
- assertTrue ( "Child 1 in blank folder should exist ", child1.isPresent() );
- assertTrue ( "Child 2 in blank folder should exist ", child2.isPresent() );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testList()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testList()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder2" );
- File folderPath1 = new File( new File( tempDir, "topFolder2" ), "leaf1" );
- File folderPath2 = new File( new File( tempDir, "topFolder2" ), "leaf2" );
- File folderPath3 = new File( new File( tempDir, "topFolder2" ), "leaf3" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uri1 = factory.newURI( folderPath1.toURL().toString() );
- IURI uri2 = factory.newURI( folderPath2.toURL().toString() );
- IURI uri3 = factory.newURI( folderPath3.toURL().toString() );
-
- uri1.touchFolder();
- uri2.touchFolder();
- uri3.touchFolder();
-
- IURI[] babies = uri0.list();
-
- assertTrue( "folder path should have 3 children", babies.length == 3 );
-
- for( int index = 0; index < babies.length; index++ )
- {
- String folderName = babies[index].toString();
- String leafName = folderName.substring( folderName.length() - 5, folderName.length() );
- boolean Ok = leafName.equals( "leaf1") || leafName.equals( "leaf2" ) || leafName.equals( "leaf3" );
- assertTrue( "Wrong leaf baby uri:" + folderName + "," + leafName, Ok );
- }
-
- IURI[] babies2 = uri0.list( new IURIFilter()
- {
- public boolean accepts( IURI uri )
- {
- return !uri.toString().endsWith( "leaf2");
- }
- } );
-
- assertTrue( "folder path should have 2 filtered children", babies2.length == 2 );
-
- for( int index = 0; index < babies2.length; index++ )
- {
- String folderName = babies2[index].toString();
- String leafName = folderName.substring( folderName.length() - 5, folderName.length() );
- boolean Ok = leafName.equals( "leaf1") || leafName.equals( "leaf3" );
-
- assertTrue( "Wrong leaf baby uri:" + folderName + "," + leafName, Ok );
- }
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testGetURIScheme()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- try
- {
- File folderPath0 = new File( tempDir, "testGetScheme" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURIScheme scheme = uri0.getURIScheme();
-
- assertTrue( "Scheme name is not file", scheme.toString().equals( "file" ) );
- }
- catch( URIException exc )
- {
- assertTrue( "Unexpected exception", false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testAppend()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testAppend()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder3" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "level2");
-
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchFolder();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "newURI should not be a leaf", !newURI.isLeaf() );
-
- // Ensure that append parameter is relative.
- try
- {
- IURI newURI2 = uri0.append( uri0 );
- assertTrue( "Appending using a non-relative should throw and exception", true );
-
- // This code should never run.
- newURI2.asFile();
- }
- catch( URIException exc )
- {
- }
-
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testTouchLeaf()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testTouchLeaf()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder4" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "newURI should be a leaf", newURI.isLeaf() );
-
- InputStream stream = newURI.getInputStream();
- int byteRead = 0;
-
- try
- {
- byteRead = stream.read(); // Returns a -1 if no bytes are read, which should be the case here.
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- finally
- {
- try
- {
- stream.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- assertTrue( "There should be no bytes in this stream", byteRead == -1 );
-
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testIOOperations()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
- OutputStreamWriter stream = null;
- PrintWriter writer = null;
- InputStreamReader inputStream = null;
- BufferedReader reader = null;
-
- System.out.println("FileURITests.testIOOperations()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder5" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
- assertTrue( "newURI should not be readable", !newURI.isReadable() );
- assertTrue( "newURI should be writable", !newURI.isWritable() );
-
- stream = new OutputStreamWriter( newURI.getOutputStream() );
- writer = new PrintWriter( stream );
-
- writer.println( "This is line 1 of the file." );
- writer.println( "This is line 2 of the file." );
- writer.println( "This is the end of the file." );
-
- writer.close();
- stream.close();
- writer = null;
- stream = null;
-
- assertTrue( "newURI should be readable", newURI.isReadable() );
- assertTrue( "newURI should be writable", newURI.isWritable() );
-
- // Now read back this new file.
- inputStream = new InputStreamReader( newURI.getInputStream() );
- reader = new BufferedReader( inputStream );
-
- assertTrue( "Bad first line of file", reader.readLine().equals("This is line 1 of the file.") );
- assertTrue( "Bad second line of file", reader.readLine().equals("This is line 2 of the file.") );
- assertTrue( "Bad last line of file", reader.readLine().equals("This is the end of the file.") );
- assertTrue( "Extra lines found in file", reader.readLine() == null );
-
- reader.close();
-
- //Now rename the folder.
- IURI level1 = uri0.append( uriRelative1 );
- IURI newLevel = uri0.append( factory.newURI("newLevel1") );
- IURI oldFile = newLevel.append( uriRelative2 );
- IURI newFile = newLevel.append( factory.newURI( "newFile" ) );
-
- assertTrue( "URI is not present", newURI.isPresent() );
- assertTrue( "URI is present", !newLevel.append(uriRelative2).isPresent() );
-
- level1.rename( newLevel );
-
- assertTrue( "URI is present", !newURI.isPresent() );
- assertTrue( "URI is not present", newLevel.append(uriRelative2).isPresent() );
-
- assertTrue( "URI is present", !newFile.isPresent() );
- assertTrue( "URI is not present", oldFile.isPresent() );
-
- oldFile.rename( newFile );
-
- assertTrue( "URI is not present", newFile.isPresent() );
- assertTrue( "URI is present", !oldFile.isPresent() );
- }
- catch( URIException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- finally
- {
- if( stream != null )
- {
- try
- {
- writer.close();
- stream.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- if( inputStream != null )
- {
- try
- {
- inputStream.close();
- reader.close();
- }
- catch( IOException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
- }
-
- }
-
- public void testRelative()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testRelative()");
-
- try
- {
- File folderPath0 = new File( tempDir, "relativeProj" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI level1URI = uri0.append( uriRelative1 );
-
- assertTrue( "Uri is relative", !uri0.isRelative() );
- assertTrue( "Uri is not relative", uriRelative1.isRelative() );
- assertTrue( "Uri is relative", !level1URI.isRelative() );
-
- assertTrue( "Uri is not hierarchical", uri0.isHierarchical() );
- assertTrue( "Uri is not hierarchical", uriRelative1.isHierarchical() );
- assertTrue( "Uri is not hierarchical", level1URI.isHierarchical() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testErase1()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testErase1()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder6" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
- IURI level1URI = uri0.append( uriRelative1 );
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
-
- newURI.erase();
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
-
- assertTrue( "folder root should exist", uri0.isPresent() );
- assertTrue( "folder level1 should exist", level1URI.isPresent() );
-
- uri0.erase();
-
- assertTrue( "folder root should not exist", !uri0.isPresent() );
- assertTrue( "folder level1 should not exist", !level1URI.isPresent() );
-
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
-
- public void testIsLeaf()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
-
- System.out.println("FileURITests.testIsLeaf()");
- try
- {
- File folderPath0 = new File( tempDir, "topFolder7" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
- IURI uriRelative1 = factory.newURI( "level1");
- IURI uriRelative2 = factory.newURI( "leafFile.txt");
- IURI newURI = uri0.append( uriRelative1 ).append( uriRelative2 );
- IURI parent = newURI.parent();
-
- assertTrue( "newURI should not exist", !newURI.isPresent() );
- assertTrue( "parent should not exist", !parent.isPresent() );
- assertTrue( "newURI should not be a leaf yet", !newURI.isLeaf() );
- assertTrue( "parent should not be a leaf", !parent.isLeaf() );
-
- newURI.touchLeaf();
-
- assertTrue( "newURI should exist", newURI.isPresent() );
- assertTrue( "parent should exist", parent.isPresent() );
- assertTrue( "newURI should be a leaf", newURI.isLeaf() );
- assertTrue( "parent should not be a leaf", !parent.isLeaf() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- public void testVisit()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IURIFactory factory = environment.getURIFactory();
- IURIScheme scheme = EnvironmentService.getFileScheme();
-
- System.out.println("FileURITests.testVisit()");
- try
- {
- File folderPath0 = new File( tempDir, "root" );
- IURI uri0 = factory.newURI( folderPath0.toURL().toString() );
-
- Hashtable table = buildTestEntries( scheme, uri0 );
-
- uri0.visit( new TestVisitor( table ) );
- verifyTable( table );
-
- resetTableForTest2( table );
- uri0.visit( new TestVisitor( table ) );
- verifyTable( table );
-
- resetTable( table );
- uri0.visit( new TestVisitor( table ), new TestFilter( table ) );
- verifyTable( table );
-
- resetTableForTest3( table );
- uri0.visit( new TestVisitor( table ), new TestFilter( table ) );
- verifyTable( table );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- catch( MalformedURLException exc )
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
- }
-
- private class TestVisitor implements IURIVisitor
- {
- private Hashtable table_;
-
- public TestVisitor( Hashtable table)
- {
- table_ = table;
- }
-
- public boolean visit( IURI uri )
- {
- NodeEntry entry = (NodeEntry)table_.get( getName( uri ) );
- entry.wasVisited_ = true;
- return !entry.stopTraversing_;
- }
- }
-
- private class TestFilter implements IURIFilter
- {
- private Hashtable table_;
-
- public TestFilter( Hashtable table)
- {
- table_ = table;
- }
-
- public boolean accepts( IURI uri )
- {
- NodeEntry entry = (NodeEntry)table_.get( getName( uri ) );
- return entry.visitNode_;
- }
- }
-
- private Hashtable buildTestEntries( IURIScheme scheme, IURI rootURI )
- {
- Hashtable table = new Hashtable();
-
- try
- {
- IURI rootc1 = rootURI.append( scheme.newURI( "rootc1") );
- IURI rootc2 = rootURI.append( scheme.newURI( "rootc2") );
- IURI rootc3 = rootURI.append( scheme.newURI( "rootc3") );
-
- IURI rootc2c1 = rootc2.append( scheme.newURI( "rootc2c1") );
- IURI rootc2c2 = rootc2.append( scheme.newURI( "rootc2c2") );
- IURI rootc2c3 = rootc2.append( scheme.newURI( "rootc2c3") );
-
- IURI rootc2c2c1 = rootc2c2.append( scheme.newURI( "rootc2c2c1") );
- IURI rootc2c2c2 = rootc2c2.append( scheme.newURI( "rootc2c2c2") );
-
- IURI rootc3c1 = rootc3.append( scheme.newURI( "rootc3c1") );
- IURI rootc3c2 = rootc3.append( scheme.newURI( "rootc3c2") );
-
- // Now that the URI's are created we need to create physical folders
- // and files to represent them.
- rootc3c1.touchLeaf();
- rootc3c2.touchLeaf();
-
- rootc2c2c1.touchLeaf();
- rootc2c2c2.touchLeaf();
-
- rootc2c1.touchLeaf();
- rootc2c3.touchLeaf();
-
- rootc1.touchFolder();
-
- // Now create the the table entries that will be used to visit
- // the URI nodes.
- table.put( "root", new NodeEntry() );
- table.put( "rootc1", new NodeEntry() );
- table.put( "rootc2", new NodeEntry() );
- table.put( "rootc3", new NodeEntry() );
- table.put( "rootc2c1", new NodeEntry() );
- table.put( "rootc2c2", new NodeEntry() );
- table.put( "rootc2c3", new NodeEntry() );
- table.put( "rootc2c2c1", new NodeEntry() );
- table.put( "rootc2c2c2", new NodeEntry() );
- table.put( "rootc3c1", new NodeEntry() );
- table.put( "rootc3c2", new NodeEntry() );
- }
- catch( URIException exc)
- {
- assertTrue( "Exception throw:" + exc.getMessage(), false );
- }
-
- return table;
- }
-
- private String getName( IURI uri )
- {
- String fullName = uri.toString();
- int slash = fullName.lastIndexOf( '/' );
-
- if( slash == -1 ) slash = fullName.lastIndexOf( '\\' );
-
- String name = fullName.substring( slash + 1, fullName.length() );
-
- return name;
- }
-
- private void verifyTable( Hashtable table )
- {
- Iterator entries = table.entrySet().iterator();
-
- while( entries.hasNext() )
- {
- Map.Entry entry = (Map.Entry)entries.next();
-
- String key = (String)entry.getKey();
- NodeEntry node = (NodeEntry)entry.getValue();
-
- assertTrue( "Bad table result for key:" + key + " visited=" + node.wasVisited_
- + " shouldbe=" + node.shouldBeVisited_,
- node.wasVisited_ == node.shouldBeVisited_ );
- }
- }
-
- private void resetTableForTest2( Hashtable table )
- {
- resetTable( table );
-
- NodeEntry rootc2 = (NodeEntry)table.get( "rootc2" );
- rootc2.stopTraversing_ = true;
-
- NodeEntry rootc2c1 = (NodeEntry)table.get( "rootc2c1" );
- rootc2c1.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2 = (NodeEntry)table.get( "rootc2c2" );
- rootc2c2.shouldBeVisited_ = false;
-
- NodeEntry rootc2c3 = (NodeEntry)table.get( "rootc2c3" );
- rootc2c3.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2c1 = (NodeEntry)table.get( "rootc2c2c1" );
- rootc2c2c1.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2c2 = (NodeEntry)table.get( "rootc2c2c2" );
- rootc2c2c2.shouldBeVisited_ = false;
- }
-
- private void resetTableForTest3( Hashtable table )
- {
- resetTable( table );
-
- NodeEntry rootc3 = (NodeEntry)table.get( "rootc3" );
- rootc3.visitNode_ = false;
- rootc3.shouldBeVisited_ = false;
-
- NodeEntry rootc2c2 = (NodeEntry)table.get( "rootc2c2" );
- rootc2c2.visitNode_ = false;
- rootc2c2.shouldBeVisited_ = false;
-
- NodeEntry rootc3c1 = (NodeEntry)table.get( "rootc3c1" );
- rootc3c1.visitNode_ = false;
- rootc3c1.shouldBeVisited_ = false;
- }
-
- private void resetTable( Hashtable table )
- {
- Iterator entries = table.values().iterator();
-
- while( entries.hasNext() )
- {
- NodeEntry entry = (NodeEntry)entries.next();
- entry.wasVisited_ = false;
- entry.shouldBeVisited_=true;
- entry.stopTraversing_=false;
- entry.visitNode_=true;
- }
- }
-
- private class NodeEntry
- {
- public NodeEntry()
- {
- this( true, false, true );
- }
-
- public NodeEntry( boolean visitNode, boolean stop, boolean shouldBeVisited )
- {
- visitNode_ = visitNode;
- stopTraversing_ = stop;
- shouldBeVisited_ = shouldBeVisited;
- wasVisited_ = false;
- }
-
- public boolean visitNode_;
- public boolean stopTraversing_;
-
- public boolean wasVisited_;
- public boolean shouldBeVisited_;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/LoggerTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/LoggerTests.java
deleted file mode 100644
index f95c777..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/LoggerTests.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.environment.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.ILog;
-import org.eclipse.wst.common.environment.StatusException;
-
-public class LoggerTests extends TestCase
-{
- public LoggerTests(String name)
- {
- super(name);
- }
-
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(LoggerTests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new LoggerTests(methodName);
- System.out.println("Calling LoggerTests."+methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- public void testLogger()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- ILog logger = environment.getLog();
-
- //assertTrue("Logging enabled", !logger.isEnabled());
- // We may or may not be called with the -debug option,
- // so we can not test for it, but we can write an appropriate
- // message, to help interpret results, if needed.
- if (logger.isEnabled()) {
- System.out.println(" Logging is enabled");
- } else {
- System.out.println(" Logging is is not enabled");
- }
- assertTrue( "Logging feature enabled", !logger.isEnabled( "bad option" ) );
-
- logger.log( ILog.ERROR, 0, this, "test logger", Status.CANCEL_STATUS );
- logger.log( ILog.INFO, 1, this, "another method", "object" );
- logger.log( ILog.WARNING, 3, this, "one more method", new StatusException( Status.OK_STATUS ));
- logger.log( ILog.ERROR, "option1", 0, this, "test logger", Status.CANCEL_STATUS );
- logger.log( ILog.INFO, "option2", 1, this, "another method", "object" );
- logger.log( ILog.WARNING, "option3", 3, this, "one more method", new StatusException( Status.OK_STATUS ));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/StatusHandlerTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/StatusHandlerTests.java
deleted file mode 100644
index d68b988..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/environment/tests/StatusHandlerTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.environment.tests;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.environment.Choice;
-import org.eclipse.wst.common.environment.EnvironmentService;
-import org.eclipse.wst.common.environment.IEnvironment;
-import org.eclipse.wst.common.environment.IStatusHandler;
-import org.eclipse.wst.common.environment.StatusException;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class StatusHandlerTests extends TestCase
-{
- private IStatus error;
- private IStatus info;
- private IStatus warning;
-
- public StatusHandlerTests(String name)
- {
- super(name);
-
- error = new Status( IStatus.ERROR, "id", 0, "error message", null );
- info = new Status( IStatus.INFO, "id", 0, "info message", null );
- warning = new Status( IStatus.WARNING, "id", 0, "warning message", null );
- }
-
- public static void main(String[] args)
- {
- if (args.length == 0)
- {
- runAll();
- }
- else if (args.length == 1)
- {
- String methodToRun = args[0].trim();
- runOne(methodToRun);
- }
- }
-
- public static Test suite()
- {
- return new TestSuite(StatusHandlerTests.class);
- }
-
- protected static void runAll()
- {
- junit.textui.TestRunner.run(suite());
- }
-
- public static void runOne(String methodName)
- {
- TestSuite testSuite = new TestSuite();
- TestCase test = new StatusHandlerTests(methodName);
- System.out.println("Calling StatusHandlerTests."+methodName);
- testSuite.addTest(test);
- junit.textui.TestRunner.run(testSuite);
- }
-
- public void testEnvironmentStatusHandler()
- {
- IEnvironment environment = EnvironmentService.getEclipseConsoleEnvironment();
- IStatusHandler handler = environment.getStatusHandler();
-
- try
- {
- Choice choice1 = new Choice();
- Choice choice2 = new Choice( 'o', "Ok", "description" );
-
- StatusException someException = new StatusException( error );
-
- assertTrue( "Status not the same ", someException.getStatus() == error );
-
- handler.report( Status.OK_STATUS );
- handler.report( error );
- handler.report( warning );
- handler.report( info );
- choice1.setShortcut( 'c' );
- choice1.setLabel( "cancel" );
- choice1.setDescription( "cancel description" );
-
- Choice result = handler.report( error, null );
-
- assertTrue( "result not null ", result == null );
-
- result = handler.report( error, new Choice[0] );
- assertTrue( "result not null ", result == null );
-
- result = handler.report( error, new Choice[]{ choice2, choice1 } );
- assertTrue( "First choice shortcut not the same", result.getShortcut() == choice2.getShortcut());
- assertTrue( "First choice label not the same", result.getLabel().equals( choice2.getLabel()));
- assertTrue( "First choice description not the same", result.getDescription().equals( choice2.getDescription()));
-
- handler.reportError( error );
- handler.reportInfo( info );
-
- }
- catch( StatusException exc )
- {
- assertTrue( "unexpected exception:", false );
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java
deleted file mode 100644
index 1d2d420..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Created on Mar 31, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.artifactedit.tests;
-
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class ArtifactEditAPITests extends TestSuite {
-
-
-
- public static Test suite() {
- return new ArtifactEditAPITests();
- }
-
- public ArtifactEditAPITests() {
- super();
- //addTest(new SimpleTestSuite(ArtifactEditTest.class));
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java
deleted file mode 100644
index b79ad90..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java
+++ /dev/null
@@ -1,507 +0,0 @@
-package org.eclipse.wst.common.frameworks.artifactedit.tests;
-
-
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.frameworks.internal.operations.IOperationHandler;
-import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelEvent;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelListener;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-
-
-public class ArtifactEditTest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private ArtifactEditModel artifactEditModelForRead;
- private ArtifactEditModel artifactEditModelForWrite;
- private ArtifactEdit artifactEditForRead;
- private ArtifactEdit artifactEditForWrite;
- private EditModelListener emListener;
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
-
- private IOperationHandler handler = new IOperationHandler() {
-
-
- public boolean canContinue(String message) {
- return false;
- }
-
-
- public boolean canContinue(String message, String[] items) {
-
- return false;
- }
-
- public int canContinueWithAllCheck(String message) {
-
- return 0;
- }
-
- public int canContinueWithAllCheckAllowCancel(String message) {
-
- return 0;
- }
-
- public void error(String message) {
-
-
- }
-
- public void inform(String message) {
-
-
- }
-
-
- public Object getContext() {
-
- return null;
- }
- };
-
- public ArtifactEditTest() {
- super();
-
- }
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
-
-
- private IPath getLocalPath() {
-
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
-
- try {
- url = new URL(url.toString() + zipFilePath);
-
- } catch (MalformedURLException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
- try {
- url = Platform.asLocalURL(url);
- printLocalPath(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
-
- private void printLocalPath(URL url) {
- IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- File file = new File(path.append("PlatformInfo.txt").toOSString());
- BufferedWriter bw;
- String osName = System.getProperty("os.name");
- String fileSeperator = System.getProperty("path.separator");
- URL urlFindUsingPlugin = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- urlFindUsingPlugin = Platform.asLocalURL(urlFindUsingPlugin);
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- String javaFileSeperator = new Character(File.pathSeparatorChar).toString();
-
-
- try {
- bw = new BufferedWriter(new FileWriter(file));
- bw.write("pluginDescriptor URL " + url.toString());
- bw.write("\n");
- bw.write("Operating System: " + osName);
- bw.write("\n");
- bw.write("System file seperator: " + fileSeperator);
- bw.write("\n");
- bw.write("Using Pluign.find URL:" + urlFindUsingPlugin.toString());
- bw.write("\n");
- bw.write("Java file seperator: " + javaFileSeperator);
- bw.write("\n");
- bw.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-
- }
-
-
-
- public void testGetArtifactEditForReadWorkbenchComponent() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForRead(project);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
- public void testGetArtifactEditForWriteWorkbenchComponent() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForWrite(project);
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
-
- public void testGetArtifactEditForReadComponentHandle() {
- StructureEdit moduleCore = null;
- ArtifactEdit edit = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- edit = ArtifactEdit.getArtifactEditForRead(project);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
-
- public void testGetArtifactEditForWriteComponentHandle() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForWrite(project);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
- public void testIsValidEditableModule() {
- assertTrue(ArtifactEdit.isValidEditableModule(ComponentCore.createComponent(project)));
- }
-
- public void testArtifactEditArtifactEditModel() {
- ArtifactEdit edit = new ArtifactEdit(getArtifactEditModelforRead());
- assertNotNull(edit);
- edit.dispose();
- }
-
-
- public void testArtifactEditModuleCoreNatureWorkbenchComponentboolean() {
- try {
- StructureEdit.getModuleCoreNature(moduleURI);
- } catch (UnresolveableURIException e) {
- fail();
- }
- ArtifactEdit edit = null;
- try {
- edit = new ArtifactEdit(project, true);
- assertNotNull(edit);
- } finally {
- if (edit != null)
- edit.dispose();
- }
- }
-
- public void testSave() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForWrite(project);
- try {
- edit.save(new NullProgressMonitor());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- assertTrue(true);
- }
-
- public void testSaveIfNecessary() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForWrite(project);
- try {
- edit.saveIfNecessary(new NullProgressMonitor());
- } catch (Exception e) {
- fail(e.getMessage());
- }
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- pass();
- }
-
- public void testSaveIfNecessaryWithPrompt() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForWrite(project);
- try {
- edit.saveIfNecessaryWithPrompt(new NullProgressMonitor(), handler, true);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- pass();
- }
- }
-
- public void testDispose() {
- ArtifactEdit edit;
- try {
- edit = new ArtifactEdit(getArtifactEditModelforRead());
- edit.dispose();
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testGetContentModelRoot() {
- ArtifactEdit edit = null;
- try {
- edit = ArtifactEdit.getArtifactEditForRead(project);
- Object object = edit.getContentModelRoot();
- // assertNotNull(object);
- } catch (Exception e) {
- // TODO fail(e.getMessage());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testAddListener() {
- ArtifactEdit edit = getArtifactEditForRead();
- try {
- edit.addListener(getEmListener());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- edit.dispose();
- }
-
- public void testRemoveListener() {
- ArtifactEdit edit = getArtifactEditForRead();
- try {
- edit.removeListener(getEmListener());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testHasEditModel() {
-
- ArtifactEdit edit = getArtifactEditForRead();
- assertTrue(edit.hasEditModel(artifactEditModelForRead));
- edit.dispose();
- }
-
- public void testGetArtifactEditModel() {
- ArtifactEdit edit = getArtifactEditForRead();
- assertTrue(edit.hasEditModel(artifactEditModelForRead));
- edit.dispose();
- }
-
- public void testObject() {
- pass();
- }
-
- public void testGetClass() {
- ArtifactEdit edit = getArtifactEditForRead();
- assertNotNull(edit.getClass());
- edit.dispose();
- }
-
- public void testHashCode() {
- ArtifactEdit edit = getArtifactEditForRead();
- int y = -999999999;
- int x = edit.hashCode();
- assertTrue(x != y);
- edit.dispose();
- }
-
- public void testEquals() {
- assertTrue(getArtifactEditForRead().equals(artifactEditForRead));
- }
-
- public void testClone() {
- pass();
- }
-
- public void testToString() {
- assertTrue(getArtifactEditForRead().toString() != null);
- }
-
- public void testNotify() {
- try {
- synchronized (getArtifactEditForRead()) {
- artifactEditForRead.notify();
- }
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
-
- }
-
- public void testNotifyAll() {
- try {
- synchronized (getArtifactEditForRead()) {
- artifactEditForRead.notifyAll();
- }
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testWaitlong() {
- long x = 2;
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait(x);
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- /*
- * Class under test for void wait(long, int)
- */
- public void testWaitlongint() {
- int x = 2;
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait(x);
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- public void testWait() {
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait();
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- public void testFinalize() {
- pass();
- }
-
-
- public ArtifactEditModel getArtifactEditModelforRead() {
- EMFWorkbenchContext context = new EMFWorkbenchContext(project);
- artifactEditModelForRead = new ArtifactEditModel(EDIT_MODEL_ID, context, true, moduleURI);
- return artifactEditModelForRead;
- }
-
-
-
- public ArtifactEdit getArtifactEditForRead() {
- artifactEditForRead = new ArtifactEdit(getArtifactEditModelforRead());
- return artifactEditForRead;
- }
-
- public void pass() {
- assertTrue(true);
- }
-
- public EditModelListener getEmListener() {
- if (emListener == null)
- emListener = new EditModelListener() {
- public void editModelChanged(EditModelEvent anEvent) {
- }
- };
- return emListener;
- }
-
- public ArtifactEditModel getArtifactEditModelForWrite() {
- EMFWorkbenchContext context = new EMFWorkbenchContext(project);
- return new ArtifactEditModel(EDIT_MODEL_ID, context, false, moduleURI);
-
- }
-
- public ArtifactEdit getArtifactEditForWrite() {
- return new ArtifactEdit(getArtifactEditModelForWrite());
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java
deleted file mode 100644
index 98603fd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class AllTests extends TestCase {
-
-
- public static TestSuite suite() {
-
- TestSuite suite = new TestSuite();
-
- suite.addTestSuite(IVirtualFolderAPITest.class);
- suite.addTestSuite(ModuleCoreAPIFVTTest.class);
- suite.addTestSuite(ModuleCoreURIConverterUnitTest.class);
- //suite.addTestSuite(StructureEditAPITest.class);
- suite.addTestSuite(StructureEditStressTest.class);
-
-
- return suite;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java
deleted file mode 100644
index 5d0cb6c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-
-public class BaseVirtualTest extends TestCase {
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final Path WEBINF_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/"+TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final Path TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- protected static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- protected IVirtualComponent component;
-
- protected IVirtualFolder webInfFolder;
- protected IContainer realWebInfFolder;
-
- protected IVirtualFolder deletemeVirtualFolder;
- protected IContainer deletemeFolder;
-
- protected IVirtualFolder testdataFolder;
- protected IContainer realTestdataFolder;
-
-
-
- public BaseVirtualTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- if (!TestWorkspace.getTargetProject().exists())
- if (!TestWorkspace.createProject())
- fail();
-
-
- realWebInfFolder = TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- component = ComponentCore.createComponent(TEST_PROJECT);
-
- IVirtualFolder rootFolder = component.getRootFolder();
-
- webInfFolder = rootFolder.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- testdataFolder = rootFolder.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- realTestdataFolder = TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- deletemeVirtualFolder = rootFolder.getFolder(DELETEME_PATH);
- deletemeVirtualFolder.create(IVirtualResource.FORCE, null);
-
- deletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
-
- }
-
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(deletemeFolder.exists())
- deletemeFolder.delete(IVirtualResource.FORCE, null);
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java
deleted file mode 100644
index daac19d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ComponentCoreTest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
- private int i, seed = 0;
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
- public void testCreateComponent() {
- try {
- new ComponentCore();
- ComponentCore.createComponent(project, "test");
-
- } catch (Exception e) {
- fail(e.toString());
- }
- }
- public void testCreateComponentUsingCreate() {
-
- Job[] createComponentJob = new Job[500];
- for ( i = 0; i < 500; i++) {
-
- createComponentJob[i] = new Job("CreateComponent Test") {
- protected IStatus run(IProgressMonitor monitor) {
- try {
- IVirtualComponent c
- = ComponentCore.createComponent( project, project.getName() + getNextSeed() );
- c.create( 0, null );
-
- } catch (Exception e) {
- fail(e.toString());
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- };
- }
- for (int n = 0; n < createComponentJob.length; n++) {
- createComponentJob[n].setRule(project);
- createComponentJob[n].schedule();
- }
-
- }
-
- protected int getNextSeed() {
- // TODO Auto-generated method stub
- return seed++;
- }
-
-
- public void testCreateFolder() {
- try {
- ComponentCore.createFolder(project, new Path("test/runtimePath"));
- } catch (Exception e) {
- fail(e.toString());
- }
- }
-
- public void testCreateFile() {
- try {
- ComponentCore.createFile(project, new Path("test/runtimePath/file"));
- } catch (Exception e) {
- fail(e.toString());
- }
- }
-
- public void testCreateReference() {
- IVirtualComponent container = new VirtualComponent(project, new Path("test/runtimePath/file"));
-
- try {
- ComponentCore.createReference(container,container);
- } catch (Exception e) {
- fail(e.toString());
- }
- }
- public void testCreateResources() {
- IResource res = project.getFile(new Path("WebModule1/WebContent/WEB-INF/web.xml"));
-
- try {
- ComponentCore.createResources(res);
- } catch (Exception e) {
- fail(e.toString());
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java
deleted file mode 100644
index 1b53254..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.componentcore.IEditModelHandler;
-
-public class IEditModelHandlerTest extends TestCase {
- public class EditModelHandlerTest implements IEditModelHandler {
- public EditModelHandlerTest() {
- }
-
- public void save(IProgressMonitor aMonitor) {
- }
-
- public void saveIfNecessary(IProgressMonitor aMonitor) {
- }
-
- public void dispose() {
- }
- }
-
- public void testSave() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.save(null);
- }
-
- public void testSaveIfNecessary() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.saveIfNecessary(null);
-
- }
-
- public void testDispose() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java
deleted file mode 100644
index 2ead453..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualComponentAPITest extends BaseVirtualTest {
-
- public IVirtualComponentAPITest(String name) {
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- public void testGetName() {
-
- String name = component.getName();
- }
-
-// public void testGetComponentTypeId() {
-// String id = component.getComponentTypeId() ;
-// }
-//
-// public void testSetComponentTypeId() {
-// String id = "jst.ejb";
-// component.setComponentTypeId(id) ;
-// }
-
- public void testGetMetaProperties() {
- Properties properties = component.getMetaProperties() ;
- }
-
- public void testGetMetaResources() {
- IPath[] metaresources = component.getMetaResources() ;
-
- }
-
- public void testSetMetaResources() {
-
- IPath[] metaresources = new IPath[1];
- metaresources[0] = new Path("/test");
- component.setMetaResources(metaresources) ;
-
- }
-
- public void testGetResources() {
- String resource = "/test";
- IVirtualFolder rootFolder = component.getRootFolder();
- IVirtualResource[] virtualResource = rootFolder.getResources(resource) ;
-
- }
-
- public void testExists(){
- boolean exists = component.exists();
- }
-
- public void testGetRootFolder(){
- component.getRootFolder();
- }
-
- public void testGetProject(){
- component.getProject();
- }
-
-
- public void testAddMetaProperty(){
- component.setMetaProperty("Test1", "test1Value");
- }
-
- public void testSetProperties(){
- Properties props = new Properties();
- props.setProperty("Test2", "Value2");
- component.setMetaProperties(props);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java
deleted file mode 100644
index 9e74ebb..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualContainerTestAPI extends BaseVirtualTest {
-
- protected IVirtualContainer deletemeVirtualFolder2;
- protected static final IPath DELETEME_PATH2 = new Path("/deleteme2"); //$NON-NLS-1$
-
- public IVirtualContainerTestAPI(String name) {
- super(name);
- }
-
-
- public void test_create()
- throws CoreException {
-
- IVirtualFolder rootFolder = component.getRootFolder();
- deletemeVirtualFolder2 = rootFolder.getFolder(DELETEME_PATH2);
- deletemeVirtualFolder2.create(IVirtualResource.FORCE, null);
- deletemeVirtualFolder2.delete(IVirtualResource.FORCE, null);
- }
-
- public void test_exists() {
- IVirtualContainer container = webInfFolder;
- IPath path = new Path("/deleteme");
- boolean bRetValue = container.exists(path);
- }
-
- public void test_findMember() {
- String name = "lib";
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.findMember(name);
-
- }
-
- public void test_findMember2() {
- String name = "lib";
- int searchFlags = 0;
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.findMember(name,searchFlags);
- }
-
- public void test_findMember3() {
- IPath path = new Path("/lib");
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.findMember(path);
-
- }
-
- public void test_findMember4() {
- IPath path = new Path("/lib");
- int searchFlags = 0;
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.findMember(path,searchFlags);
- }
-
-
-
- public void test_getFile() {
- IPath path = new Path("/deleteme");
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.getFile(path);
- }
-
- public void test_getFolder() {
- IPath path = new Path("/deleteme");
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.getFolder(path);
- }
-
- public void test_getFile2() {
- String name = "/deleteme";
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.getFile(name);
- }
-
- public void test_getFolder2() {
- String name = "/deleteme";
- IVirtualContainer container = webInfFolder;
- IVirtualResource resource= container.getFolder(name);
- }
-
- public void test_members() throws CoreException {
- IVirtualContainer container = webInfFolder;
- IVirtualResource[] resource= container.members();
- }
-
- public void members() throws CoreException {
- IVirtualContainer container = webInfFolder;
- int memberFlags = 0;
- IVirtualResource[] resource= container.members(memberFlags);
-
-
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java
deleted file mode 100644
index efdb4e0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-
-public class IVirtualFileAPITest extends BaseVirtualTest {
-
- protected IVirtualFile testFile1;
- protected IFile realTestFile1;
- public static final Path TEST_FILE_REAL_PATH = new Path("WebModule1/testdata/TestFile1.txt"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TEST_FILE_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
-
- public IVirtualFileAPITest(String name) {
- super(name);
-
- }
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- IVirtualFolder rootFolder = component.getRootFolder();
- testFile1 = rootFolder.getFile(TESTDATA_FOLDER_RUNTIME_PATH);
- realTestFile1 = TEST_PROJECT.getFile(TESTDATA_FOLDER_REAL_PATH);
-
- }
-
- public void testGetUnderlyingFile() {
- IFile file = testFile1.getUnderlyingFile();
- }
-
- public void testGetUnderlyingFiles() {
- IFile[] file = testFile1.getUnderlyingFiles();
- }
-
- public void testIsAccessible() throws CoreException {
- assertEquals(((IVirtualResource)deletemeVirtualFolder).isAccessible(),true);
- ((IVirtualResource)deletemeVirtualFolder).delete(IVirtualResource.FORCE, null);
- //assertEquals(deletemeVirtualFolder.isAccessible(),false);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java
deleted file mode 100644
index 7a3679d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-public class IVirtualFolderAPITest extends TestCase {
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final Path WEBINF_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/"+TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final Path TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- private static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- private IVirtualComponent component;
-
- private IVirtualFolder webInfFolder;
- private IContainer realWebInfFolder;
-
- private IVirtualFolder deletemeVirtualFolder;
- private IContainer deletemeFolder;
-
- public IVirtualFolderAPITest(String name) {
- super(name);
- }
-
- public static Test suite() {
- return new SimpleTestSuite(IVirtualFolderAPITest.class);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
-
- realWebInfFolder = TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- component = ComponentCore.createComponent(TEST_PROJECT);
- IVirtualFolder rootFolder = component.getRootFolder();
-
- webInfFolder = rootFolder.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- rootFolder.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- deletemeVirtualFolder = rootFolder.getFolder(DELETEME_PATH);
- deletemeVirtualFolder.create(IVirtualResource.FORCE, null);
-
- deletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
-
- }
-
- public void testDelete() throws CoreException {
- assertEquals(((IVirtualResource)deletemeVirtualFolder).exists(),true);
- ((IVirtualResource)deletemeVirtualFolder).delete(IVirtualResource.FORCE, null);
- // assertEquals(deletemeFolder.exists(),false);
-
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(deletemeFolder.exists())
- deletemeFolder.delete(IVirtualResource.FORCE, null);
-
- }
-
- public void testGetFileExtension() {
- assertTrue("The /WEB-INF folder should have no file extension.", ((IVirtualResource)webInfFolder).getFileExtension() == null); //$NON-NLS-1$
- }
-
- public void testGetUnderlyingFolders() {
- IContainer[] aDeletemeFolder = deletemeVirtualFolder.getUnderlyingFolders();
- assertEquals(aDeletemeFolder.length==1,true);
- }
-
- public void testGetUnderlyingResources() {
- IResource[] aDeletemeFolder = ((IVirtualResource)deletemeVirtualFolder).getUnderlyingResources();
- assertEquals(aDeletemeFolder.length==1,true);
- }
- public void testGetVirtualComponentFromResource() {
- IResource aDeletemeFolder = ((IVirtualResource)deletemeVirtualFolder).getUnderlyingResources()[0];
- IVirtualComponent comp = (IVirtualComponent)aDeletemeFolder.getAdapter(IVirtualComponent.class);
- assertEquals(comp.getName(),TestWorkspace.PROJECT_NAME);
- }
-
-
- public void testGetUnderlyingFolder() {
- IContainer aDeletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
- assertNotNull(aDeletemeFolder);
- }
-
- public void testGetUnderlyingResource() {
- IResource aDeletemeFolder = ((IVirtualResource)deletemeVirtualFolder).getUnderlyingResource();
- assertNotNull(aDeletemeFolder);
- }
-
- public void testGetWorkspaceRelativePath() {
- IPath realPath = realWebInfFolder.getFullPath();
- IPath virtualPath = ((IVirtualResource)webInfFolder).getWorkspaceRelativePath();
- assertEquals("The workspace relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetComponent() {
- assertNotNull(((IVirtualResource)webInfFolder).getComponent()); //$NON-NLS-1$
- }
-
- public void testGetProjectRelativePath() {
- IPath realPath = realWebInfFolder.getProjectRelativePath();
- IPath virtualPath = webInfFolder.getProjectRelativePath();
- assertEquals("The project relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
- }
-
- public void testGetRuntimePath() {
- IPath virtualPath = ((IVirtualResource)webInfFolder).getRuntimePath();
- assertEquals("The runtime path of the virtual resource must match the real resource", WEBINF_FOLDER_RUNTIME_PATH, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetName() {
- assertEquals("The name of the virtual resource must match the expected name.", TEST_FOLDER_NAME, webInfFolder.getName()); //$NON-NLS-1$
- }
-
- public void testGetParent() {
- assertEquals("The parent of the virtual resource must match the components root folder.", component.getRootFolder(), webInfFolder.getParent()); //$NON-NLS-1$
- }
-
- public void testEquals() {
- IVirtualResource resource = webInfFolder.getParent();
- boolean bRetValue = resource.equals(component.getRootFolder());
- assertTrue(bRetValue);
- }
-
- public void testGetProject() {
- assertEquals("The project of the virtual resource must match the test project.", TEST_PROJECT, ((IVirtualResource)webInfFolder).getProject()); //$NON-NLS-1$
- }
-
- public void testGetType() {
- assertEquals("The type of the virtual resource must match the type of the test project.", IVirtualResource.FOLDER, ((IVirtualResource)webInfFolder).getType()); //$NON-NLS-1$
- }
-
-
- /*public void testGetFilePath() {
- IVirtualFile test3jsp = testdataFolder.getFile(new Path("/jsps/TestJsp3.jsp"));
-
- IPath expectedPath = TESTDATA_FOLDER_REAL_PATH.append(new Path("/jsps/TestJsp3.jsp"));
- assertEquals("The test file project relative path must match.", expectedPath, test3jsp.getProjectRelativePath()); //$NON-NLS-1$
- }*/
-
-
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- /*public void testDeleteintIProgressMonitor() throws Exception {
- deletemeVirtualFolder.delete(0, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !deletemeFolder.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = component.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(deletemeVirtualFolder.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }*/
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- /*public void testDeleteintIProgressMonitor2() throws Exception {
- deletemeVirtualFolder.delete(IVirtualResource.IGNORE_UNDERLYING_RESOURCE, null);
-
- assertTrue("The real folder should not be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is supplied.", deletemeFolder.exists()); //$NON-NLS-1$
-
- // only handles explicit mappings
- StructureEdit moduleCore = null;
- try {
- URI runtimeURI = URI.createURI(deletemeVirtualFolder.getRuntimePath().toString());
- moduleCore = StructureEdit.getStructureEditForWrite(TEST_PROJECT);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_1_NAME);
- ComponentResource[] resources = wbComponent.findWorkbenchModuleResourceByDeployPath(runtimeURI);
- assertTrue("There should be no matching components found in the model.", resources.length == 0); //$NON-NLS-1$
-
- } finally {
- if (moduleCore != null) {
- moduleCore.saveIfNecessary(null);
- moduleCore.dispose();
- }
- }
- }*/
-
- /*
- * Class under test for void delete(boolean, IProgressMonitor)
- */
- /*public void testDeletebooleanIProgressMonitor() throws Exception {
- deletemeVirtualFolder.delete(IVirtualResource.FORCE, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !deletemeFolder.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = component.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(deletemeVirtualFolder.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- } */
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java
deleted file mode 100644
index 18a1013..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class IVirtualReferenceAPITest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- public void testCreate() {
- IVirtualReference reference = new VirtualReference();
- reference.create(0,null);
-
- }
-
- public void testSetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- reference.setRuntimePath(new Path("/"));
- }
-
- public void testGetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- IPath path = reference.getRuntimePath();
- }
-
- public void testSetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- reference.setDependencyType(dependencyType);
- }
-
- public void testGetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- dependencyType = reference.getDependencyType();
- }
-
- public void testExists() {
- IVirtualReference reference = new VirtualReference();
- boolean exists = reference.exists();
- }
-
- public void testGetEnclosingComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getEnclosingComponent();
- }
-
- public void testGetReferencedComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getReferencedComponent();
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java
deleted file mode 100644
index 5c5c900..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-
-/**
- *
- * <p>
- * To run this test, extract the /testData/virtual-api-test_workspace.zip found under the same
- * plugin, and use "Run As -> JUnit Plugin Test". Be sure to point the configuration at the
- * extracted workspace, and make sure that "Clear workspace contents" is NOT checked. The test may
- * be run using a Headless Eclipse.
- * </p>
- */
-public class ModuleCoreAPIFVTTest extends TestCase {
-
- private static final Class IFOLDER_CLASS = IVirtualFolder.class;
- private static final Class IFILE_CLASS = IVirtualFile.class;
-
- private final Map virtualResourceTree = new HashMap();
- private static final Map IGNORE = new HashMap();
-
-
-
- public static Test suite() {
- return new org.eclipse.wst.common.tests.SimpleTestSuite(ModuleCoreAPIFVTTest.class);
- }
-
- public ModuleCoreAPIFVTTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- setupNavigateComponentTest();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- tearDownCreateNewModuleTest();
- tearDownCreateLinkTest();
- }
-
- public void tearDownCreateNewModuleTest() throws Exception {
- IFolder rootFolder = TestWorkspace.getTargetProject().getFolder(TestWorkspace.NEW_WEB_MODULE_NAME);
- if (rootFolder.exists())
- rootFolder.delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, null);
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.getComponent();
-
- if (wbComponent != null) {
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/")); //$NON-NLS-1$
-
- for (int i = 0; i < componentResources.length; i++) {
- wbComponent.getResources().remove(componentResources[i]);
- }
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.save(null);
- moduleCore.dispose();
- }
- }
-
- }
-
- /**
- * Create a Map structure that mimics the expected structure on disk.
- */
- public void setupNavigateComponentTest() throws Exception {
- IPath images;
- IPath jsps;
- IPath WEB_INF;
- TestWorkspace.init();
- virtualResourceTree.put((images = new Path("images")), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put((jsps = new Path("jsps")), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put(new Path(TestWorkspace.META_INF), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put((WEB_INF = new Path(TestWorkspace.WEB_INF)), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put(new Path("TestFile1.txt"), null); //$NON-NLS-1$
- virtualResourceTree.put(new Path("TestFile2.txt"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(images)).put(new Path("icon.gif"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp1.jsp"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp2.jsp"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp3.jsp"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("web.xml"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("classes"), IGNORE); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("lib"), new HashMap()); //$NON-NLS-1$
- }
-
- /**
- * Checks for and removes the mapping and folder that will be created by
- * {@link ModuleCoreAPIFVTTest#testCreateLink()}.
- */
- public void tearDownCreateLinkTest() throws Exception {
- IFolder module2Images = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- if (module2Images.exists())
- module2Images.delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, null);
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.getComponent();
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- for (int i = 0; i < componentResources.length; i++) {
- wbComponent.getResources().remove(componentResources[i]);
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.save(null);
- moduleCore.dispose();
- }
- }
- }
-
-
- public void assertTree(Map resourceTree, IVirtualFolder virtualFolder) throws Exception {
- assertTree(resourceTree, virtualFolder, ""); //$NON-NLS-1$
- }
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see IContainer#members()
- * @see IResource#getName()
- *
- * @param resourceTree
- * @param virtualFolder
- * @param indent
- */
- public void assertTree(Map resourceTree, IVirtualFolder virtualFolder, String indent) throws Exception {
- // API_TEST VirtualContainer.members()
- IVirtualResource[] members = virtualFolder.members();
-
- assertEquals("The number of resources contained by \"" + virtualFolder.getProjectRelativePath() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- resourceTree.size(), members.length);
- IPath relativePath;
- Map subTree;
- for (int i = 0; i < members.length; i++) {
- System.out.println(indent + members[i]);
- relativePath = new Path(members[i].getName());
-
- subTree = (Map) resourceTree.get(relativePath);
- if (subTree != null) {
- assertType(members[i], IFOLDER_CLASS);
- if (subTree != IGNORE)
- assertTree(subTree, (IVirtualFolder) members[i], indent + "\t"); //$NON-NLS-1$
- } else {
- assertType(members[i], IFILE_CLASS);
- }
- }
- }
-
- /**
- */
- public void assertType(IVirtualResource resource, Class type) {
- assertTrue("Expected a(n) " + type.getName() + " for member: " + resource.getProjectRelativePath(), //$NON-NLS-1$ //$NON-NLS-2$
- type.isInstance(resource));
- }
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IContainer#members()
- */
- public void testNavigateComponent() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_1_NAME);
- IVirtualFolder rootFolder = component.getRootFolder();
- IVirtualFolder root = rootFolder.getFolder(new Path("/")); //$NON-NLS-1$
- // TODO
- //assertTree(virtualResourceTree, root);
-
- }
-
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IFolder#createLink(org.eclipse.core.runtime.IPath, int,
- * org.eclipse.core.runtime.IProgressMonitor)
- *
- */
-/* Bug 160101
- public void testCreateLink() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_2_NAME);
- IVirtualFolder rootFolder = component.getRootFolder();
- IVirtualFolder images = rootFolder.getFolder(new Path("/images")); //$NON-NLS-1$
- ((IVirtualResource)images).createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- IFolder realImages = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- assertTrue("The /WebContent2/images directory must exist.", realImages.exists()); //$NON-NLS-1$
-
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.getComponent();
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- assertTrue("There should be at least one mapping for virtual path \"/images\".", componentResources.length > 0); //$NON-NLS-1$
-
- ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
- componentResources = resourceTreeRoot.findModuleResources(realImages.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // make sure that only one component resource is created
-
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- componentResources = resourceTreeRoot.findModuleResources(realImages.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
-
- }
-*/
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IFolder#createLink(org.eclipse.core.runtime.IPath, int,
- * org.eclipse.core.runtime.IProgressMonitor)
- *
- */
- public void testCreateWebModule() throws Exception {
- //TODO - Redo tests
-
-// IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.NEW_WEB_MODULE_NAME);
-// // if(!component.exists())
-// component.create(0, null);
-//
-// IVirtualFolder rootFolder = component.getRootFolder();
-// IVirtualFolder root = rootFolder.getFolder(new Path("/")); //$NON-NLS-1$
-// IPath realWebContentPath = new Path(TestWorkspace.PROJECT_NAME + IPath.SEPARATOR + "WebContent"); //$NON-NLS-1$
-// root.createLink(realWebContentPath, 0, null); //$NON-NLS-1$
-//
-// IVirtualFolder metaInfFolder = root.getFolder(TestWorkspace.META_INF);
-// metaInfFolder.create(IVirtualResource.FORCE, null);
-//
-// IVirtualFolder webInfFolder = root.getFolder(TestWorkspace.WEB_INF);
-// webInfFolder.create(IVirtualResource.FORCE, null);
-//
-// IFolder realWebContent = TestWorkspace.getTargetProject().getFolder(realWebContentPath);
-// assertTrue("The " + realWebContent + " directory must exist.", realWebContent.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// IFolder realMetaInfFolder = realWebContent.getFolder(TestWorkspace.META_INF);
-// assertTrue("The " + realMetaInfFolder + " directory must exist.", realMetaInfFolder.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// IFolder realWebInfFolder = realWebContent.getFolder(TestWorkspace.WEB_INF);
-// assertTrue("The " + realWebInfFolder + " directory must exist.", realWebInfFolder.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// StructureEdit moduleCore = null;
-// try {
-// moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
-// WorkbenchComponent wbComponent = moduleCore.getComponent();
-//
-// ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/" + TestWorkspace.META_INF)); //$NON-NLS-1$
-//
-// assertTrue("There should be at least one mapping for virtual path \"/" + TestWorkspace.META_INF + "\".", componentResources.length > 0); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
-// componentResources = resourceTreeRoot.findModuleResources(metaInfFolder.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-//
-// assertTrue("There should be exactly one Component resource with the source path \"" + metaInfFolder.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-//
-// assertTrue("The runtime path should match \"/" + TestWorkspace.META_INF + "\".", componentResources[0].getRuntimePath().toString().equals("/" + TestWorkspace.META_INF)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-//
-// // try to force duplicate mappings
-// metaInfFolder.create(IVirtualResource.FORCE, null);
-// webInfFolder.create(IVirtualResource.FORCE, null);
-//
-// // ensure that multiple mappings aren't added
-//
-// assertTrue("The mapping should not be duplicated.", !isDuplicated(wbComponent, metaInfFolder.getRuntimePath())); //$NON-NLS-1$
-// assertTrue("The mapping should not be duplicated.", !isDuplicated(wbComponent, webInfFolder.getRuntimePath())); //$NON-NLS-1$
-// } finally {
-// if (moduleCore != null)
-// moduleCore.dispose();
-// }
-
- }
-
- private boolean isDuplicated(WorkbenchComponent wbComponent, IPath runtimePath) {
-
- URI runtimeURI = URI.createURI(runtimePath.toString());
- boolean found = false;
- List resourceList = wbComponent.getResources();
- for (Iterator iter = resourceList.iterator(); iter.hasNext();) {
- ComponentResource resource = (ComponentResource) iter.next();
- if(resource.getRuntimePath().equals(runtimeURI))
- if(found)
- return true;
- else
- found = true;
- }
- return false;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java
deleted file mode 100644
index 057cce4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ModuleCoreNatureAPITest extends TestCase {
-
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
- public void testConfigure() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- try {
- nature.configure();
- } catch (CoreException e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testGetModuleCoreNature() {
- new ModuleCoreNature();
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- assertNotNull(nature);
- }
-
-
-
- public void testGetModuleStructuralModelForRead() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- nature.getModuleStructuralModelForRead(this);
- ArtifactEditModel model = nature.getArtifactEditModelForRead(moduleURI, this);
- assertNotNull(model);
- }
-
- public void testGetModuleStructuralModelForWrite() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- ArtifactEditModel model = nature.getArtifactEditModelForWrite(moduleURI, this);
- assertNotNull(model);
- }
-
- public void testGetArtifactEditModelForRead() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EditModel model = nature.getEditModelForRead(EDIT_MODEL_ID, this);
- assertNotNull(model);
- }
-
- public void testGetArtifactEditModelForWrite() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EditModel model = nature.getEditModelForWrite(EDIT_MODEL_ID, this);
- assertNotNull(model);
- }
-
- /*
- * Class under test for String getNatureID()
- */
- public void testGetNatureID() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- String id = nature.getNatureID();
- assertTrue(id.equals(IModuleConstants.MODULE_NATURE_ID));
- }
-
- public void testPrimaryContributeToContext() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EMFWorkbenchContextBase context = new EMFWorkbenchContextBase(project);
- try {
- nature.primaryContributeToContext(context);
- } catch (Exception e) {
- fail();
- }
-
- }
-
- /*
- * Class under test for ResourceSet getResourceSet()
- */
- public void testGetResourceSet() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- ResourceSet set = nature.getResourceSet();
- assertNotNull(set);
- }
-
- public void testSecondaryContributeToContext() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EMFWorkbenchContextBase context = new EMFWorkbenchContextBase(project);
- try {
- nature.secondaryContributeToContext(context);
- } catch (Exception e) {
- fail();
- }
- }
-
- /*
- * Class under test for String getPluginID()
- */
- public void testGetPluginID() {
- // protected cant test unless in same package....
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
-
- }
-
- public void testAddModuleCoreNatureIfNecessary() {
- try {
- project.getDescription().setNatureIds(new String[0]);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- ModuleCoreNature.addModuleCoreNatureIfNecessary(project, new NullProgressMonitor());
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- assertNotNull(nature);
- }
-
- public void testUnresolveableURIException() {
- UnresolveableURIException uriEx = new UnresolveableURIException(moduleURI);
- assertNotNull(uriEx);
- }
-
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java
deleted file mode 100644
index 5081fa7..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.internal.impl.ComponentCoreURIConverter;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-public class ModuleCoreURIConverterUnitTest extends TestCase {
-
- public static Test suite() {
- return new SimpleTestSuite(ModuleCoreURIConverterUnitTest.class);
- }
-
- public ModuleCoreURIConverterUnitTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
- }
-
- public void testNormalizeDDURI() throws Exception {
-
- ComponentCoreURIConverter converter = new ComponentCoreURIConverter(TestWorkspace.getTargetProject());
-
- URI inputURI = URI.createURI("module:/resource/WebModule1/WebModule1/WEB-INF/web.xml"); //$NON-NLS-1$
-
- URI resultURI = converter.normalize(inputURI);
-
- URI expectedURI = URI.createURI("platform:/resource/WebModule1/WebModule1/WebContent/WEB-INF/web.xml"); //$NON-NLS-1$
- // TODO
- //assertEquals("The resultant URI must match the expected URI", expectedURI, resultURI); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java
deleted file mode 100644
index 82d4fac..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java
+++ /dev/null
@@ -1,423 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.ComponentType;
-import org.eclipse.wst.common.componentcore.internal.ProjectComponents;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-public class StructureEditAPITest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- public static final String EDITMODEL_STRESS = "stresstest";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
- public static Test suite() {
- return new SimpleTestSuite(StructureEditAPITest.class);
- }
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- TestWorkspace.init();
- project = TestWorkspace.getTargetProject();
- }
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public void testGetStructureEditForRead() throws Exception {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetStructureEditForWrite() throws Exception{
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetModuleCoreNature() throws Exception{
- ModuleCoreNature nature = StructureEdit.getModuleCoreNature(moduleURI);
- assertNotNull(nature);
- }
-
- /*
- * Class under test for IProject getContainingProject(WorkbenchComponent)
- */
- public void testGetContainingProjectWorkbenchComponent() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- IProject aProject = StructureEdit.getContainingProject(wbComponent);
- assertNotNull(aProject);
- } finally {
- moduleCore.dispose();
- }
- }
-
- /*
- * Class under test for IProject getContainingProject(URI)
- */
- public void testGetContainingProjectURI() throws Exception {
- IProject aProject = StructureEdit.getContainingProject(moduleURI);
- assertNotNull(aProject);
- }
-
- /**
- *
- */
-// public void testGetEclipseResource() {
-// StructureEdit moduleCore = null;
-//
-// try {
-// moduleCore = StructureEdit.getStructureEditForRead(project);
-// WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
-// ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
-// moduleCore.getEclipseResource(componentResource);
-// } finally {
-// if (moduleCore != null) {
-// moduleCore.dispose();
-//
-// }
-// assertNotNull(moduleCore);
-//
-// }
-// }
-
- /**
- *
- */
-// public void testGetOutputContainerRoot() {
-// StructureEdit moduleCore = null;
-// try {
-// moduleCore = StructureEdit.getStructureEditForRead(project);
-// WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
-// ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
-// StructureEdit.getOutputContainerRoot(wbComponent);
-// } finally {
-// if (moduleCore != null) {
-// moduleCore.dispose();
-//
-// }
-// assertNotNull(moduleCore);
-// }
-// }
-
- /**
- *
- */
-// public void testGetOutputContainersForProject() {
-// StructureEdit moduleCore = null;
-// try {
-// moduleCore = StructureEdit.getStructureEditForRead(project);
-// WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
-// ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
-// StructureEdit.getOutputContainersForProject(project);
-// } finally {
-// if (moduleCore != null) {
-// moduleCore.dispose();
-//
-// }
-// assertNotNull(moduleCore);
-// }
-// }
-
- /**
- *
- */
- public void testGetDeployedName() throws Exception{
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- String deployName = StructureEdit.getDeployedName(moduleURI);
- assertNotNull(deployName);
- } finally {
- moduleCore.dispose();
- }
- }
-
- /**
- *
- */
- public void testGetComponentType() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- ComponentType type = StructureEdit.getComponentType(ComponentCore.createComponent(project,wbComponent.getName()));
- assertNotNull(type);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testSave() {
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- moduleCore.save(new NullProgressMonitor());
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testSaveIfNecessary() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- moduleCore.saveIfNecessary(new NullProgressMonitor());
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testPrepareProjectComponentsIfNecessary() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- moduleCore.prepareProjectComponentsIfNecessary();
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetComponentModelRoot() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- ProjectComponents projectComponents = moduleCore.getComponentModelRoot();
- assertNotNull(projectComponents);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetSourceContainers() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- ComponentResource[] containers = moduleCore.getSourceContainers(wbComponent);
- assertNotNull(containers);
-
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetWorkbenchModules() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- WorkbenchComponent[] components = moduleCore.getWorkbenchModules();
- assertNotNull(components);
- assertTrue(components.length > 0);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testCreateWorkbenchModule() {
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- wbComponent = moduleCore.createWorkbenchModule("test");
- assertNotNull(wbComponent);
- } finally {
- moduleCore.dispose();
- }
- }
-
-
- public void testCreateWorkbenchModuleResource() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- ComponentResource resource = moduleCore.createWorkbenchModuleResource(project.getFile("WebModule1/NewFolder"));
- assertNotNull(resource);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testCreateModuleType() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- ComponentType type = moduleCore.createModuleType(EDIT_MODEL_ID);
- assertNotNull(type);
- } finally {
- moduleCore.dispose();
- }
- }
-
-
- /*
- * Class under test for ComponentResource[] findResourcesByRuntimePath(URI, URI)
- */
- public void testFindResourcesByRuntimePathURIURI() throws Exception{
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- ComponentResource[] resources = moduleCore.findResourcesByRuntimePath(moduleURI);
- assertNotNull(resources);
- assertTrue(resources.length > 0);
- } finally {
- moduleCore.dispose();
- }
- }
-
- /*
- * Class under test for ComponentResource[] findResourcesByRuntimePath(URI)
- */
- public void testFindResourcesByRuntimePathURI() throws Exception{
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- ComponentResource[] resources = moduleCore.findResourcesByRuntimePath(moduleURI, moduleURI);
- assertNotNull(resources);
- assertTrue(resources.length > 0);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testFindResourcesBySourcePath() throws Exception {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- ComponentResource[] resources = moduleCore.findResourcesBySourcePath(moduleURI);
- assertNotNull(resources);
- assertTrue(resources.length > 0);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testFindComponentByName() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- assertNotNull(wbComponent);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testFindComponentByURI() throws Exception {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.findComponentByURI(moduleURI);
- assertNotNull(wbComponent);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testIsLocalDependency() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- moduleCore.isLocalDependency(null);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testGetFirstModule() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- assertNotNull(moduleCore);
- WorkbenchComponent wbComponent = moduleCore.getFirstModule();
- assertNotNull(wbComponent);
- } finally {
- moduleCore.dispose();
- }
- }
-
- public void testCreateComponentURI() {
- StructureEdit moduleCore = null;
- URI uri = StructureEdit.createComponentURI(project, "testComp");
- assertNotNull(uri);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditStressTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditStressTest.java
deleted file mode 100644
index 56e01fc..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditStressTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory;
-import org.eclipse.wst.common.componentcore.internal.Property;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-public class StructureEditStressTest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- public static final String EDITMODEL_STRESS = "stresstest";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
- public static Test suite() {
- return new SimpleTestSuite(StructureEditStressTest.class);
- }
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- TestWorkspace.init();
- project = TestWorkspace.getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
-
-
- public void testMultiThreadAccess() {
-
- Job[] testJobs = new Job[50];
- for (int i = 0; i < testJobs.length; i++) {
- Job job = new Job("Job " + i)
- {
-
- protected IStatus run(IProgressMonitor monitor)
- {
- StructureEdit moduleCore = null;
- try
- {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- Property prop = ComponentcoreFactory.eINSTANCE.createProperty();
- prop.setName("Job " + System.currentTimeMillis());
- prop.setValue("Blah");
- if (moduleCore != null) {
- if (moduleCore.getComponent() != null) {
- moduleCore.getComponent().getProperties().add(prop);
- System.out.println(prop.getName());
- moduleCore.saveIfNecessary(null);
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return Status.CANCEL_STATUS;
- }
- finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
- return Status.OK_STATUS;
- }
- public boolean belongsTo(Object family) {
- return EDITMODEL_STRESS.equals(family);
- }
- };
- testJobs[i] = job;
- }
- for (int j = 0; j < testJobs.length; j++) {
- Job job = testJobs[j];
- job.schedule();
- }
- try {
- Platform.getJobManager().join(EDITMODEL_STRESS,null);
- } catch (OperationCanceledException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-public void testMultiThreadComponentAccess() {
-
- Job[] testJobs = new Job[50];
- for (int i = 0; i < testJobs.length; i++) {
- Job job = new Job("Job " + i)
- {
-
- protected IStatus run(IProgressMonitor monitor)
- {
- IVirtualComponent comp = ComponentCore.createComponent(project);
- IPath aPath = comp.getRootFolder().getProjectRelativePath();
- assertEquals(aPath,new Path("/WebModule1/WebContent"));
- return Status.OK_STATUS;
- }
- public boolean belongsTo(Object family) {
- return EDITMODEL_STRESS.equals(family);
- }
- };
- testJobs[i] = job;
- }
- for (int j = 0; j < testJobs.length; j++) {
- Job job = testJobs[j];
- job.schedule();
- }
- try {
- Platform.getJobManager().join(EDITMODEL_STRESS,null);
- } catch (OperationCanceledException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java
deleted file mode 100644
index 3f936e9..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class TestWorkspace {
-
- public static final String PROJECT_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_1_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_2_NAME = "WebModule2"; //$NON-NLS-1$
-
- public static final String NEW_WEB_MODULE_NAME = "NewWebModule"; //$NON-NLS-1$
-
-
- public static final String META_INF = "META-INF"; //$NON-NLS-1$
- public static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static Path zipFilePath = new Path("testData/TestVirtualAPI.zip");
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String[] MODULE_NAMES = new String[]{WEB_MODULE_1_NAME, WEB_MODULE_2_NAME};
-
-
- public static IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public static void init() {
-
- try {
- IProject project = getTargetProject();
- if (!project.exists())
- createProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public static boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java
deleted file mode 100644
index 337b3ec..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class DefectVerificationTests extends TestCase {
-
-
- private static Path zipFilePath = new Path("testData/DefectVerificationTests.zip");
-
- protected void setUp() throws Exception {
-// IPath localZipPath = getLocalPath();
-// ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{"DefectVerificationProject"});
-// util.createProjects();
- }
-
- public void test96862() {
-
- IPath filePath = new Path("/WEB-INF/web.xml");
- IPath folderPath = new Path("/WEB-INF");
-
- IVirtualComponent component = ComponentCore.createComponent(getProject(), "DefectVerificationProject");
-
- IVirtualFolder rootFolder = component.getRootFolder();
- IVirtualResource fileResource = rootFolder.findMember(filePath);
- assertEquals("The returned type should be a file.", IVirtualResource.FILE, fileResource.getType());
-
- IVirtualResource folderResource = rootFolder.findMember(folderPath);
- assertEquals("The returned type should be a folder.", IVirtualResource.FOLDER, folderResource.getType());
-
- }
-
- private IProject getProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject("DefectVerificationProject");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java
deleted file mode 100644
index aa69842..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.List;
-import java.util.Properties;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualComponentAPITest extends IVirtualContainerAPITest {
-
- private IVirtualComponent virtualComponent;
- private WorkbenchComponent workbenchComponent;
- private StructureEdit structureEdit;
-
- public IVirtualComponentAPITest(String name) {
- super(name);
- }
-
- public static TestSuite suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new IVirtualComponentAPITest("testGetReferences"));
- return suite;
- }
-
- protected void doSetup() throws Exception {
- virtualComponent = ComponentCore.createComponent(TestWorkspace.TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
- structureEdit = StructureEdit.getStructureEditForRead(TestWorkspace.TEST_PROJECT);
- workbenchComponent = structureEdit.getComponent();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if(structureEdit != null)
- structureEdit.dispose();
- }
-
- public void testGetName() {
-
- String name = virtualComponent.getName();
- }
-
- public void testGetMetaProperties() {
- Properties properties = virtualComponent.getMetaProperties() ;
- }
-
- public void testGetMetaResources() {
- IPath[] metaresources = virtualComponent.getMetaResources() ;
-
- }
-
- public void testSetMetaResources() {
-
- IPath[] metaresources = new IPath[1];
- metaresources[0] = new Path("/test");
- virtualComponent.setMetaResources(metaresources) ;
-
- }
-
- public void testGetResources() {
- String resource = "/test";
- IVirtualFolder rootFolder = virtualComponent.getRootFolder();
- IVirtualResource[] virtualResource = rootFolder.getResources(resource) ;
-
- }
-
- public void testGetReferences() {
- IVirtualReference[] references = virtualComponent.getReferences();
-
- for(int i=0; i<references.length;i++)
- assertReference(references[i]);
- }
-
- private void assertReference(IVirtualReference reference) {
- List referencedComponents = workbenchComponent.getReferencedComponents();
- ReferencedComponent referencedComponent = null;
- String componentName = null;
- for(int i=0; i<referencedComponents.size(); i++) {
- referencedComponent = (ReferencedComponent) referencedComponents.get(i);
- try {
- componentName = ModuleURIUtil.getDeployedName(referencedComponent.getHandle());
- } catch (UnresolveableURIException e) {
- }
- if(componentName != null && componentName.equals(reference.getReferencedComponent().getName())) {
- assertEquals("The runtime paths must match.", referencedComponent.getRuntimePath(), reference.getRuntimePath());
- assertEquals("The workbench component should match the enclosing component.", virtualComponent, reference.getEnclosingComponent());
- assertEquals("The dependencyTypes should match.", referencedComponent.getDependencyType().getValue(), reference.getDependencyType());
- URI actualHandle = ModuleURIUtil.fullyQualifyURI(reference.getReferencedComponent().getProject());
- assertEquals("The handles should match.", referencedComponent.getHandle(), actualHandle);
- return;
- }
- }
- fail("A matching reference was not found for "+reference.getRuntimePath());
- }
-
- public void testSetReferences() {
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java
deleted file mode 100644
index b5c2946..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public abstract class IVirtualContainerAPITest extends IVirtualResourceAPITest {
-
- protected IVirtualContainer targetVirtualContainer;
- protected IContainer targetPlatformContainer;
- protected IPath expectedPlatformContainerPath;
-
- /*
- * The following fields assume a minimum structure of:
- *
- * / [Root]
- * /jsps [Folder]
- * /TestJsp3.jsp [File]
- * /WEB-INF [Folder]
- * /lib [Folder]
- * /TestFile1.txt [File]
- *
- */
-
-
- protected IPath expectedFileSingleDepthPath = new Path("/jsps/TestJsp3.jsp");
- protected IPath expectedFolderSingleDepthPath = new Path("WEB-INF/lib");
-
- protected String expectedFolderName = "jsps";
- protected IPath expectedFolderZerothDepthPath = new Path(expectedFolderName);
-
- protected String expectedFileName = "TestFile1.txt";
- protected IPath expectedFileZerothDepthPath = new Path(expectedFileName);
-
- public IVirtualContainerAPITest(String name) {
- super(name);
- }
-
-
- protected void assertRequirements() {
- super.assertRequirements();
-// assertNotNull("The target virtual container must be specified.", targetVirtualContainer);
-// assertNotNull("The target platform container must be specified.", targetPlatformContainer);
-// assertNotNull("The expected platform container path must be specified.", expectedPlatformContainerPath);
- }
-
-
- public void testGetFileString() {
- IVirtualFile testFile1txt = targetVirtualContainer.getFile(expectedFileName); //$NON-NLS-1$
- assertEquals("The test file project relative path must match.", expectedPlatformContainerPath.append(expectedFileName), testFile1txt.getProjectRelativePath()); //$NON-NLS-1$
- }
-
- public void testGetFilePath() {
- IVirtualFile test3jsp = targetVirtualContainer.getFile(expectedFileSingleDepthPath);
- IPath expectedPath = expectedPlatformContainerPath.append(expectedFileSingleDepthPath);
- assertEquals("The test file project relative path must match.", expectedPath, test3jsp.getProjectRelativePath()); //$NON-NLS-1$
- }
-
- /*
- * Class under test for IVirtualFolder getFolder(String)
- */
- public void testGetFolderString() {
- IVirtualFolder jspsFolder = targetVirtualContainer.getFolder(expectedFolderName);
- assertNotNull("The folder should not be null.", jspsFolder);
- assertEquals("The name of the folder returned shouled match the expected folder.", expectedFolderName, jspsFolder.getName());
- }
-
- /*
- * Class under test for IVirtualFolder getFolder(IPath)
- */
- public void testGetFolderIPath() {
- IVirtualFolder testGetFolder = targetVirtualContainer.getFolder(expectedFolderZerothDepthPath);
- assertNotNull("The folder should not be null.", testGetFolder);
- assertEquals("The name of the folder returned shouled match the expected folder.", expectedFolderZerothDepthPath, testGetFolder.getRuntimePath());
- }
-
- /*
- * Class under test for boolean exists(IPath)
- */
- public void testExistsIPath() {
- assertTrue("The expected file path should be found to exist.", targetVirtualContainer.exists(expectedFileSingleDepthPath));
- }
-
- /*
- * Class under test for IVirtualResource findMember(String)
- */
- public void testFindMemberString() {
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderName);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderName, foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileName);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileName, foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(String, int)
- */
- public void testFindMemberStringint() {
-
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderName, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderName, foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFolderName, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileName, foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(IPath)
- */
- public void testFindMemberIPath() {
-
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderSingleDepthPath);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderSingleDepthPath.lastSegment(), foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileSingleDepthPath);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileSingleDepthPath.lastSegment(), foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(IPath, int)
- */
- public void testFindMemberIPathint() {
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderSingleDepthPath, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderSingleDepthPath.lastSegment(), foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileSingleDepthPath, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileSingleDepthPath.lastSegment(), foundResource.getName());
- }
-
-
- /*
- * Class under test for IVirtualResource[] members()
- */
- public void testMembers() {
- }
-
- /*
- * Class under test for IVirtualResource[] members(int)
- */
- public void testMembersint() {
- }
-
-
- public void testCreate() {
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java
deleted file mode 100644
index bb34527..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-
-public class IVirtualFileAPITest extends IVirtualResourceAPITest {
-
- public IVirtualFileAPITest(String name) {
- super(name);
- }
-
- protected void doSetup() throws Exception {
-
-
- }
-
- /*
- * Class under test for void VirtualFile(IProject, String, IPath)
- */
- public void testVirtualFileIProjectStringIPath() {
-
- }
-
-
- public void testGetUnderlyingFile() {
-
- IFile platformFileToCreate = ((IVirtualFile)targetVirtualResourceToCreate).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !platformFileToCreate.exists() );
-
- IFile existingPlatformFile = ((IVirtualFile)targetExistingVirtualResource).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !existingPlatformFile.exists() );
-
- }
-
- public void testGetUnderlyingFiles() {
-
- IResource[] platformFileToCreate = ((IVirtualFile)targetVirtualResourceToCreate).getUnderlyingFiles();
- assertEquals("There should only be one resource in the result array.", 1, platformFileToCreate.length);
- assertEquals("The type of the underlying resource should match IResource.FILE.", IResource.FILE, platformFileToCreate[0].getType());
- assertTrue("The underyling resource should not exist.", !platformFileToCreate[0].exists() );
-
-
- IResource[] existingPlatformFile = ((IVirtualFile)targetExistingVirtualResource).getUnderlyingFiles();
- assertEquals("There should only be one resource in the result array.", 1, existingPlatformFile.length);
- assertEquals("The type of the underlying resource should match IResource.FILE.", IResource.FILE, existingPlatformFile[0].getType());
- assertTrue("The underyling resource should not exist.", !existingPlatformFile[0].exists() );
-
- IFile multiPlatformFile = ((IVirtualFile)targetMultiVirtualResource).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !multiPlatformFile.exists() );
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java
deleted file mode 100644
index 7dfab72..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualFolderAPITest extends IVirtualContainerAPITest {
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final IPath WEBCONTENT_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/"); //$NON-NLS-1$
- public static final IPath WEBINF_FOLDER_REAL_PATH = WEBCONTENT_FOLDER_REAL_PATH.append(TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final IPath WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final IPath TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final IPath TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- private static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- public IVirtualFolderAPITest(String name) {
- super(name);
- }
-
- protected void doSetup() throws Exception {
-
- expectedPlatformContainerPath = TESTDATA_FOLDER_REAL_PATH;
-
- expectedRuntimePath = WEBINF_FOLDER_RUNTIME_PATH;
- expectedName = TEST_FOLDER_NAME;
- expectedProject = TestWorkspace.TEST_PROJECT;
-
- targetExistingPlatformResource = TestWorkspace.TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- //virtualParent = ComponentCore.createComponent(TestWorkspace.TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.TEST_PROJECT);
- IVirtualFolder rootFolder = component.getRootFolder();
- virtualParent = rootFolder;
-
- targetExistingVirtualResource = virtualParent.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- targetVirtualContainer = virtualParent.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- targetPlatformContainer = TestWorkspace.TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- targetVirtualResourceToDelete = virtualParent.getFolder(DELETEME_PATH);
- targetVirtualResourceToDelete.create(IVirtualResource.FORCE, null);
-
- targetPlatformResourceToDelete = expectedProject.getFolder(targetVirtualResourceToDelete.getProjectRelativePath());
-
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(targetPlatformResourceToDelete.exists())
- targetPlatformResourceToDelete.delete(IVirtualResource.FORCE, null);
- }
-
-
- public void testGetUnderlyingFolder() {
- IContainer underlyingResource = ((IVirtualFolder)targetExistingVirtualResource).getUnderlyingFolder();
- IContainer expectedPlatformResource = TestWorkspace.TEST_PROJECT.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
- assertEquals("The underlying resource should be " +expectedPlatformResource.getProjectRelativePath(), expectedPlatformResource, underlyingResource); //$NON-NLS-1$
- }
-
- public void testGetUnderlyingFolders() {
-
- IContainer[] underlyingResources = ((IVirtualFolder)targetVirtualContainer).getUnderlyingFolders();
- assertEquals("There should be two folders mapped to root", 2, underlyingResources.length); //$NON-NLS-1$
-
- Set underlyingResourcesSet = new HashSet(Arrays.asList(underlyingResources));
- Set expectedUnderlyingResourcesSet = new HashSet();
- expectedUnderlyingResourcesSet.add(TestWorkspace.TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH));
- expectedUnderlyingResourcesSet.add(TestWorkspace.TEST_PROJECT.getFolder(WEBCONTENT_FOLDER_REAL_PATH));
- assertEquals("Expecting two folders mapped to root." +expectedUnderlyingResourcesSet, underlyingResourcesSet); //$NON-NLS-1$
-
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java
deleted file mode 100644
index 4c915dd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class IVirtualReferenceAPITest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- public void testCreate() {
- IVirtualReference reference = new VirtualReference();
- reference.create(0,null);
-
- }
-
- public void testSetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- reference.setRuntimePath(new Path("/"));
- }
-
- public void testGetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- IPath path = reference.getRuntimePath();
- }
-
- public void testSetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- reference.setDependencyType(dependencyType);
- }
-
- public void testGetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- dependencyType = reference.getDependencyType();
- }
-
- public void testExists() {
- IVirtualReference reference = new VirtualReference();
- boolean exists = reference.exists();
- }
-
- public void testGetEnclosingComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getEnclosingComponent();
- }
-
- public void testGetReferencedComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getReferencedComponent();
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java
deleted file mode 100644
index 72fac60..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeNode;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeRoot;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public abstract class IVirtualResourceAPITest extends TestCase {
-
- protected IVirtualContainer virtualParent;
- protected IVirtualResource targetExistingVirtualResource;
- protected IResource targetExistingPlatformResource;
-
- protected IVirtualFolder targetVirtualResourceToDelete;
- protected IResource targetPlatformResourceToDelete;
-
- protected IVirtualResource targetVirtualResourceToCreate = null;
- protected IVirtualResource targetMultiVirtualResource = null;
-
- protected IProject expectedProject;
- protected IPath expectedRuntimePath;
- protected String expectedName;
-
- private static final String PROJECT_NAME = null;
-
- public IVirtualResourceAPITest(String name) {
- super(name);
- }
-
- protected final void setUp() throws Exception {
- TestWorkspace.init();
- doSetup();
- assertRequirements();
- }
-
- protected void assertRequirements() {
-
- }
-
- protected abstract void doSetup() throws Exception ;
-
- //TODO: This test fails intermittently (Bug 175286),
- //waiting for bug 208093 to be resolved before investigating further
- public void testCreateLinkIPathintIProgressMonitor() throws Exception {
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_2_NAME);
- IVirtualFolder rootFolder = component.getRootFolder();
-
- IVirtualFolder images = rootFolder.getFolder(new Path("/images")); //$NON-NLS-1$
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- IFolder realImages = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- assertTrue("The /WebContent2/images directory must exist.", realImages.exists()); //$NON-NLS-1$
-
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.getComponent();
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- assertTrue("There should be at least one mapping for virtual path \"/images\".", componentResources.length > 0); //$NON-NLS-1$
-
- ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
- componentResources = resourceTreeRoot.findModuleResources(realImages.getFullPath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // make sure that only one component resource is created
-
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- componentResources = resourceTreeRoot.findModuleResources(realImages.getFullPath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
-
- }
-
- public void testEquals() throws Exception {
-
- }
-
- public void testExists() throws Exception {
-
- }
-
- public void testGetFileExtension() {
- assertTrue("The existing virtual resource should have no file extension.", targetExistingVirtualResource.getFileExtension() == null); //$NON-NLS-1$
- }
-
- public void testGetWorkspaceRelativePath() {
- IPath realPath = targetExistingPlatformResource.getFullPath();
- IPath virtualPath = targetExistingVirtualResource.getWorkspaceRelativePath();
- assertEquals("The workspace relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetProjectRelativePath() {
- IPath realPath = targetExistingPlatformResource.getProjectRelativePath();
- IPath virtualPath = targetExistingVirtualResource.getProjectRelativePath();
- assertEquals("The project relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
- }
-
- public void testGetRuntimePath() {
- IPath virtualPath = targetExistingVirtualResource.getRuntimePath();
- assertEquals("The runtime path of the virtual resource must match the real resource", expectedRuntimePath, virtualPath); //$NON-NLS-1$
- }
-
-
- public void testGetName() {
- assertEquals("The name of the virtual resource must match the expected name.", expectedName, targetExistingVirtualResource.getName()); //$NON-NLS-1$
- }
-
- public void testGetParent() {
- assertEquals("The parent of the virtual resource must match the component.", virtualParent, targetExistingVirtualResource.getParent()); //$NON-NLS-1$
- }
-
- public void testGetProject() {
- assertEquals("The project of the virtual resource must match the test project.", expectedProject, targetExistingVirtualResource.getProject()); //$NON-NLS-1$
- }
-
- public void testGetType() {
- assertEquals("The type of the virtual resource must match the test project.", IResource.FOLDER, targetExistingVirtualResource.getType()); //$NON-NLS-1$
- }
-
- public void testGetComponent() {
- assertEquals("The component name of the virtual resource must match the test project.", TestWorkspace.WEB_MODULE_1_NAME, targetExistingVirtualResource.getComponent().getName()); //$NON-NLS-1$
- }
-
- public void testIsAccessible() {
- assertEquals("The platform resource should be accessible only if the virtual resource is accessible.", targetExistingPlatformResource.isAccessible(), targetExistingPlatformResource.isAccessible()); //$NON-NLS-1$
- }
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor() throws Exception {
- targetVirtualResourceToDelete.delete(0, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = virtualParent.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(targetVirtualResourceToDelete.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor2() throws Exception {
- targetVirtualResourceToDelete.delete(IVirtualResource.IGNORE_UNDERLYING_RESOURCE, null);
-
- assertTrue("The real resource should not be deleted when IVirtualResource.IGNORE_UNDERLYING_RESOURCE is supplied.", targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- // only handles explicit mappings
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(expectedProject);
- WorkbenchComponent wbComponent = moduleCore.getComponent();
- ComponentResource[] resources = wbComponent.findResourcesByRuntimePath(targetVirtualResourceToDelete.getRuntimePath());
- assertTrue("There should be no matching resources found in the model.", resources.length == 0); //$NON-NLS-1$
-
- } finally {
- if (moduleCore != null) {
- moduleCore.saveIfNecessary(null);
- moduleCore.dispose();
- }
- }
- }
-
- /*
- * Class under test for void delete(boolean, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor3() throws Exception {
- targetVirtualResourceToDelete.delete(IVirtualResource.FORCE, null);
-
- assertTrue("The real resource should be deleted when IVirtualResource.IGNORE_UNDERLYING_RESOURCE is NOT supplied.", !targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = virtualParent.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(targetVirtualResourceToDelete.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }
-
-
- public void testGetUnderlyingResource() {
- IResource platformResourceToCreate = targetVirtualResourceToCreate.getUnderlyingResource();
- int expectedType = determineExpectedType(targetVirtualResourceToCreate);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, platformResourceToCreate.getType());
- assertTrue("The underyling resource should not exist.", !platformResourceToCreate.exists() );
-
- expectedType = determineExpectedType(targetExistingVirtualResource);
- IResource exitingPlatformResource = targetExistingVirtualResource.getUnderlyingResource();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, exitingPlatformResource.getType());
- assertTrue("The underyling resource should exist.", exitingPlatformResource.exists() );
-
-
- expectedType = determineExpectedType(targetMultiVirtualResource);
- IResource multiPlatformResource = targetMultiVirtualResource.getUnderlyingResource();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, multiPlatformResource.getType());
- assertTrue("The underyling resource should exist.", multiPlatformResource.exists() );
-
- }
-
- public void testGetUnderlyingResources() {
-
- int expectedType = determineExpectedType(targetVirtualResourceToCreate);
- IResource[] platformResourcesToCreate = targetVirtualResourceToCreate.getUnderlyingResources();
- assertEquals("There should only be one resource in the result array.", 1, platformResourcesToCreate.length);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, platformResourcesToCreate[0].getType());
- assertTrue("The underyling resource should not exist.", !platformResourcesToCreate[0].exists() );
-
- expectedType = determineExpectedType(targetExistingVirtualResource);
- IResource[] existingPlatformResource = targetExistingVirtualResource.getUnderlyingResources();
- assertEquals("There should only be one resource in the result array.", 1, existingPlatformResource.length);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, existingPlatformResource[0].getType());
- assertTrue("The underyling resource should not exist.", existingPlatformResource[0].exists() );
-
-
- expectedType = determineExpectedType(targetMultiVirtualResource);
- IResource[] multiPlatformResources = targetMultiVirtualResource.getUnderlyingResources();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, multiPlatformResources[0].getType());
- assertTrue("The underyling resource should not exist.", multiPlatformResources[0].exists() );
- }
-
- private int determineExpectedType(IVirtualResource aVirtualResource) {
- switch(targetVirtualResourceToCreate.getType()) {
- case IVirtualResource.FILE:
- return IResource.FILE;
- case IVirtualResource.FOLDER:
- case IVirtualResource.COMPONENT:
- return IResource.FOLDER;
- }
- return 0;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java
deleted file mode 100644
index 8c64f28..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-
-public class StructureEditTest extends TestCase {
-
- private IResource aResource;
-
- public StructureEditTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
- aResource= TestWorkspace.TEST_PROJECT.getFile(new Path("WebModule1/testdata/TestFile1.txt"));
- }
-
- public void testFindBySourcePath() {
- IProject proj = aResource.getProject();
- StructureEdit se = null;
- List foundResources = new ArrayList();
- try {
- se = StructureEdit.getStructureEditForRead(proj);
- ComponentResource[] resources = se.findResourcesBySourcePath(aResource.getProjectRelativePath());
- assertEquals("There should be one resource found.", 1, resources.length);
-
- resources = se.findResourcesBySourcePath(aResource.getFullPath());
- assertEquals("There should be one resource found.", 1, resources.length);
- }
- catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
- finally {
- se.dispose();
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java
deleted file mode 100644
index e42e542..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.componentcore.virtualpath.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class TestWorkspace {
-
- public static final String PROJECT_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_1_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_2_NAME = "WebModule2"; //$NON-NLS-1$
-
- public static final String NEW_WEB_MODULE_NAME = "TestVirtualAPI"; //$NON-NLS-1$
-
-
- public static final String META_INF = "META-INF"; //$NON-NLS-1$
- public static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static Path zipFilePath = new Path("testData/TestVirtualAPI.zip");
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String[] MODULE_NAMES = new String[]{"WebModule1", "WebModule2"};
-
-
- public static IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public static void init() {
-
- try {
- IProject project = getTargetProject();
- if (project.exists())
- project.delete(true, true, null);
- createProject();
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public static boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java
deleted file mode 100644
index 299090b..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.Set;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class A extends AbstractDataModelProvider {
- public static final String P = "A.P";
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(P);
- return propertyNames;
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java
deleted file mode 100644
index 9b785a0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.Set;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class B extends AbstractDataModelProvider {
- public static final String P = "B.P";
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(P);
- return propertyNames;
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java
deleted file mode 100644
index 8c9bff3..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.Set;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class C extends AbstractDataModelProvider {
- public static final String P = "C.P";
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(P);
- return propertyNames;
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java
deleted file mode 100644
index 75cab7d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.frameworks.datamodel.tests.extended.ExtendedOperationTests;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class DataModelAPITests extends TestSuite {
-
- public static Test suite() {
- return new DataModelAPITests();
- }
-
- public DataModelAPITests() {
- super();
- addTest(new SimpleTestSuite(EventTest.class));
- addTest(new SimpleTestSuite(NestingTest.class));
- addTest(new SimpleTestSuite(NestedListeningTest.class));
- addTest(new SimpleTestSuite(SimpleDataModelTest.class));
- addTest(new SimpleTestSuite(DataModelFactoryTest.class));
- addTest(new SimpleTestSuite(DataModelEnablementTest.class));
- addTest(new SimpleTestSuite(TestAbstractDMProvider.class));
- addTest(new SimpleTestSuite(ValidationTest.class));
- addTest(new SimpleTestSuite(ExtendedOperationTests.class));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java
deleted file mode 100644
index 36777cd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.enablement.DataModelEnablementFactory;
-
-public class DataModelEnablementTest extends TestCase {
-
- public void testValidExtensionIDAndProviderType() throws Exception {
- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- if (proj == null) {
- proj.create(null);
- }
- IDataModel dataModel = DataModelEnablementFactory.createDataModel("testProviderBase", proj);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionIDImplementorForProviderType() throws Exception{
- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- if (proj == null) {
- proj.create(null);
- }
- IDataModel dataModel = DataModelEnablementFactory.createDataModel("testProviderBogus", proj);
- assertTrue(dataModel == null);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java
deleted file mode 100644
index c580f00..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class DataModelFactoryTest extends TestCase {
-
-
- public void testBogusExtension() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel("bogus");
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testInvalidExtensionID() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel("badID");
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testInvalidExtensionClass() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel(Object.class);
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testValidExtensionIDAndProviderType() {
- String[] descs = DataModelFactory.getDataModelProviderIDsForKind("testProviderBase");
- IDataModel dataModel = DataModelFactory.createDataModel(descs[0]);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionID() {
- IDataModel dataModel = DataModelFactory.createDataModel("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel");
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionClass() {
- IDataModel dataModel = DataModelFactory.createDataModel(ITestDataModel.class);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionInstance() {
- IDataModel dataModel = DataModelFactory.createDataModel(new TestDataModelProvider());
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java
deleted file mode 100644
index b983871..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EventTest extends TestCase {
-
- public void testEventCreation() {
- IDataModel dm = DataModelFactory.createDataModel(new A());
- dm.setProperty(A.P, "aaa");
- DataModelEvent event = new DataModelEvent(dm, A.P, DataModelEvent.VALUE_CHG);
- assertEquals(dm, event.getDataModel());
- assertEquals(A.P, event.getPropertyName());
- assertEquals("aaa", event.getProperty());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- dm.setProperty(A.P, "bbb");
- assertEquals("bbb", event.getProperty());
- event = new DataModelEvent(dm, A.P, DataModelEvent.ENABLE_CHG);
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertEquals(dm.isPropertyEnabled(A.P), event.isPropertyEnabled());
- event = new DataModelEvent(dm, A.P, DataModelEvent.VALID_VALUES_CHG);
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloOperationExtension.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloOperationExtension.java
deleted file mode 100644
index b3d987a..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloOperationExtension.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-
-public class HelloOperationExtension extends AbstractDataModelOperation {
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println(getClass().getName() + " execute"); //$NON-NLS-1$
- return OK_STATUS;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println(getClass().getName() + " redo"); //$NON-NLS-1$
- return OK_STATUS;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- System.out.println(getClass().getName() + " undo"); //$NON-NLS-1$
- return OK_STATUS;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPostOperationExtension.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPostOperationExtension.java
deleted file mode 100644
index 4f34909..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPostOperationExtension.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-public class HelloPostOperationExtension extends HelloOperationExtension {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPreOperationExtension.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPreOperationExtension.java
deleted file mode 100644
index f3f3c84..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/HelloPreOperationExtension.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-public class HelloPreOperationExtension extends HelloOperationExtension {
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java
deleted file mode 100644
index 6580f2d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-public interface ITestDataModel {
-
- public static final String FOO = "ITestDataModel.FOO";
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java
deleted file mode 100644
index 12174e4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NestedListeningTest extends TestCase {
-
- public void testListeners1() {
- TestListener aL = new TestListener();
- TestListener bL = new TestListener();
- TestListener cL = new TestListener();
-
- IDataModel a = DataModelFactory.createDataModel(new A());
- IDataModel b = DataModelFactory.createDataModel(new B());
- IDataModel c = DataModelFactory.createDataModel(new C());
- a.addListener(aL);
- b.addListener(bL);
- c.addListener(cL);
-
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, "a");
- b.setProperty(B.P, "b");
- c.setProperty(C.P, "c");
- List aEvents = aL.getEvents();
- List bEvents = bL.getEvents();
- List cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- DataModelEvent aEvent = (DataModelEvent) aEvents.get(i);
- DataModelEvent bEvent = (DataModelEvent) bEvents.get(i);
- DataModelEvent cEvent = (DataModelEvent) cEvents.get(i);
-
- IDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, A.P);
- assertEquals(property, "a");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, B.P);
- assertEquals(property, "b");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, C.P);
- assertEquals(property, "c");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- }
- }
-
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, null);
- b.setProperty(B.P, null);
- c.setProperty(C.P, null);
- aEvents = aL.getEvents();
- bEvents = bL.getEvents();
- cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- DataModelEvent aEvent = (DataModelEvent) aEvents.get(i);
- DataModelEvent bEvent = (DataModelEvent) bEvents.get(i);
- DataModelEvent cEvent = (DataModelEvent) cEvents.get(i);
-
- IDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, A.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, B.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, C.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java
deleted file mode 100644
index 57519e5..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.Collection;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class NestingTest extends TestCase {
-
- private IDataModel a;
- private IDataModel b;
- private IDataModel c;
-
- protected void setUp() throws Exception {
- super.setUp();
- a = DataModelFactory.createDataModel(new A());
- b = DataModelFactory.createDataModel(new B());
- c = DataModelFactory.createDataModel(new C());
- }
-
- protected void tearDown() throws Exception {
- if (null != a) {
- a.dispose();
- a = null;
- }
- if (null != b) {
- b.dispose();
- b = null;
- }
-
- if (null != c) {
- c.dispose();
- c = null;
- }
- }
-
- public void testInvalidNestedModel() {
- String NESTED_MODEL_NOT_LOCATED = WTPResourceHandler.getString("21"); //$NON-NLS-1$
- Exception ex = null;
- try {
- a.getNestedModel("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
- ex = null;
- try {
- a.getNestedModel(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
-
- a.addNestedModel("b", b);
- ex = null;
- try {
- a.getNestedModel(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
-
- }
-
- public void testIsNestedModel() {
- Assert.assertFalse(a.isNestedModel(""));
- Assert.assertFalse(a.isNestedModel(null));
- a.addNestedModel("b", b);
- Assert.assertTrue(a.isNestedModel("b"));
- Assert.assertFalse(a.isNestedModel("c"));
- a.addNestedModel("c", c);
- Assert.assertTrue(a.isNestedModel("c"));
- }
-
- public void testRemoveNonExistentModels() {
- Assert.assertNull(a.removeNestedModel("a"));
- Assert.assertNull(a.removeNestedModel(null));
- }
-
- public void testGetNestedAndGetNesting() {
- Assert.assertEquals(0, a.getNestedModels().size());
- Assert.assertEquals(0, b.getNestingModels().size());
-
- Assert.assertTrue(a.addNestedModel("b", b));
- Assert.assertEquals(1, a.getNestedModels().size());
- Assert.assertTrue(a.getNestedModels().contains(b));
- Assert.assertEquals(b, a.getNestedModel("b"));
- Assert.assertEquals(1, b.getNestingModels().size());
- Assert.assertTrue(b.getNestingModels().contains(a));
-
- Assert.assertTrue(a.addNestedModel("c", c));
- Assert.assertEquals(2, a.getNestedModels().size());
- Assert.assertTrue(a.getNestedModels().contains(c));
- Assert.assertEquals(c, a.getNestedModel("c"));
- Assert.assertEquals(1, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(a));
-
- Assert.assertTrue(b.addNestedModel("c", c));
- Assert.assertEquals(1, b.getNestedModels().size());
- Assert.assertTrue(b.getNestedModels().contains(c));
- Assert.assertEquals(2, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(b));
-
- Assert.assertEquals(b, a.removeNestedModel("b"));
- Assert.assertEquals(1, a.getNestedModels().size());
- Assert.assertEquals(0, b.getNestingModels().size());
-
- Assert.assertEquals(c, a.removeNestedModel("c"));
- Assert.assertEquals(0, a.getNestedModels().size());
- Assert.assertEquals(1, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(b));
-
- Assert.assertEquals(c, b.removeNestedModel("c"));
- Assert.assertEquals(0, b.getNestedModels().size());
- Assert.assertEquals(0, c.getNestingModels().size());
- }
-
- public void testSelfNest() {
- Assert.assertFalse(a.addNestedModel("a", a));
- Assert.assertEquals(0, a.getNestedModels().size());
- }
-
- public void testDuplicateNest() {
- Assert.assertTrue(a.addNestedModel("b1", b));
- Assert.assertEquals(b, a.getNestedModel("b1"));
- Assert.assertFalse(a.addNestedModel("b2", b));
- Assert.assertEquals(b, a.getNestedModel("b1"));
- Assert.assertFalse(a.isNestedModel("b2"));
- }
-
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | A | A | A | A
- * B | | B | B | B | B
- * C | | C
- * </code>
- */
- public void testIsPropertySimpleNesting0() {
- a.addNestedModel("b", b); // 1
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
-
- a.removeNestedModel("b"); // 2
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isNestedProperty(B.P));
-
- a.addNestedModel("b", b); // 3
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
-
- b.addNestedModel("c", c); // 4
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
-
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(a.isNestedProperty(C.P));
-
- b.addNestedModel("c", c); // 6
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * B | B | B |
- * C | |
- * </code>
- */
- public void testIsPropertySimpleNesting1() {
- a.addNestedModel("b", b); // 1
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- Collection nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- Collection baseProperties = a.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- Collection nestedProperties = a.getNestedProperties();
- Assert.assertEquals(3, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- Collection allProperties = a.getAllProperties();
- Assert.assertEquals(4, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
-
-
- b.addNestedModel("c", c); // 2
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
- Assert.assertFalse(b.isBaseProperty(C.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(b.isNestedProperty(C.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(4, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- Assert.assertTrue(nestedProperties.contains(C.P));
- allProperties = a.getAllProperties();
- Assert.assertEquals(5, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
- Assert.assertTrue(allProperties.contains(C.P));
- // check b's nested
- Assert.assertTrue(c == b.getNestedModel("c"));
- nestedModelNames = b.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("c"));
- baseProperties = b.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(B.P));
- nestedProperties = b.getNestedProperties();
- Assert.assertEquals(3, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(C.P));
- allProperties = b.getAllProperties();
- Assert.assertEquals(4, allProperties.size());
- Assert.assertTrue(allProperties.contains(B.P));
- Assert.assertTrue(allProperties.contains(C.P));
-
- b.removeNestedModel("c"); // 3
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(a.isNestedProperty(C.P));
- Assert.assertFalse(b.isBaseProperty(C.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(b.isNestedProperty(C.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(3, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- allProperties = a.getAllProperties();
- Assert.assertEquals(4, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
- // check b's nested
- nestedModelNames = b.getNestedModelNames();
- Assert.assertEquals(0, nestedModelNames.size());
- baseProperties = b.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(B.P));
- nestedProperties = b.getNestedProperties();
- Assert.assertEquals(2, nestedProperties.size());
- allProperties = b.getAllProperties();
- Assert.assertEquals(3, allProperties.size());
- Assert.assertTrue(allProperties.contains(B.P));
-
- a.removeNestedModel("b"); // 4
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isNestedProperty(B.P));
- // check a's nested
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(0, nestedModelNames.size());
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(3, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(2, nestedProperties.size());
- allProperties = a.getAllProperties();
- Assert.assertEquals(3, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * | B | |
- * B | C | B | B
- * C | | C |
- * | | C
- * </code>
- */
- public void testIsPropertySimpleNesting2() {
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(b.isProperty(C.P));
-
- a.addNestedModel("b", b); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
-
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
-
- b.removeNestedModel("c"); // 4
- Assert.assertFalse(b.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5
- * A | A | A | A | A
- * B | B | B | B | B
- * C | C | C |
- * | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting1() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- IDataModel c2 = DataModelFactory.createDataModel(new C());
- b.addNestedModel("c2", c2); // 3
- b.removeNestedModel("c2"); // 4
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6 7
- * A | A | A | A | A | A | A
- * B | B | B | B | B | B | B
- * C | C | C | C | C2 |
- * C2 | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting2() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- IDataModel c2 = DataModelFactory.createDataModel(new C());
- a.addNestedModel("c2", c2); // 3
- a.removeNestedModel("c2"); // 4
- Assert.assertTrue(a.isProperty(C.P));
- b.addNestedModel("c2", c2); // 5
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 6
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c2"); // 7
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | B | A | C | A
- * B | B | C | B | A | B
- * C | C | A | C | B | C
- * A (loop) | | A(loop)
- * </code>
- */
- public void testIsPropertyComplexNesting3() {
- a.addNestedModel("b", b);
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.addNestedModel("a", a); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.addNestedModel("b", b); // 4
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- b.removeNestedModel("c"); // 5
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.removeNestedModel("a");
- a.removeNestedModel("b");
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- }
-
- public void testSetGetProperty1() {
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
-
- a.setProperty(A.P, "a");
- a.setProperty(B.P, "b");
- a.setProperty(C.P, "c");
- assertEquals("a", a.getProperty(A.P));
- assertEquals("a", b.getProperty(A.P));
- assertEquals("a", c.getProperty(A.P));
- assertEquals("b", a.getProperty(B.P));
- assertEquals("b", b.getProperty(B.P));
- assertEquals("b", c.getProperty(B.P));
- assertEquals("c", a.getProperty(C.P));
- assertEquals("c", b.getProperty(C.P));
- assertEquals("c", c.getProperty(C.P));
-
- b.setProperty(A.P, "aa");
- b.setProperty(B.P, "bb");
- b.setProperty(C.P, "cc");
- assertEquals("aa", a.getProperty(A.P));
- assertEquals("aa", b.getProperty(A.P));
- assertEquals("aa", c.getProperty(A.P));
- assertEquals("bb", a.getProperty(B.P));
- assertEquals("bb", b.getProperty(B.P));
- assertEquals("bb", c.getProperty(B.P));
- assertEquals("cc", a.getProperty(C.P));
- assertEquals("cc", b.getProperty(C.P));
- assertEquals("cc", c.getProperty(C.P));
-
- c.setProperty(A.P, "aaa");
- c.setProperty(B.P, "bbb");
- c.setProperty(C.P, "ccc");
- assertEquals("aaa", a.getProperty(A.P));
- assertEquals("aaa", b.getProperty(A.P));
- assertEquals("aaa", c.getProperty(A.P));
- assertEquals("bbb", a.getProperty(B.P));
- assertEquals("bbb", b.getProperty(B.P));
- assertEquals("bbb", c.getProperty(B.P));
- assertEquals("ccc", a.getProperty(C.P));
- assertEquals("ccc", b.getProperty(C.P));
- assertEquals("ccc", c.getProperty(C.P));
- }
-
-
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java
deleted file mode 100644
index 318207a..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java
+++ /dev/null
@@ -1,438 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-
-
-public class SimpleDataModelTest extends TestCase {
-
- private class DMProvider extends AbstractDataModelProvider {
- public static final String INT_PROP = "INT_PROP";
- public static final String INT_PROP2 = "INT_PROP2";
- public static final String INT_PROP3 = "INT_PROP3";
- public static final String INT_PROP4 = "INT_PROP4";
- public static final String BOOLEAN_PROP = "BOOLEAN_PROP";
- public static final String BOOLEAN_PROP2 = "BOOLEAN_PROP2";
- public static final String STRING_PROP = "STRING_PROP";
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(INT_PROP);
- propertyNames.add(INT_PROP2);
- propertyNames.add(INT_PROP3);
- propertyNames.add(INT_PROP4);
- propertyNames.add(BOOLEAN_PROP);
- propertyNames.add(BOOLEAN_PROP2);
- propertyNames.add(STRING_PROP);
- return propertyNames;
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(INT_PROP)) {
- return new Integer(10);
- } else if (propertyName.equals(INT_PROP2)) {
- return getProperty(INT_PROP);
- } else if (propertyName.equals(BOOLEAN_PROP)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(STRING_PROP)) {
- return "foo" + getProperty(INT_PROP) + getProperty(BOOLEAN_PROP);
- }
- return super.getDefaultProperty(propertyName);
- }
-
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(BOOLEAN_PROP2)) {
- return getBooleanProperty(BOOLEAN_PROP);
- }
- return true;
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- if (propertyName.equals(INT_PROP)) {
- model.notifyPropertyChange(INT_PROP2, IDataModel.VALUE_CHG);
- model.notifyPropertyChange(INT_PROP2, IDataModel.VALID_VALUES_CHG);
- model.notifyPropertyChange(STRING_PROP, IDataModel.DEFAULT_CHG);
- }
- if (propertyName.equals(BOOLEAN_PROP)) {
- model.notifyPropertyChange(BOOLEAN_PROP2, IDataModel.ENABLE_CHG);
- model.notifyPropertyChange(STRING_PROP, IDataModel.DEFAULT_CHG);
- }
- return true;
- }
-
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (INT_PROP2.equals(propertyName)) {
- int range = getIntProperty(INT_PROP);
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- return DataModelPropertyDescriptor.createDescriptors(ints);
- }
- if (INT_PROP3.equals(propertyName)) {
- int range = 3;
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- String[] descriptions = new String[]{"one", "two", "three"};
- return DataModelPropertyDescriptor.createDescriptors(ints, descriptions);
- }
- if (INT_PROP4.equals(propertyName)) {
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[3];
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new DataModelPropertyDescriptor(new Integer(i + 1), descriptions[i]);
- }
- return descriptors;
- }
- return null;
- }
-
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- Object property = getProperty(propertyName);
- if (INT_PROP2.equals(propertyName)) {
- return new DataModelPropertyDescriptor(property);
- } else if (INT_PROP3.equals(propertyName) || INT_PROP4.equals(propertyName)) {
- String[] descriptions = new String[]{"one", "two", "three"};
- int value = ((Integer) property).intValue();
- return new DataModelPropertyDescriptor(property, descriptions[value - 1]);
- }
- return null;
- }
-
-
- public String getID() {
- return id;
- }
-
- public List getExtendedContext() {
- return extendedContext;
- }
-
- }
-
- private String id;
- private List extendedContext;
-
- private IDataModel dm;
- private TestListener dmL;
-
- protected void setUp() throws Exception {
- super.setUp();
- dm = DataModelFactory.createDataModel(new DMProvider());
- dmL = new TestListener();
- dm.addListener(dmL);
- }
-
- public void testBasics() {
- id = null;
- assertEquals("", dm.getID());
- id = "foo";
- assertEquals("foo", dm.getID());
- extendedContext = null;
- assertNotNull(dm.getExtendedContext());
- extendedContext = new ArrayList();
- assertTrue(dm.getExtendedContext() == extendedContext);
- extendedContext.add("foo");
- assertTrue(dm.getExtendedContext() == extendedContext);
- assertNotNull(dm.getDefaultOperation());
- }
-
- public void testInvalidProperty() {
- String PROPERTY_NOT_LOCATED_ = WTPResourceHandler.getString("20"); //$NON-NLS-1$
- Exception ex = null;
- try {
- dm.getProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- try {
- dm.getIntProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- ex = null;
- try {
- dm.getBooleanProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- ex = null;
- try {
- dm.getStringProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- try {
- dm.getStringProperty(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
-
- }
-
- public void testPropertyDescriptors() {
- DataModelPropertyDescriptor[] descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP2);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals("" + value, descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP3);
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP4);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- for (int i = 1; i < 4; i++) {
- dm.setIntProperty(DMProvider.INT_PROP2, i);
- DataModelPropertyDescriptor descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP2);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP2));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP2));
- assertTrue(descriptor.getPropertyDescription().equals(Integer.toString(i)));
-
- dm.setIntProperty(DMProvider.INT_PROP3, i);
- descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP3);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP3));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP3));
- assertTrue(descriptor.getPropertyDescription().equals(descriptions[i - 1]));
-
- dm.setIntProperty(DMProvider.INT_PROP4, i);
- descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP4);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP4));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP4));
- assertTrue(descriptor.getPropertyDescription().equals(descriptions[i - 1]));
- }
- }
-
-
- public void testDefaults() {
- assertEquals(true, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
- assertEquals(true, ((Boolean) dm.getProperty(DMProvider.BOOLEAN_PROP)).booleanValue());
- assertEquals(10, dm.getIntProperty(DMProvider.INT_PROP));
- assertEquals(10, ((Integer) dm.getProperty(DMProvider.INT_PROP)).intValue());
- assertEquals("foo10true", (String) dm.getProperty(DMProvider.STRING_PROP));
- assertEquals("foo10true", dm.getStringProperty(DMProvider.STRING_PROP));
- }
-
- public void testPropertyChangedOnListener() {
- dmL.clearEvents();
- DataModelEvent event = new DataModelEvent(dm, A.P, DataModelEvent.VALUE_CHG);
- dmL.propertyChanged(event);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- assertTrue(events.contains(event));
-
- dmL.clearEvents();
- IDataModelListener idml = dmL;
- idml.propertyChanged(event);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- assertTrue(events.contains(event));
-
- }
-
- public void testAddRemoveListener() {
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
-
- dmL.clearEvents();
- dm.removeListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(0, events.size());
-
- dmL.clearEvents();
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(1, events.size());
-
- dmL.clearEvents();
- dm.removeListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(0, events.size());
- }
-
- public void testFiringEvents() {
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
-
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.VALID_VALUES_CHG);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-
- public void testSimpleSetEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 100);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(100, dm.getIntProperty(DMProvider.INT_PROP2));
-
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 100);
- events = dmL.getEvents();
- assertEquals(0, events.size());
-
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 101);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- }
-
- public void testComplexEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP, 11);
- List events = dmL.getEvents();
- assertEquals(4, events.size());
-
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DMProvider.INT_PROP2)).intValue());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- DataModelPropertyDescriptor[] descriptors = event.getValidPropertyDescriptors();
- DataModelPropertyDescriptor[] descriptors2 = dm.getValidPropertyDescriptors(DMProvider.INT_PROP2);
- assertEquals(11, descriptors.length);
- assertEquals(11, descriptors2.length);
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11true", event.getProperty());
- assertEquals("foo11true", dm.getDefaultProperty(DMProvider.STRING_PROP));
- assertEquals("foo11true", dm.getProperty(DMProvider.STRING_PROP));
-
- event = (DataModelEvent) events.get(3);
- assertEquals(DMProvider.INT_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DMProvider.INT_PROP)).intValue());
-
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isPropertyEnabled(DMProvider.BOOLEAN_PROP2));
- assertFalse(event.isPropertyEnabled());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
- assertEquals("foo11false", dm.getDefaultProperty(DMProvider.STRING_PROP));
- assertEquals("foo11false", dm.getProperty(DMProvider.STRING_PROP));
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
-
- dm.setStringProperty(DMProvider.STRING_PROP, "bar");
- assertEquals("bar", dm.getStringProperty(DMProvider.STRING_PROP));
- assertEquals("foo11false", dm.getDefaultProperty(DMProvider.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, true);
- events = dmL.getEvents();
- assertEquals(2, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
-
- assertEquals("bar", dm.getStringProperty(DMProvider.STRING_PROP));
- dm.setStringProperty(DMProvider.STRING_PROP, null);
- assertEquals("foo11true", dm.getStringProperty(DMProvider.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isPropertyEnabled(DMProvider.BOOLEAN_PROP2));
- assertFalse(event.isPropertyEnabled());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java
deleted file mode 100644
index 8da5440..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-public class TestAbstractDMProvider extends TestCase {
-
- private static final String INTEGER = "INTEGER";
- private static final String BOOLEAN = "BOOLEAN";
- private static final String STRING = "STRING";
- private static final String OBJECT = "OBJECT";
-
- private class DMOp extends AbstractDataModelOperation {
-
- public DMOp() {
- super();
- }
-
- public DMOp(IDataModel model) {
- super(model);
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public void setID(String id) {
- super.setID(id);
- }
-
- public String getID() {
- return super.getID();
- }
-
- public void setDataModel(IDataModel model) {
- super.setDataModel(model);
- }
-
- public IDataModel getDataModel() {
- return super.getDataModel();
- }
- }
-
- private class DMProvider extends AbstractDataModelProvider {
-
- public Set getPropertyNames(){
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(INTEGER);
- propertyNames.add(BOOLEAN);
- propertyNames.add(STRING);
- propertyNames.add(OBJECT);
- return propertyNames;
- }
-
- public void init() {
- super.init();
- }
-
- public Object getDefaultProperty(String propertyName) {
- return super.getDefaultProperty(propertyName);
- }
-
- public boolean isPropertyEnabled(String propertyName) {
- return super.isPropertyEnabled(propertyName);
- }
-
- public IStatus validate(String name) {
- return super.validate(name);
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- return super.propertySet(propertyName, propertyValue);
- }
-
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- return super.getPropertyDescriptor(propertyName);
- }
-
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- public List getExtendedContext() {
- return super.getExtendedContext();
- }
-
- public IDataModelOperation getDefaultOperation() {
- return super.getDefaultOperation();
- }
-
- public String getID() {
- return super.getID();
- }
-
- public void dispose() {
- super.dispose();
- }
-
- public void protectedTest() {
- super.getProperty(INTEGER);
- super.setProperty(INTEGER, new Integer(1));
- super.getBooleanProperty(BOOLEAN);
- super.setBooleanProperty(BOOLEAN, true);
- super.getIntProperty(INTEGER);
- super.setIntProperty(INTEGER, 1);
- super.getStringProperty(STRING);
- super.isPropertySet(INTEGER);
- }
- }
-
- IDataModelProvider idmp = null;
- AbstractDataModelProvider dmp = null;
- IDataModel dm = null;
-
- IDataModelOperation idmo = null;
- AbstractDataModelOperation dmo = null;
-
- protected void setUp() throws Exception {
- super.setUp();
- dmp = new DMProvider();
- idmp = dmp;
- dm = DataModelFactory.createDataModel(dmp);
- }
-
- public void testAbstractDataModelProvider() {
- dmp.setDataModel(dm);
- assertTrue(dm == dmp.getDataModel());
- assertNotNull(dmp.getPropertyNames());
- dmp.init();
- assertNull(dmp.getDefaultProperty(INTEGER));
- assertTrue(dmp.isPropertyEnabled(INTEGER));
- assertNull(dmp.validate(INTEGER));
- assertTrue(dmp.propertySet(INTEGER, new Integer(1)));
- assertNull(dmp.getPropertyDescriptor(INTEGER));
- assertNull(dmp.getValidPropertyDescriptors(INTEGER));
- assertNull(dmp.getExtendedContext());
- assertNull(dmp.getDefaultOperation());
- assertTrue(dmp.getID().equals(dmp.getClass().getName()));
- ((DMProvider) dmp).protectedTest();
- dmp.dispose();
- }
-
- public void testIDataModelProvider() {
- idmp.setDataModel(dm);
- assertTrue(dm == idmp.getDataModel());
- assertNotNull(idmp.getPropertyNames());
- idmp.init();
- assertNull(idmp.getDefaultProperty(INTEGER));
- assertTrue(idmp.isPropertyEnabled(INTEGER));
- assertNull(idmp.validate(INTEGER));
- assertTrue(idmp.propertySet(INTEGER, new Integer(1)));
- assertNull(idmp.getPropertyDescriptor(INTEGER));
- assertNull(idmp.getValidPropertyDescriptors(INTEGER));
- assertNull(idmp.getExtendedContext());
- assertNull(idmp.getDefaultOperation());
- assertTrue(idmp.getID().equals(idmp.getClass().getName()));
- idmp.dispose();
- }
-
- public void testAbstractDataModelOperation() {
- dmo = new DMOp();
- dmo = new DMOp(dm);
- idmo = dmo;
- dmo.setID("foo");
- assertTrue(dmo.getID().equals("foo"));
- dmo.setDataModel(dm);
- assertTrue(dm == dmo.getDataModel());
- }
-
- public void testIDataModelOperation() {
- dmo = new DMOp();
- idmo = dmo;
- idmo.setID("foo");
- assertTrue(idmo.getID().equals("foo"));
- idmo.setDataModel(dm);
- assertTrue(dm == idmo.getDataModel());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java
deleted file mode 100644
index 6123f90..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.Set;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class TestDataModelProvider extends AbstractDataModelProvider implements ITestDataModel {
-
- private static int instanceCount = 0;
-
- public static int getInstanceCount() {
- return instanceCount;
- }
-
-
- public TestDataModelProvider() {
- super();
- instanceCount++;
- }
-
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(ITestDataModel.FOO);
- return propertyNames;
- }
-
- public String getID() {
- return ITestDataModel.class.getName();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java
deleted file mode 100644
index 3adeb19..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-
-public class TestListener implements IDataModelListener {
-
- private ArrayList events = new ArrayList();
-
- public void clearEvents() {
- events.clear();
- }
-
- public List getEvents() {
- return events;
- }
-
- public void propertyChanged(DataModelEvent event) {
- events.add(event);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java
deleted file mode 100644
index 8af8ab3..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ValidationTest extends TestCase {
-
- private static final String A = "A";
- private static final String B = "B";
- private static final String C = "C";
-
- private static final String[] allProperties = new String[]{A, B, C};
-
-
- private class P extends AbstractDataModelProvider {
-
-
- public Set getPropertyNames(){
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(A);
- propertyNames.add(B);
- propertyNames.add(C);
- return propertyNames;
- }
-
- public IStatus validate(String propertyName) {
- validationList.add(propertyName);
- return status;
- }
- }
-
- private IStatus errorStatus = new Status(IStatus.ERROR, CommonTestsPlugin.PLUGIN_ID, 0, "error", null);
- private IStatus okStatus = IDataModelProvider.OK_STATUS;
-
- private IStatus status;
-
- private List validationList;
-
- private IDataModel dm;
-
- protected void setUp() throws Exception {
- super.setUp();
- dm = DataModelFactory.createDataModel(new P());
- status = okStatus;
- validationList = new ArrayList();
- }
-
- public void _testBasicValidation() {
- for (int i = 0; i < 2; i++) {
- boolean ok = i == 0;
- status = ok ? okStatus : errorStatus;
-
- validationList.clear();
- assertTrue(dm.isValid() == ok);
- assertEquals(ok ? 5 : 1, validationList.size());
- assertTrue(validationList.contains(A) || validationList.contains(IDataModelProperties.ALLOW_EXTENSIONS) || validationList.contains(IDataModelProperties.RESTRICT_EXTENSIONS));
- if (ok) {
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- }
- validationList.clear();
-
- assertTrue(dm.validate().isOK() == ok);
- // TODO
- //assertEquals(ok ? 3 : 1, validationList.size());
- assertTrue(validationList.contains(A) || validationList.contains(IDataModelProperties.ALLOW_EXTENSIONS) || validationList.contains(IDataModelProperties.RESTRICT_EXTENSIONS));
- if (ok) {
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- }
- validationList.clear();
-
- assertTrue(dm.validate(true).isOK() == ok);
- assertEquals(ok ? 5 : 1, validationList.size());
- validationList.clear();
-
- assertTrue(dm.validate(false).isOK() == ok);
- assertEquals(5, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- validationList.clear();
-
- for (int j = 0; j < allProperties.length; j++) {
- assertTrue(dm.isPropertyValid(allProperties[j]) == ok);
- assertEquals(1, validationList.size());
- assertTrue(validationList.contains(allProperties[j]));
- validationList.clear();
- assertTrue(dm.validateProperty(allProperties[j]).isOK() == ok);
- assertEquals(1, validationList.size());
- assertTrue(validationList.contains(allProperties[j]));
- validationList.clear();
- }
- }
- }
-
- public void testNestedValidation() {
- dm.addNestedModel("a", DataModelFactory.createDataModel(new A()));
- dm.addNestedModel("b", DataModelFactory.createDataModel(new B()));
- dm.addNestedModel("c", DataModelFactory.createDataModel(new C()));
-
- for (int i = 0; i < 4; i++) {
- validationList.clear();
- switch (i) {
- case 0 :
- assertTrue(dm.isValid());
- break;
- case 1 :
- assertTrue(dm.validate().isOK());
- break;
- case 2 :
- assertTrue(dm.validate(true).isOK());
- break;
- case 3 :
- assertTrue(dm.validate(false).isOK());
- break;
- }
- assertEquals(8, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- assertTrue(validationList.contains("a"));
- assertTrue(validationList.contains("b"));
- assertTrue(validationList.contains("c"));
- validationList.clear();
- }
- status = errorStatus;
- for (int i = 0; i < 3; i++) {
- validationList.clear();
- switch (i) {
- case 0 :
- assertTrue(!dm.isValid());
- break;
- case 1 :
- assertTrue(!dm.validate().isOK());
- break;
- case 2 :
- assertTrue(!dm.validate(true).isOK());
- break;
- }
- // TODO
- //assertEquals(1, validationList.size());
- //assertTrue(!validationList.contains("a"));
- //assertTrue(!validationList.contains("b"));
- //assertTrue(!validationList.contains("c"));
- validationList.clear();
- }
-
- assertTrue(!dm.validate(false).isOK());
- assertEquals(8, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- assertTrue(validationList.contains("a"));
- assertTrue(validationList.contains("b"));
- assertTrue(validationList.contains("c"));
- validationList.clear();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/A.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/A.java
deleted file mode 100644
index 66820e6..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/A.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-
-public class A extends AbstractIDataModelTestOperation {
-
- public A() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/AbstractIDataModelTestOperation.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/AbstractIDataModelTestOperation.java
deleted file mode 100644
index c4e1a38..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/AbstractIDataModelTestOperation.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class AbstractIDataModelTestOperation extends AbstractDataModelOperation {
-
- public AbstractIDataModelTestOperation() {
- super();
- }
-
- public AbstractIDataModelTestOperation(IDataModel dm) {
- super(dm);
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- ExtendedOperationTests.executionList.add(getClass().getName());
- return OK_STATUS;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- ExtendedOperationTests.executionList.add(getClass().getName());
- return OK_STATUS;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- ExtendedOperationTests.executionList.add(getClass().getName());
- return OK_STATUS;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/B.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/B.java
deleted file mode 100644
index cad47a0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/B.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-
-public class B extends AbstractIDataModelTestOperation {
-
- public B() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/C.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/C.java
deleted file mode 100644
index 4751c60..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/C.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-
-public class C extends AbstractIDataModelTestOperation {
-
- public C() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/D.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/D.java
deleted file mode 100644
index 53670a5..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/D.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-public class D extends AbstractIDataModelTestOperation {
-
- public D() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/E.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/E.java
deleted file mode 100644
index 13bef73..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/E.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-public class E extends AbstractIDataModelTestOperation {
-
- public E() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/ExtendedOperationTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/ExtendedOperationTests.java
deleted file mode 100644
index 70ab857..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/ExtendedOperationTests.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IDataModelPausibleOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IDataModelPausibleOperationEvent;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IDataModelPausibleOperationListener;
-
-public class ExtendedOperationTests extends TestCase {
-
- public static List executionList = new ArrayList();
-
- public static final String a = A.class.getName();
- public static final String b = B.class.getName();
- public static final String c = C.class.getName();
- public static final String d = D.class.getName();
- public static final String e = E.class.getName();
- public static final String f = F.class.getName();
- public static final String g = G.class.getName();
- public static final String h = H.class.getName();
- public static final String r = R.class.getName();
-
- protected class PauseListener implements IDataModelPausibleOperationListener {
-
- public List pausedOperations = new ArrayList();
-
- public int notify(IDataModelPausibleOperationEvent event) {
- String opID = event.getOperation().getID();
- if (pausedOperations.contains(opID)) {
- return CONTINUE;
- }
- pausedOperations.add(opID);
- return PAUSE;
- }
- }
-
- protected PauseListener pauseListener = new PauseListener();
-
- protected void setUp() throws Exception {
- super.setUp();
- executionList.clear();
- pauseListener.pausedOperations.clear();
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("foo"); //$NON-NLS-1$
- if (!p.exists()) {
- p.create(null);
- }
- }
-
- public void testAllOn() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- String[] forwardExpectedResults = new String[]{c, a, d, r, e, b, f, g, h};
- String[] forwardExpectedPauseOrder = new String[]{r, a, c, d, b, e, f, h, g};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testAllOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- dm.setBooleanProperty(IDataModelProperties.ALLOW_EXTENSIONS, false);
- String[] forwardExpectedResults = new String[]{r};
- String[] forwardExpectedPauseOrder = new String[]{r};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testAOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{r, e, b, f, g, h};
- String[] forwardExpectedPauseOrder = new String[]{r, b, e, f, h, g};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testBOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(b);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{c, a, d, r};
- String[] forwardExpectedPauseOrder = new String[]{r, a, c, d};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testCOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{a, d, r, e, b, f, g, h};
- String[] forwardExpectedPauseOrder = new String[]{r, a, d, b, e, f, h, g};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testCFOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- restrictedList.add(f);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{a, d, r, e, b};
- String[] forwardExpectedPauseOrder = new String[]{r, a, d, b, e};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testCBOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- restrictedList.add(b);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{a, d, r};
- String[] forwardExpectedPauseOrder = new String[]{r, a, d};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testAEFOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- restrictedList.add(e);
- restrictedList.add(f);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{r, b};
- String[] forwardExpectedPauseOrder = new String[]{r, b};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- public void testABOff() throws Exception {
- IDataModel dm = DataModelFactory.createDataModel(new RootDMProvider());
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- restrictedList.add(b);
- dm.setProperty(IDataModelProperties.RESTRICT_EXTENSIONS, restrictedList);
- String[] forwardExpectedResults = new String[]{r};
- String[] forwardExpectedPauseOrder = new String[]{r};
- checkAll(dm, forwardExpectedResults, forwardExpectedPauseOrder);
- }
-
- private void checkAll(IDataModel dm, String[] forwardExpectedResults, String[] expectedPauseOrder) throws Exception {
- String[] undoExpectedResults = reverseString(forwardExpectedResults);
- boolean shouldRollBack = false;
-
- // Check regular executions
- IDataModelPausibleOperation op = (IDataModelPausibleOperation)dm.getDefaultOperation();
- checkExecution(op, forwardExpectedResults, null, shouldRollBack);
- checkUndo(op, undoExpectedResults, null);
- checkRedo(op, forwardExpectedResults, null);
- checkUndo(op, undoExpectedResults, null);
-
- // Check executions with pausing & resuming
- op = (IDataModelPausibleOperation)dm.getDefaultOperation();
- op.addOperationListener(pauseListener);
- checkExecution(op, forwardExpectedResults, expectedPauseOrder, shouldRollBack);
- checkUndo(op, undoExpectedResults, undoExpectedResults);
- checkRedo(op, forwardExpectedResults, forwardExpectedResults);
- checkUndo(op, undoExpectedResults, undoExpectedResults);
-
- // Check executions with pausing, resuming & rolling back.
- op = (IDataModelPausibleOperation)dm.getDefaultOperation();
- op.addOperationListener(pauseListener);
- shouldRollBack = true;
- checkExecution(op, forwardExpectedResults, expectedPauseOrder, shouldRollBack);
- checkUndo(op, undoExpectedResults, undoExpectedResults);
- checkRedo(op, forwardExpectedResults, forwardExpectedResults);
- checkUndo(op, undoExpectedResults, undoExpectedResults);
- }
-
- private String[] reverseString(String[] forwardString) {
- String[] reverseString = new String[forwardString.length];
- for (int i = 0; i < reverseString.length; i++) {
- reverseString[i] = forwardString[forwardString.length - i - 1];
- }
- return reverseString;
- }
-
- private void checkExecution(IDataModelPausibleOperation op, String[] expectedResults, String[] expectedPauseOrder, boolean rollback) throws Exception {
- assertEquals(IDataModelPausibleOperation.NOT_STARTED, op.getExecutionState());
- op.execute(null, null);
- if (null != expectedPauseOrder) {
- if (rollback) {
- List cachedExecutionList = new ArrayList();
- for (int i = 0; i < expectedResults.length; i++) {
- cachedExecutionList.clear();
- cachedExecutionList.addAll(executionList);
- assertEquals(IDataModelPausibleOperation.PAUSED_EXECUTE, op.getExecutionState());
- op.rollBack(null, null);
- assertEquals(IDataModelPausibleOperation.COMPLETE_ROLLBACK, op.getExecutionState());
- checkRollBackResults(cachedExecutionList, expectedResults);
- op.resume(null, null);
- }
- assertEquals(IDataModelPausibleOperation.COMPLETE_EXECUTE, op.getExecutionState());
- checkResults(expectedResults, expectedPauseOrder);
-
- pauseListener.pausedOperations.clear();
- executionList.clear();
- op.execute(null, null);
- }
- for (int i = 0; i < expectedResults.length; i++) {
- assertEquals(IDataModelPausibleOperation.PAUSED_EXECUTE, op.getExecutionState());
- op.resume(null, null);
- }
- }
- assertEquals(IDataModelPausibleOperation.COMPLETE_EXECUTE, op.getExecutionState());
- checkResults(expectedResults, expectedPauseOrder);
- executionList.clear();
- pauseListener.pausedOperations.clear();
- }
-
- private void checkUndo(IDataModelPausibleOperation op, String[] expectedResults, String[] expectedPauseOrder) throws Exception {
- if (op.getExecutionState() != IDataModelPausibleOperation.COMPLETE_EXECUTE && op.getExecutionState() != IDataModelPausibleOperation.COMPLETE_REDO) {
- fail("Operation execution state invalid " + op.getExecutionState()); //$NON-NLS-1$
- }
- op.undo(null, null);
- if (null != expectedPauseOrder) {
- for (int i = 0; i < expectedResults.length; i++) {
- assertEquals(IDataModelPausibleOperation.PAUSED_UNDO, op.getExecutionState());
- op.resume(null, null);
- }
- }
- assertEquals(IDataModelPausibleOperation.COMPLETE_UNDO, op.getExecutionState());
- checkResults(expectedResults, expectedPauseOrder);
- executionList.clear();
- pauseListener.pausedOperations.clear();
- }
-
- private void checkRedo(IDataModelPausibleOperation op, String[] expectedResults, String[] expectedPauseOrder) throws Exception {
- assertEquals(IDataModelPausibleOperation.COMPLETE_UNDO, op.getExecutionState());
- op.redo(null, null);
- if (null != expectedPauseOrder) {
- for (int i = 0; i < expectedResults.length; i++) {
- assertEquals(IDataModelPausibleOperation.PAUSED_REDO, op.getExecutionState());
- op.resume(null, null);
- }
- }
- assertEquals(IDataModelPausibleOperation.COMPLETE_REDO, op.getExecutionState());
- checkResults(expectedResults, expectedPauseOrder);
- executionList.clear();
- pauseListener.pausedOperations.clear();
- }
-
- private void checkRollBackResults(List cachedExecutionList, String [] expectedResults) {
- assertEquals(cachedExecutionList.size() * 2, executionList.size());
- for (int i = 0; i < cachedExecutionList.size(); i++) {
- assertEquals(expectedResults[i], (String)executionList.get(i));
- assertEquals((String)cachedExecutionList.get(i), (String) executionList.get(executionList.size() - 1 - i));
- }
- executionList.clear();
- }
-
- private void checkResults(String[] expectedResults, String[] expectedPauseOrder) {
- assertEquals(expectedResults.length, executionList.size());
- for (int i = 0; i < expectedResults.length; i++) {
- assertEquals(expectedResults[i], (String) executionList.get(i));
- }
- if (null == expectedPauseOrder) {
- assertEquals(0, pauseListener.pausedOperations.size());
- } else {
- assertEquals(expectedPauseOrder.length, pauseListener.pausedOperations.size());
- for (int i = 0; i < expectedPauseOrder.length; i++) {
- assertEquals(expectedPauseOrder[i], (String) pauseListener.pausedOperations.get(i));
- }
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/F.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/F.java
deleted file mode 100644
index cfb099c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/F.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-public class F extends AbstractIDataModelTestOperation {
-
- public F() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/G.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/G.java
deleted file mode 100644
index 203b608..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/G.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-public class G extends AbstractIDataModelTestOperation {
-
- public G() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/H.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/H.java
deleted file mode 100644
index 323ccdd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/H.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-public class H extends AbstractIDataModelTestOperation {
-
- public H() {
- super();
- }
-
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/R.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/R.java
deleted file mode 100644
index b71e14c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/R.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-
-public class R extends AbstractIDataModelTestOperation {
-
- public R(IDataModel dm){
- super(dm);
- }
-
- public R() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/RootDMProvider.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/RootDMProvider.java
deleted file mode 100644
index 09cc1d4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/extended/RootDMProvider.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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.common.frameworks.datamodel.tests.extended;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class RootDMProvider extends AbstractDataModelProvider {
-
- public IDataModelOperation getDefaultOperation() {
- return new R(model);
- }
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject("foo");
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java
deleted file mode 100644
index 80ee6e0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Created on Apr 1, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.tests.bvt;
-
-import java.net.URL;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.environment.tests.EnvironmentTests;
-import org.eclipse.wst.common.frameworks.artifactedit.tests.ArtifactEditAPITests;
-import org.eclipse.wst.common.frameworks.componentcore.tests.AllTests;
-import org.eclipse.wst.common.frameworks.datamodel.tests.DataModelAPITests;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class AutomatedBVT extends TestSuite {
-
- public static String baseDirectory = System.getProperty("user.dir") + java.io.File.separatorChar + "TestData" + java.io.File.separatorChar;
-
- static {
- try {
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
- AutomatedBVT.baseDirectory = Platform.asLocalURL(url).getFile() + "TestData" + java.io.File.separatorChar;
- } catch (Exception e) {
- System.err.println("Using working directory since a workspace URL could not be located.");
- }
- }
-
- public static int unimplementedMethods;
-
- public static void main(String[] args) {
- unimplementedMethods = 0;
- TestRunner.run(suite());
- if (unimplementedMethods > 0) {
- System.out.println("\nCalls to warnUnimpl: " + unimplementedMethods);
- }
- }
-
- public AutomatedBVT() {
- super();
- TestSuite suite = (TestSuite) AutomatedBVT.suite();
- for (int i = 0; i < suite.testCount(); i++) {
- addTest(suite.testAt(i));
- }
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.wst.common.test.bvt");
- suite.addTest(AllTests.suite());
- suite.addTest(DataModelAPITests.suite());
- suite.addTest(ArtifactEditAPITests.suite());
- suite.addTest(EnvironmentTests.suite());
- return suite;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java
deleted file mode 100644
index 2f1623e..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Created on Mar 25, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.tests.bvt;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class AutomatedBVTEclipse extends AutomatedBVT {
-
- public AutomatedBVTEclipse(){
- super();
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
- try {
- AutomatedBVT.baseDirectory = Platform.asLocalURL(url).getFile() + "TestData"+ java.io.File.separatorChar;
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/plugin.properties b/tests/org.eclipse.wst.common.tests/plugin.properties
deleted file mode 100644
index c09bdb9..0000000
--- a/tests/org.eclipse.wst.common.tests/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.wst.common.tests
-Bundle-Vendor.0 = Eclipse.org
-Bundle-Name.0 = org.eclipse.wst.common.tests
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/plugin.xml b/tests/org.eclipse.wst.common.tests/plugin.xml
deleted file mode 100644
index ad5432c..0000000
--- a/tests/org.eclipse.wst.common.tests/plugin.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-
- <extension-point id="DataModelVerifier" name="Data Model Verifier Factory Extension" schema="schema/dataModelVerifier.exsd"/>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class="org.eclipse.wst.common.frameworks.datamodel.tests.DataModelAPITests"
- name="IDataModel API Tests">
- </suite>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.DataModelProviderExtension">
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.operations.tests.manager.TestProvider1"
- id="testprovider1"/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.operations.tests.manager.TestProvider2"
- id="testprovider2"/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.operations.tests.manager.TestExtendedProvider"
- id="testExtendedProvider"/>
- <DataModelProvider
- class="bogusClass"
- id="bogus"/>
- <ProviderDefinesType
- providerType="testProviderBase"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <ProviderDefinesType
- providerType="testProviderBogus"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <ProviderImplementsType
- providerType="testProviderBogus"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModelBogus"/>
- <ProviderImplementsType
- providerType="testProviderBogus"
- providerID="fake.nonregistered.functiongroup.ITestDataModel"
- />
- <!-- Test for incomplete id's, classes' and duplicates
- <DataModelProvider
- class=""
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id=""/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- -->
- </extension>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class=" org.eclipse.wst.common.frameworks.tests.bvt.AutomatedBVT"
- name="Common Framework BVT Tests"/>
- </extension>
-
- <!--
- A picture of the operation tree
-
- R
- / \
- / \
- / \
- A B
- / \ / \
- / \ / \
- C D E F
- \
- H
- /
- G
- -->
-
- <extension
- point="org.eclipse.wst.common.frameworks.OperationExtension"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended">
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.R"
- postOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.B"
- preOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.A"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.A"
- postOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.D"
- preOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.C"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.B"
- postOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.F"
- preOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.E"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.F"
- postOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.H"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.H"
- preOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.extended.G"/>
- <operationExtension
- id="APre2"
- preOperationClass="org.eclipse.wst.common.frameworks.operations.tests.manager.TestExtendedOperation"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended.H"/>
- </extension>
-
-
- <!-- Uncomment the below hook to test specific operation extension ids when needed -->
- <!--
- <extension
- point="org.eclipse.wst.common.frameworks.OperationExtension"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.extended">
- <operationExtension
- id="org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentExportOperation"
- preOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.HelloPreOperationExtension"
- postOperationClass="org.eclipse.wst.common.frameworks.datamodel.tests.HelloPostOperationExtension"/>
- </extension>
- -->
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd b/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
deleted file mode 100644
index 96228a5..0000000
--- a/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.common.tests">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.tests" id="dataModelVerifier" name="Data Model Verifier Factory Extension"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="dataModelVeriferList">
- <complexType>
- <attribute name="listClass" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/tests/org.eclipse.wst.common.tests/test.xml b/tests/org.eclipse.wst.common.tests/test.xml
deleted file mode 100644
index c71e412..0000000
--- a/tests/org.eclipse.wst.common.tests/test.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.wst.common.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jst.server.jonas.432=${jonas432Dir}"/>
-
- <property name="workspace" value="${basedir}/${plugin-name}"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <delete dir="${workspace}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${workspace}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.common.frameworks.tests.bvt.AutomatedBVT"/>
- <property name="extraVMargs" value="${extraVMargs}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <delete dir="${workspace}" quiet="true"/>
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>
-
-
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip b/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip
deleted file mode 100644
index 967ce22..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip b/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip
deleted file mode 100644
index 4122d48..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml b/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
deleted file mode 100644
index 7d83766..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_1049139849772">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB.jar</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <web-uri>testWeb.war</web-uri>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml
deleted file mode 100644
index 179c62e..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name><module id="JavaClientModule_1049139849772"><java>testClient.jar</java></module>
- <module id="EjbModule_1049139849782"><ejb>testEJB.jar</ejb></module><module id="WebModule_1049139849812"><web><web-uri>testWeb.war</web-uri><context-root>testWeb</context-root></web></module></application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml
deleted file mode 100644
index 8bff745..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID
-"> <!-- a comment to ignore
-
-
-
- -->
- <display-name>
- test</display-name><module id="
- JavaClientModule_1049139849772
- "><java>testClient.jar</java></module><!-- a comment to ignore -->
- <module id="EjbModule_1049139849782"><ejb>testEJB.jar</ejb></module><module id="WebModule_1049139849812
- "><web><web-uri>testWeb.war</web-uri><context-root>testWeb</context-root></web></module></application>
- <!-- a comment to ignore -->
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml
deleted file mode 100644
index 7d1040c..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_104913984977">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB.jar</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <web-uri>testWeb.war</web-uri>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml
deleted file mode 100644
index c6ea028..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_1049139849772">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB.jar</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml
deleted file mode 100644
index 1f29c2e..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_1049139849772">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <web-uri>testWeb.war</web-uri>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml
deleted file mode 100644
index 840bd03..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_1049139849772">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB.jar</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <web-uri>testWeb.war</web-uri>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml
deleted file mode 100644
index ac6b8bf..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-"?>
-<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
-<application id="Application_ID">
- <display-name>test</display-name>
- <module id="JavaClientModule_1049139849772">
- <java>testClient.jar</java>
- </module>
- <module id="EjbModule_1049139849782">
- <ejb>testEJB.jar</ejb>
- </module>
- <module id="WebModule_1049139849812">
- <web>
- <web-uri>testWeb.war</web-uri>
- <context-root>testWeb</context-root>
- </web>
- </module>
-</application>
diff --git a/tests/org.eclipse.wst.internet.cache.tests/.classpath b/tests/org.eclipse.wst.internet.cache.tests/.classpath
deleted file mode 100644
index ce73933..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tests/org.eclipse.wst.internet.cache.tests/.cvsignore b/tests/org.eclipse.wst.internet.cache.tests/.cvsignore
deleted file mode 100644
index 67968bd..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.xml
-temp.folder
-tests.jar
-javaCompiler.tests.jar.args
diff --git a/tests/org.eclipse.wst.internet.cache.tests/.project b/tests/org.eclipse.wst.internet.cache.tests/.project
deleted file mode 100644
index fb4b067..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.internet.cache.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.internet.cache.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.internet.cache.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index fdebaa7..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun Jun 03 00:34:09 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
-org.eclipse.jdt.core.compiler.compliance=1.4
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
-org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.wst.internet.cache.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.internet.cache.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 6044f57..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.wst.internet.cache.tests
-Bundle-Version: 1.0.1.qualifier
-Bundle-ClassPath: tests.jar
-Bundle-Activator: org.eclipse.wst.internet.cache.tests.internal.CacheTestsPlugin
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.junit;bundle-version="[3.8.2,4.0.0)",
- org.eclipse.wst.internet.cache,
- org.eclipse.core.resources,
- org.eclipse.wst.common.uriresolver
-Eclipse-LazyStart: true
-Export-Package: org.eclipse.wst.internet.cache.internal;x-internal:=true,
- org.eclipse.wst.internet.cache.tests.internal;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
-Bundle-ActivationPolicy: lazy
-
diff --git a/tests/org.eclipse.wst.internet.cache.tests/about.html b/tests/org.eclipse.wst.internet.cache.tests/about.html
deleted file mode 100644
index 2199df3..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the RedistributorÂ’s license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/tests/org.eclipse.wst.internet.cache.tests/build.properties b/tests/org.eclipse.wst.internet.cache.tests/build.properties
deleted file mode 100644
index 67e37c6..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.tests.jar = src/
-output.tests.jar = bin/
-bin.includes = META-INF/,\
- tests.jar,\
- test.xml,\
- about.html,\
- plugin.properties
-src.includes = build.properties
diff --git a/tests/org.eclipse.wst.internet.cache.tests/plugin.properties b/tests/org.eclipse.wst.internet.cache.tests/plugin.properties
deleted file mode 100644
index 6ee48b6..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# properties file for org.eclipse.wst.internet.cache.tests
-Bundle-Vendor.0 = Eclipse
-Bundle-Name.0 = Cache Tests Plug-in
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheEntryTest.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheEntryTest.java
deleted file mode 100644
index f98308c..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheEntryTest.java
+++ /dev/null
@@ -1,60 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.internal;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Tests for the CacheEntry class.
- */
-public class CacheEntryTest extends TestCase
-{
- /**
- * Create a tests suite from this test class.
- *
- * @return A test suite containing this test class.
- */
- public static Test suite()
- {
- return new TestSuite(CacheEntryTest.class);
- }
-
- /**
- * Test that the entry is not considered expired when -1 is specified.
- */
- public void testNotExpiredWhenMinusOne()
- {
- CacheEntry cacheEntry = new CacheEntry(null, null, 0, -1);
- assertFalse("The cache entry is expired when -1 is specified.", cacheEntry.hasExpired());
- }
-
- /**
- * Test that the entry is not considered expired when the set expiration
- * time is greater than the current system time.
- */
- public void testNotExpiredWhenGreaterThanSystemTime()
- {
- CacheEntry cacheEntry = new CacheEntry(null, null, 0, System.currentTimeMillis() + 60000);
- assertFalse("The cache entry is expired when greater than the currnet system time.", cacheEntry.hasExpired());
- }
-
- /**
- * Test that the entry is considered expired when the set expiration
- * time is less than the current system time.
- */
- public void testExpiredWhenLessThanSystemTime()
- {
- CacheEntry cacheEntry = new CacheEntry(null, null, 0, System.currentTimeMillis() - 60000);
- assertTrue("The cache entry is not expired when less than the currnet system time.", cacheEntry.hasExpired());
- }
-}
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheTest.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheTest.java
deleted file mode 100644
index 89f496f..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheTest.java
+++ /dev/null
@@ -1,213 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.internal;
-
-import java.io.File;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Tests for the Cache class.
- */
-public class CacheTest extends TestCase
-{
- private Cache cache;
-
- /**
- * Create a tests suite from this test class.
- *
- * @return A test suite containing this test class.
- */
- public static Test suite()
- {
- return new TestSuite(CacheTest.class);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- cache = Cache.getInstance();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-
- /**
- * Test trying to cache a resource that doesn't exist
- * on a server that does exist.
- */
- public void testGetNonExistantResource()
- {
- String resource = "http://www.eclipse.org/webtools/nonexistantfile";
- String result = cache.getResource(resource);
- cache.clear();
- assertNull("The result returned for resource " + resource + " is not null.", result);
- }
-
- /**
- * Test trying to cache a resource that doesn't exist
- * because the server doesn't exist.
- */
-// public void testGetNonExistantServer()
-// {
-// String resource = "http://www.eclipse.bad/webtools/nonexistantfile";
-// String result = cache.getResource(resource);
-// cache.clear();
-// assertNull("The result returned for resource " + resource + " is not null.", result);
-// }
-
- /**
- * Test trying to get a resource specified by null.
- */
- public void testGetNullResource()
- {
- String resource = null;
- String result = cache.getResource(resource);
- cache.clear();
- assertNull("The result returned for resource " + resource + " is not null.", result);
- }
-
- /**
- * Test trying to cache a resource that does exist.
- */
- public void testGetResourceThatExists()
- {
- String resource = "http://www.eclipse.org/webtools";
- String result = cache.getResource(resource);
- cache.clear();
- assertNotNull("The result returned for resource " + resource + " was null.", result);
- assertTrue("The result and resource are the same.", !resource.equals(result));
- }
-
- /**
- * Test to ensure the result that is returned starts with file:///
- */
- public void testResultStartsWithFile()
- {
- String resource = "http://www.eclipse.org/webtools";
- String result = cache.getResource(resource);
- cache.clear();
- assertTrue("The result does not start with file:///.", result.startsWith("file:///"));
- }
-
- /**
- * Test to ensure deleting a cache entry deletes it from the cache and
- * from the file system.
- */
- public void testDeleteCacheEntry()
- {
- String resource = "http://www.eclipse.org/webtools";
- String result = cache.getResource(resource);
- assertNotNull("The local cache file is null.", result);
- // Remove file:/// from the result.
- result = result.substring(8);
- assertTrue("The cache file " + result + " does not exist.", new File(result).exists());
- cache.deleteEntry(resource);
- assertFalse("The cache file was not deleted.", new File(result).exists());
- assertTrue("The cache still contains the deleted entry.", cache.getCachedURIs().length == 0);
- cache.clear();
- }
-
- /**
- * Test to ensure deleting a null cache entry simply returns.
- */
- public void testDeleteNullCacheEntry()
- {
- String resource = "http://www.eclipse.org/webtools";
- cache.getResource(resource);
- cache.deleteEntry(null);
- assertFalse("The cache no longer contains the entry after deleting null.", cache.getCachedURIs().length == 0);
- cache.clear();
- }
-
- /**
- * Test to ensure clearing the cache with a single entry deletes the entry
- * from the cache and deletes the file from the file system.
- */
- public void testClearCacheWithSingleEntry()
- {
- String resource1 = "http://www.eclipse.org/webtools";
- String result1 = cache.getResource(resource1);
- assertNotNull("The local cache file is null for resource1.", result1);
- // Remove file:/// from the result.
- result1 = result1.substring(8);
- assertTrue("The cache file " + result1 + " does not exist.", new File(result1).exists());
- cache.clear();
- assertFalse("The cache file for resource1 was not deleted.", new File(result1).exists());
- assertTrue("The cache still contains the deleted entries.", cache.getCachedURIs().length == 0);
- }
-
- /**
- * Test to ensure clearing the cache with multiple entries deletes the entries
- * from the cache and deletes the files from the file system.
- */
- public void testClearCacheWithMultipleEntries()
- {
- String resource1 = "http://www.eclipse.org/webtools";
- String resource2 = "http://www.eclipse.org";
- String result1 = cache.getResource(resource1);
- String result2 = cache.getResource(resource2);
- assertNotNull("The local cache file is null for resource1.", result1);
- assertNotNull("The local cache file is null for resource2.", result2);
- // Remove file:/// from the result.
- result1 = result1.substring(8);
- result2 = result2.substring(8);
- assertTrue("The cache file " + result1 + " does not exist.", new File(result1).exists());
- assertTrue("The cache file " + result2 + " does not exist.", new File(result2).exists());
- cache.clear();
- assertFalse("The cache file for resource1 was not deleted.", new File(result1).exists());
- assertFalse("The cache file for resource2 was not deleted.", new File(result2).exists());
- assertTrue("The cache still contains the deleted entries.", cache.getCachedURIs().length == 0);
- }
-
- /**
- * Test to ensure deleting a null cache entry simply returns.
- */
- public void testGetInstance()
- {
- assertNotNull("The cache object is null.", cache);
- }
-
- /**
- * Test to ensure getCacheEntries returns all of the cache entries and not entries that
- * haven't been cached.
- */
- public void testGetCacheEntries()
- {
- String resource1 = "http://www.eclipse.org/webtools";
- String resource2 = "http://www.eclipse.org";
- String resource3 = "http://www.eclipse.org/webtools/nonexistantfile";
- cache.getResource(resource1);
- cache.getResource(resource2);
- cache.getResource(resource3);
- String[] uris = cache.getCachedURIs();
- assertTrue("There are not 2 entries in the cache.", uris.length == 2);
-
- for(int i = 0; i < uris.length -1; i++)
- {
- String uri = uris[i];
- if(!(uri.equals(resource1) || uri.equals(resource2) || uri.equals(resource3)))
- {
- fail("The URI " + uri + " is not equal to any of the resources put in the cache.");
- }
- }
- cache.clear();
-
- }
-
-
-
-
-
-}
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheURIResolverExtensionTest.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheURIResolverExtensionTest.java
deleted file mode 100644
index d1f1615..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/CacheURIResolverExtensionTest.java
+++ /dev/null
@@ -1,111 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.internal;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Tests for the CacheURIResolverExtension class.
- */
-public class CacheURIResolverExtensionTest extends TestCase
-{
- private CacheURIResolverExtension cacheResolver;
-
- /**
- * Create a tests suite from this test class.
- *
- * @return A test suite containing this test class.
- */
- public static Test suite()
- {
- return new TestSuite(CacheURIResolverExtensionTest.class);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- cacheResolver = new CacheURIResolverExtension();
- // The cache is disabled by default. We need to enable it for the tests.
- CachePlugin.getDefault().setCacheEnabled(true);
- }
-
- /**
- * Test that the result returned when a null systemId is given is null.
- */
- public void testResolveNullSystemId()
- {
- String result = cacheResolver.resolve(null,"http://www.eclipse.org/webtools", null, null);
- assertNull("The result is not null.", result);
- }
-
- /**
- * Test that the result returned when a null systemId and a null baselocation
- * are given is null.
- */
- public void testResolveNullSystemIdAndBaselocation()
- {
- String result = cacheResolver.resolve(null, null, null, null);
- assertNull("The result is not null.", result);
- }
-
- /**
- * Test that the result is sucessfully cached when an absolute systemId
- * is given.
- */
- public void testAbsoluteSystemId()
- {
- String result = cacheResolver.resolve(null,"http://www.eclipse.org/webtools", null, "http://www.eclipse.org");
- assertNotNull("The result is null.", result);
- }
-
- /**
- * Test that the result is sucessfully cached when an absolute systemId
- * is given and a null base location is given
- */
- public void testAbsoluteSystemIdNullBaselocation()
- {
- String result = cacheResolver.resolve(null, null, null, "http://www.eclipse.org");
- assertNotNull("The result is null.", result);
- }
-
- /**
- * Test that the result is sucessfully cached when a relative systemId
- * is given.
- */
- public void testRelativeSystemId()
- {
- String result = cacheResolver.resolve(null,"http://www.eclipse.org/webtools/community/somefile.xml", null, "index.php");
- assertNotNull("The result is null.", result);
- }
-
- /**
- * Test that the result is unsucessfully cached when a relative systemId
- * is given and a null base location is given.
- */
- public void testRelativeSystemIdWillNullBaselocation()
- {
- String result = cacheResolver.resolve(null, null, null, "community.html");
- assertNull("The result is not null.", result);
- }
-
- /**
- * Test that null is returned when the cache is disabled.
- */
- public void testReturnsNullWhenDisabled()
- {
- CachePlugin.getDefault().setCacheEnabled(false);
- String result = cacheResolver.resolve(null, "http://www.eclipse.org/webtools/", null, "http://www.eclipse.org/webtools/");
- assertNull("The result is not null.", result);
- CachePlugin.getDefault().setCacheEnabled(true);
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryTest.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryTest.java
deleted file mode 100644
index febd010..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryTest.java
+++ /dev/null
@@ -1,125 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.internal;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class LicenseRegistryTest extends TestCase
-{
- /**
- * Create a tests suite from this test class.
- *
- * @return A test suite containing this test class.
- */
- public static Test suite()
- {
- return new TestSuite(LicenseRegistryTest.class);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /**
- * Test adding a license to the registry. When added the registry should contain the license
- * and the license should have the unspecified value.
- */
- public void testAddLicenseToRegistry()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.addLicense(licenseURL);
- assertEquals("The registry does not have 1 license.", 1, registry.getLicensesHashtable().size());
- assertTrue("The registry does not conain the license " + licenseURL, registry.getLicensesHashtable().containsKey(licenseURL));
- assertEquals("The registry does not have the correct value for the license.", LicenseRegistryWrapper.LICENSE_UNSPECIFIED, registry.getLicensesHashtable().get(licenseURL));
- }
-
- /**
- * Test adding a license to the registry twice. The registry should only have a single entry
- * for the license.
- */
- public void testAddLicenseToRegistryTwice()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.addLicense(licenseURL);
- registry.addLicense(licenseURL);
- assertEquals("The registry contains more than one license.", 1, registry.getLicensesHashtable().size());
- }
-
- /**
- * Test agree to license method. The registry should have 'agree' registered for the license.
- */
- public void testAgreeToLicense()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.addLicense(licenseURL);
- registry.agreeLicense(licenseURL);
- assertEquals("The registry does not have the correct value for the license.", LicenseRegistryWrapper.LICENSE_AGREE, registry.getLicensesHashtable().get(licenseURL));
- }
-
- /**
- * Test agree to license that is not in the registry. The registry should not create
- * an entry for the license.
- */
- public void testAgreeToLicenseNotInRegistry()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.agreeLicense(licenseURL);
- assertEquals("The registry registered the license but it should not have.", 0, registry.getLicensesHashtable().size());
- }
-
- /**
- * Test disagree to license method. The registry should have 'disagree' registered for the license.
- */
- public void testDisgreeToLicense()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.addLicense(licenseURL);
- registry.disagreeLicense(licenseURL);
- assertEquals("The registry does not have the correct value for the license.", LicenseRegistryWrapper.LICENSE_DISAGREE, registry.getLicensesHashtable().get(licenseURL));
- }
-
- /**
- * Test disagree to license that is not in the registry. The registry should not create
- * an entry for the license.
- */
- public void testDisagreeToLicenseNotInRegistry()
- {
- String licenseURL = "http://somelicense";
- LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
- registry.agreeLicense(licenseURL);
- assertEquals("The registry registered the license but it should not have.", 0, registry.getLicensesHashtable().size());
- }
-
- /**
- * Test prompt for agree for license not in registry.
- * TODO: This test does not test what it is supposed to.
- * This test should be corrected if possible.
- */
-// public void testPromptForLicenseNotInRegistry()
-// {
-// String licenseURL = "http://somelicense";
-// LicenseRegistryWrapper registry = new LicenseRegistryWrapper();
-// assertTrue("The prompt for agreement method does not return true for a license not in the registry.", registry.promptToAcceptLicense(licenseURL, licenseURL));
-// }
-}
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryWrapper.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryWrapper.java
deleted file mode 100644
index f94b1ea..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/internal/LicenseRegistryWrapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 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.internet.cache.internal;
-
-import java.util.Hashtable;
-
-/**
- * A wrapper for org.eclipse.wst.internet.cache.internal.LicenseRegistry
- * that allows for testing of protected methods.
- */
-public class LicenseRegistryWrapper extends LicenseRegistry
-{
- protected static Integer LICENSE_UNSPECIFIED = LicenseRegistry.LICENSE_UNSPECIFIED;
- protected static Integer LICENSE_AGREE = LicenseRegistry.LICENSE_AGREE;
- protected static Integer LICENSE_DISAGREE = LicenseRegistry.LICENSE_DISAGREE;
- protected LicenseRegistryWrapper()
- {
- super();
- }
-
- protected Hashtable getLicensesHashtable()
- {
- return licenses;
- }
-
- protected void agreeLicense(String url)
- {
- super.agreeLicense(url);
- }
-
- protected void disagreeLicense(String url)
- {
- super.disagreeLicense(url);
- }
-
- protected int promptToAcceptLicense(String url, String licenseURL)
- {
- return super.promptToAcceptLicense(url, licenseURL);
- }
-}
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/AllCacheTests.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/AllCacheTests.java
deleted file mode 100644
index f69872f..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/AllCacheTests.java
+++ /dev/null
@@ -1,44 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.tests.internal;
-import junit.framework.Test;
-
-import org.eclipse.wst.internet.cache.internal.CacheEntryTest;
-import org.eclipse.wst.internet.cache.internal.CacheTest;
-import org.eclipse.wst.internet.cache.internal.CacheURIResolverExtensionTest;
-import org.eclipse.wst.internet.cache.internal.LicenseRegistryTest;
-/**
- * The root test suite that contains all other Cache test suites.
- */
-public class AllCacheTests extends junit.framework.TestSuite
-{
- /**
- * Create this test suite.
- *
- * @return This test suite.
- */
- public static Test suite()
- {
- return new AllCacheTests();
- }
-
- /**
- * Constructor
- */
- public AllCacheTests()
- {
- super("AllCacheTests");
- addTest(CacheTest.suite());
- addTest(CacheEntryTest.suite());
- addTest(CacheURIResolverExtensionTest.suite());
- addTest(LicenseRegistryTest.suite());
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/CacheTestsPlugin.java b/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/CacheTestsPlugin.java
deleted file mode 100644
index 6404a3d..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/src/org/eclipse/wst/internet/cache/tests/internal/CacheTestsPlugin.java
+++ /dev/null
@@ -1,94 +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
- *******************************************************************************/
-package org.eclipse.wst.internet.cache.tests.internal;
-
-import org.eclipse.ui.plugin.*;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.osgi.framework.BundleContext;
-import java.util.*;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class CacheTestsPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static CacheTestsPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public CacheTestsPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static CacheTestsPlugin 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 = CacheTestsPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.internal.cache.tests.CacheTestsPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.internal.cache.tests", path);
- }
-}
diff --git a/tests/org.eclipse.wst.internet.cache.tests/test.xml b/tests/org.eclipse.wst.internet.cache.tests/test.xml
deleted file mode 100644
index e9a522b..0000000
--- a/tests/org.eclipse.wst.internet.cache.tests/test.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
- name="testsuite"
- default="run"
- basedir=".">
-
- <!--
- =====================================================
- There should be no need to change what's above.
- (if there is, let us know if the script can be improved.)
- =====================================================
- -->
-
- <!--
- Every suite needs to specify three thing:
- plugin-name,
- classname - that provides the suite to test, and
- testType - either core-test, or ui-test.
- There is an optional extraVMargs property that some tests need to use in order to specify
- extra, non-standard properties to the VM when it runs. If not need, no need to specify it.
- -->
- <property
- name="plugin-name"
- value="org.eclipse.wst.internet.cache.tests" />
- <property
- name="classname"
- value="org.eclipse.wst.internet.cache.tests.internal.AllCacheTests" />
- <property
- name="testType"
- value="core-test" />
-
- <!-- some test suites need to add special vm arguments when they run. This is just an example.
- <property
- name="extraVMargs"
- value="-DjsfRuntimeJarsDirectoryV1.1=${testDir}/${jsf1.1Dir}" />
- <echo
- message="extraVMargs ${extraVMargs}" />
- -->
-
- <!--
- =====================================================
- There should be no need to change what's below.
- (if there is, let us know if the script can be improved.)
- =====================================================
- -->
-
- <fail
- message="Error: missing property. eclipse-home must be proved"
- unless="eclipse-home" />
- <fail
- message="Error: missing property. buildDirectory must be proved"
- unless="buildDirectory" />
- <fail
- message="Error: missing property. buildLabel must be proved"
- unless="buildLabel" />
- <echo
- message="basedir: ${basedir}" />
- <echo
- message="eclipse-home: ${eclipse-home}" />
- <echo
- message="buildDirectory: ${buildDirectory}" />
- <echo
- message="plugin-name: ${plugin-name}" />
- <echo
- message="classname: ${classname}" />
- <echo
- message="testType ${testType}" />
- <property
- name="library-file"
- value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml" />
- <property
- name="workspace"
- value="${eclipse-home}/junitworkspaces/${plugin-name}" />
-
- <!--
- This init target holds all initialization code that needs to be done for
- all tests that are to be run. Initialization for individual tests
- should be done within the body of the suite target. Here it's a good idea
- to delete things that might have been created if the test has already been
- ran, just in case the test is being re-ran.
- -->
- <target
- name="init">
- <tstamp />
- <delete>
- <fileset
- dir="${eclipse-home}"
- includes="${plugin-name}.*xml" />
- </delete>
-
- <!--
- make the workspace directory, in case path doesn't exist yet
- but delete to make sure fresh contents, if it does exist
- -->
- <delete
- dir="${workspace}"
- quiet="true" />
- <mkdir
- dir="${workspace}" />
- </target>
-
- <!--
- This suite target defines the tests that need to be run.
- -->
- <target
- name="suite">
- <ant
- target="${testType}"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="data-dir"
- value="${workspace}" />
- <property
- name="plugin-name"
- value="${plugin-name}" />
- <property
- name="classname"
- value="${classname}" />
- <property
- name="plugin-path"
- value="${eclipse-home}/plugins/${plugin-name}" />
- </ant>
- <copy
- failonerror="false"
- file="${workspace}/.metadata/.log"
- tofile="${buildDirectory}/${buildLabel}/testResults/consolelogs/${plugin-name}.consolelog.txt" />
- </target>
-
- <!--
- This clean target holds code to cleanup the testing environment after
- after all of the tests have been run. You can use this target to
- delete temporary files that have been created, if required. But,
- it's usually best to leave it all, in case you'd like to inspect it
- after a failed run. It will be deleted eventually by the next clean build.
- -->
- <target
- name="cleanup">
-
- </target>
-
- <!--
- This run target is the master target that get's all the work done.
- Most activity is actually done in the 'depends' tasks, but any
- actions that need to happen after all the tests have been run
- should go here, such as copying the results to a common 'save'
- directory.
- -->
- <target
- name="run"
- depends="init,suite,cleanup">
- <ant
- target="collect"
- antfile="${library-file}"
- dir="${eclipse-home}">
- <property
- name="includes"
- value="${plugin-name}.*xml" />
- <property
- name="output-file"
- value="${plugin-name}.xml" />
- </ant>
- </target>
-</project>
\ No newline at end of file