Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/chess/chess
  • malowe/chess
  • aperri21897/chess
  • fihirweh8e/chess
  • wbeaton/chess
5 results
Show changes
Commits on Source (393)
Showing
with 257 additions and 1470 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="org.polarsys.chess.smvExport/src"/> <classpathentry kind="src" path="org.polarsys.chess.smvExport/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.chessextension/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.chessextension/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.contractEditor/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.contractEditor/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.contractPropertyManager/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.contractPropertyManager/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.hierarchicalContractView/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.hierarchicalContractView/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.integration/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.integration/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.profile/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.profile/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.refinementView/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.refinementView/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.safetyAnalysis/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.safetyAnalysis/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.transformations/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.transformations/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.validation/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.validation/src"/>
<classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.verificationService/src"/> <classpathentry kind="src" path="plugins/contracts/org.polarsys.chess.contracts.verificationService/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.flamm/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.flamm/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.flaxml/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.flaxml/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.transformations/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla.transformations/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.fla/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl.ui/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl.ui/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl.ui/src-gen"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl.ui/src-gen"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/src"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/src"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/src-gen"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/src-gen"/>
<classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/xtend-gen"/> <classpathentry kind="src" path="plugins/fla/org.polarsys.chess.xtext.fladsl/xtend-gen"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.chessmlprofile/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.chessmlprofile/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.codegen.ada/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.codegen.ada/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.commands/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.commands/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.constraints.constraintEditor/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.constraints.constraintEditor/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.core/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.core/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.diagram.ui/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.diagram.ui/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.discovery/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.discovery/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.instance.view/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.m2m/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.instance.view/src-gen"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.edit/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.m2m/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.editor/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.edit/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.tests/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.editor/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring.tests/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.multicore/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.monitoring/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.properties.propertyEditor/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.multicore/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.service/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.properties.propertyEditor/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.tabbedproperties/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.service/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.test.runtime/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.tabbedproperties/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.validator/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.test.runtime/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.wizards/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.validator/src"/> <classpathentry kind="src" path="plugins/org.polarsys.chess.xtext.global/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.wizards/src"/> <classpathentry kind="src" path="plugins/sba/org.polarsys.chess.statebased/src"/>
<classpathentry kind="src" path="plugins/org.polarsys.chess.xtext.global/src"/> <classpathentry kind="lib" path="plugins/fla/org.polarsys.chess.xtext.fladsl/.antlr-generator-3.2.0-patch.jar"/>
<classpathentry kind="src" path="plugins/sba/org.polarsys.chess.statebased/src"/> <classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/artifacts.jar"/>
<classpathentry kind="lib" path="plugins/fla/org.polarsys.chess.xtext.fladsl/.antlr-generator-3.2.0-patch.jar"/> <classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/content.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/artifacts.jar"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/content.jar"/> <classpathentry kind="output" path="bin"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/features/org.polarsys.chess.contracts.feature_0.10.0.201610211519.jar"/> </classpath>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/features/org.polarsys.chess.feature_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/features/org.polarsys.chess.fla.feature_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/features/org.polarsys.chess.statebased.feature_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/features/org.polarsys.chess.xtext.feature_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.chessmlprofile_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.chessmlprofile_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.codegen.ada_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.codegen.ada_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.commands_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.commands_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.contracts.chessextension_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.contracts.integration_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.contracts.profile_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.contracts.transformations_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.contracts.validation_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.core_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.core_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.discovery_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.discovery_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.fla_1.0.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.fla.flamm_0.1.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.fla.flaxml_0.1.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.fla.FPTC2FLABehavior_1.0.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.fla.transformations_0.1.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.instance.view_0.0.1.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.m2m_0.8.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.m2m_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.monitoring_0.1.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.multicore_0.9.2.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.service_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.service_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.statebased_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.tabbedproperties_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.validator_0.10.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.validator_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.wizards_0.9.0.201507281729.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.wizards_0.9.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.xtext.fladsl_1.0.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.xtext.fladsl.ui_1.0.0.201610211519.jar"/>
<classpathentry kind="lib" path="plugins/org.polarsys.chess.updatesite/plugins/org.polarsys.chess.xtext.global_1.0.0.201610211519.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
# Contributing to Eclipse CHESS
This guide provides all necessary information to enable [contributors and committers](https://www.eclipse.org/projects/dev_process/#2_3_1_Contributors_and_Committers) to contribute to Eclipse CHESS.
## Eclipse Contributor Agreement
Before your contribution can be accepted by the project team, contributors must
electronically sign the Eclipse Contributor Agreement (ECA).
* http://www.eclipse.org/legal/ECA.php
Commits that are provided by non-committers must have a Signed-off-by field in
the footer indicating that the author is aware of the terms by which the
contribution has been provided to the project. The non-committer must
additionally have an Eclipse Foundation account and must have a signed Eclipse
Contributor Agreement (ECA) on file.
For more information, please see the Eclipse Committer Handbook:
https://www.eclipse.org/projects/handbook/#resources-commit
## How to contribute
The CHESS source code can be found [here](gitlab.eclipse.org:eclipse/chess/chess.git).
To build the project, go to repo\org.polarsys.chess.parent\ and execute mvn -P "Eclipse-Neon-Java8" install.
The branch 'devel' contains the contributions that will be included in the next release.
### Committer contribution process
1. (you) If needed, create the Issue on GitLab and assign it to yourself.
2. (you) In GitLab, create a merge request. The related branch will be created from the branch 'devel'.
3. (you) Work on it.
4. (you) Run regression tests.
5. (you) Assign the issue to another committer.
5. (other committer) Review the code.
6. (other committer) To merge new branch into 'devel' you can close the merge request via GitLab. Otherwise, if you want to automatically run regression tests before the merge, configure and run the Jenkins process '[CHESS-gitlab-merge-branch-x-to-devel](https://ci.eclipse.org/chess/job/CHESS-gitlab-merge-branch-x-to-devel/)').
File added
File added
Eclipse Public License - v 2.0
==============================
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.
### 1. Definitions
“Contribution” means:
* **a)** in the case of the initial Contributor, the initial content Distributed under this Agreement, and
* **b)** in the case of each subsequent Contributor:
* **i)** changes to the Program, and
* **ii)** additions to the Program;
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 changes or additions to the Program that are not Modified Works.
“Contributor” means any person or entity that Distributes the Program.
“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.
“Program” means the Contributions Distributed in accordance with this Agreement.
“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
“Distribute” means the acts of **a)** distributing or **b)** making available in any manner that enables the transfer of a copy.
“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
### 2. Grant of Rights
**a)** Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
**b)** Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, 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 or other 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.
**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.
**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.
**e)** Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
### 3. Requirements
**3.1** If a Contributor Distributes the Program in any form, then:
* **a)** the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
* **b)** the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
* **i)** effectively disclaims on behalf of all other 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;
* **ii)** effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
* **iii)** does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
* **iv)** requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
**3.2** When the Program is Distributed as Source Code:
* **a)** it must be made available under this Agreement, or if the Program **(i)** is combined with other material in a separate file or files made available under a Secondary License, and **(ii)** the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
* **b)** a copy of this Agreement must be included with each copy of the Program.
**3.3** Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (“notices”) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
### 4. Commercial Distribution
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.
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.
### 5. No Warranty
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, 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.
### 6. Disclaimer of Liability
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, 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.
### 7. General
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.
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.
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.
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. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
#### Exhibit A - Form of Secondary Licenses Notice
> “This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), version(s), and exceptions or additional permissions here}.”
Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses.
If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
You may add additional accurate notices of copyright ownership.
# Notices for Eclipse CHESS
This content is produced and maintained by the Eclipse CHESS project.
* Project home: https://projects.eclipse.org/projects/polarsys.chess
## Trademarks
Eclipse and CHESS are trademarks of the Eclipse Foundation.
## Copyright
All content is the property of the respective authors or their employers. For
more information regarding authorship of content, please consult the listed
source code repository logs.
## Declared Project Licenses
This program and the accompanying materials are made available under the
terms of the Eclipse Public License 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0
SPDX-License-Identifier: EPL-2.0
## Source Code
The project maintains the following source code repositories:
* https://git.eclipse.org/r/chess/chess.git
## Third-party Content
This project leverages the following third party content.
SDE (Syntax-derived editor)
* License: EPL-2.0 AND EPL-1.0 AND Apache-2.0
EST (Eclipse Standard Tools)
* License: EPL-1.0 AND Apache-2.0 AND MIT-CMU AND CC-BY-4.0
## Cryptography
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.
# Eclipse CHESS
CHESS implements the CHESS UML/SysML profile, a specialization of the Modeling and Analysis of Real-Time and Embedded Systems (MARTE) profile, by producing extensions to Papyrus that provide component-based engineering methodology and tool support for the development of high-integrity embedded systems in different domains like satellite on board systems.
## Developer resources
* [CHESS Website](https://websites.eclipseprojects.io/chess/)
* [CHESS devel Website](https://projects.eclipse.org/projects/polarsys.chess)
* [Forum](https://www.eclipse.org/forums/index.php/f/529/)
* Mailing list: Join our [developer list](https://accounts.eclipse.org/mailing-list/chess-dev)
* Bugs? [GitLab] (https://gitlab.eclipse.org/eclipse/chess/chess/-/issues)(previous bug traking system was [BugZilla](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Chess)) is where to report them
## Contact
Contact the project developers via the project's "dev" list.
* chess-dev@eclipse.org
## How to contribute
The contributor guide can be found [here](https://gitlab.eclipse.org/eclipse/chess/chess/-/blob/devel/CONTRIBUTING.md).
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.papyrus.junit.framework</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>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.oomph.version.VersionNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Export-Package: org.eclipse.papyrus.junit.framework.classification,
org.eclipse.papyrus.junit.framework.classification.rules,
org.eclipse.papyrus.junit.framework.classification.tests,
org.eclipse.papyrus.junit.framework.runner
Require-Bundle: org.junit;bundle-version="[4.12.0,5.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.tools;bundle-version="[2.0.0,3.0.0)",
org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)",
org.eclipse.ui;bundle-version="[3.107.0,4.0.0)"
Bundle-Vendor: Eclipse Modeling Project
Bundle-Version: 1.0.0.qualifier
Bundle-Name: Conditional Junit Annotations
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.papyrus.junit.framework
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>November 14, 2008</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
</body>
</html>
\ No newline at end of file
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
about.html
src.includes = about.html
/*****************************************************************************
* Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus - bug 451230
* Christian W. Damus - bug 464647
* Christian W. Damus - bug 480812
* Christian W. Damus - bug 485156
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.ExpensiveTest;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.FailingTest;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.GeneratedTest;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InteractiveTest;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.InvalidTest;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.NotImplemented;
import static org.eclipse.papyrus.junit.framework.classification.TestCategory.Standard;
import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.papyrus.infra.tools.util.ListHelper;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Suite;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
/**
* <p>
* This class is used to configure the Classification Annotations which should be excluded from a test job. A classification configuration is an immutable set of {@linkplain TestCategory test categories} that are included in the test configuration.
* </p>
* <p>
* Usage:
* </p>
*
* <pre>
* ClassificationConfig.setExcludedTestCategories(TestCategory.InvalidTest, TestCategory.NotImplemented);
*
* // or
*
* ClassificationConfig.setIncludedTestCategories(TestCategory.Standard, TestCategory.NotImplemented);
*
* // or
*
* ClassificationConfig.setExcludedTestCategories(ClassificationConfig.FAILING_TESTS_CONFIG);
*
* // or
*
* ClassificationConfig.setIncludedTestCategories(ClassificationConfig.FULL_CI_TESTS_CONFIG);
*
* // or
*
* ClassificationConfig.setTestsConfiguration(ClassificationConfig.CI_TESTS_CONFIG);
* </pre>
*
* @author Camille Letavernier
*
* @see {@link TestCategory}
* @see {@link ClassificationRunner}
*
*/
public enum ClassificationConfig implements Set<TestCategory> {
/**
* Default tests configuration for Continuous Integration (Hudson): Excludes the tests which are
* identified as failing, as well as the interactive tests
*
* This configuration may require a couple of hours to run
*/
CI_TESTS_CONFIG(NotImplemented, InvalidTest, FailingTest, InteractiveTest, GeneratedTest),
/**
* This tests configuration runs all tests which are already identified as failing.
* If one test from this configuration passes, this might mean that the annotation should be removed
*
* InteractiveTests are excluded as well, as this configuration is supposed to be executed on Hudson
*/
FAILING_TESTS_CONFIG(Standard, InteractiveTest, GeneratedTest, ExpensiveTest),
/**
* This tests configuration is expected to run in ~15 minutes. This is useful for quick testing,
* and validation through Gerrit
*/
LIGTHWEIGHT_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, GeneratedTest),
/**
* This test configuration runs all generated diagram tests only.
*
* @since 1.2
*/
GENERATED_TESTS_CONFIG(InteractiveTest, NotImplemented, FailingTest, InvalidTest, ExpensiveTest, Standard),
/**
* This tests configuration is meant to execute all tests in an automated environment
* It includes all tests which are known to be failing, but excludes tests which
* require a user interaction
*/
FULL_CI_TESTS_CONFIG(InteractiveTest),
/**
* Executes all tests
*/
FULL_TESTS_CONFIG();
public static final Set<TestCategory> excludedTestCategories = new HashSet<TestCategory>();
private final Set<TestCategory> categories;
static {
// Default on Hudson: exclude everything which is already identified as an issue (i.e. is not a (new) regression)
setTestsConfiguration(CI_TESTS_CONFIG);
// Check whether identified regressions are still failing
// setIncludedTestCategories(FailingTest);
for (String arg : Platform.getApplicationArgs()) {
if (arg.contains("-testConfig=")) {
String configName = arg.substring("-testConfig=".length());
Set<TestCategory> testsConfig = ClassificationConfig.valueOf(configName);
if (testsConfig != null) {
setTestsConfiguration(testsConfig);
}
break;
}
}
}
private ClassificationConfig(TestCategory... exclusions) {
Set<TestCategory> categories = Sets.newHashSet(TestCategory.values());
categories.removeAll(Arrays.asList(exclusions));
this.categories = ImmutableSet.copyOf(categories);
}
// Same as setExcludedTestsCategories, but renamed for clarity (To be used with predefined configurations)
public static void setTestsConfiguration(Set<TestCategory> predefinedConfiguration) {
setIncludedTestCategories(predefinedConfiguration);
}
/**
* Define the test categories which should be excluded from the TestSuite
*
* @param categoriesToInclude
*/
public static void setExcludedTestCategories(TestCategory... categories) {
setExcludedTestCategories(Arrays.asList(categories));
}
/**
* Define the test categories which should be included in the TestSuite
*
* @param categoriesToInclude
*/
public static void setIncludedTestCategories(TestCategory... categories) {
setIncludedTestCategories(Arrays.asList(categories));
}
/**
* Define the test categories which should be excluded from the TestSuite
*
* @param categoriesToInclude
*/
public static void setExcludedTestCategories(Collection<TestCategory> categoriesToExclude) {
excludedTestCategories.clear();
excludedTestCategories.addAll(categoriesToExclude);
}
/**
* Define the test categories which should be included in the TestSuite
*
* @param categoriesToInclude
*/
public static void setIncludedTestCategories(Collection<TestCategory> categoriesToInclude) {
excludedTestCategories.clear();
List<TestCategory> categoriesToExclude = ListHelper.asList(TestCategory.values());
categoriesToExclude.removeAll(categoriesToInclude);
excludedTestCategories.addAll(categoriesToExclude);
}
/**
* Tests whether a method containing the given set of Annotations should be executed
*
* @param annotations
* The annotations applied to the Method
* @return
* True if the test method should be executed, false if it should be ignored
*/
public static boolean shouldRun(Annotation[] annotations) {
for (Annotation annotation : annotations) {
Class<? extends Annotation> annotationClass = annotation.annotationType();
// Support the usual @Ignore annotation, too, of course
if ((annotationClass == Ignore.class) || isExcluded(annotationClass)) {
return false;
}
}
if (excludedTestCategories.contains(TestCategory.Standard)) {
// If it's just a test suite, then let the execution of its children be filtered
for (Annotation annotation : annotations) {
if (RunWith.class.isInstance(annotation)) {
RunWith runWith = (RunWith) annotation;
Class<?> runner = runWith.value();
if (Suite.class.isAssignableFrom(runner) && !Parameterized.class.isAssignableFrom(runner)) {
return true;
}
}
}
for (TestCategory testCategory : TestCategory.values()) {
if (testCategory == TestCategory.Standard) {
continue;
}
for (Annotation annotation : annotations) {
if (testCategory.match(annotation.annotationType())) {
return true;
}
}
}
return false;
}
return true;
}
/**
* Tests whether the given Annotation should be excluded
*
* @param annotationClass
* @return
*/
public static boolean isExcluded(Class<? extends Annotation> annotationClass) {
for (TestCategory testCategory : excludedTestCategories) {
if (testCategory.match(annotationClass)) {
return true;
}
}
return false;
}
@Override
public int size() {
return categories.size();
}
@Override
public boolean isEmpty() {
return categories.isEmpty();
}
@Override
public boolean contains(Object o) {
return categories.contains(o);
}
@Override
public boolean containsAll(Collection<?> c) {
return categories.containsAll(c);
}
@Override
public Iterator<TestCategory> iterator() {
return categories.iterator();
}
@Override
public Object[] toArray() {
return categories.toArray();
}
@Override
public <T> T[] toArray(T[] a) {
return categories.toArray(a);
}
@Override
public boolean add(TestCategory e) {
throw new UnsupportedOperationException("add"); //$NON-NLS-1$
}
@Override
public boolean remove(Object o) {
throw new UnsupportedOperationException("remove"); //$NON-NLS-1$
}
@Override
public boolean addAll(Collection<? extends TestCategory> c) {
throw new UnsupportedOperationException("addAll"); //$NON-NLS-1$
}
@Override
public boolean retainAll(Collection<?> c) {
throw new UnsupportedOperationException("retainAll"); //$NON-NLS-1$
}
@Override
public boolean removeAll(Collection<?> c) {
throw new UnsupportedOperationException("removeAll"); //$NON-NLS-1$
}
@Override
public void clear() {
throw new UnsupportedOperationException("clear"); //$NON-NLS-1$
}
}
/*****************************************************************************
* Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - add support for conditional tests
* Christian W. Damus (CEA) - bug 432813
* Christian W. Damus (CEA) - bug 434993
* Christian W. Damus (CEA) - bug 436047
* Christian W. Damus - bug 485156
*
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.util.List;
import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
/**
* A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests.
*
* It ignores the test methods according to their annotations, and the policy defined
* in {@link ClassificationConfig}
*
*
* @see {@link ClassificationConfig}
* @see {@link TestCategory}
* @see Conditional
*
* @author Camille Letavernier
*
*/
public class ClassificationRunner extends BlockJUnit4ClassRunner {
private final ClassificationRunnerImpl impl;
public ClassificationRunner(Class<?> klass) throws InitializationError {
super(klass);
this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() {
@Override
public void runChild(FrameworkMethod method, RunNotifier notifier) {
ClassificationRunner.super.runChild(method, notifier);
}
@Override
public Description describeChild(FrameworkMethod method) {
return ClassificationRunner.super.describeChild(method);
}
@Override
public Object createTest() throws Exception {
return ClassificationRunner.super.createTest();
}
@Override
public List<TestRule> getTestRules(Object target) {
return ClassificationRunner.super.getTestRules(target);
}
@Override
public Statement classBlock(RunNotifier notifier) {
return ClassificationRunner.super.classBlock(notifier);
}
});
}
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
impl.runChild(method, notifier);
}
@Override
protected Object createTest() throws Exception {
return impl.createTest();
}
@Override
protected List<TestRule> getTestRules(Object target) {
return impl.getTestRules(target);
}
@Override
protected Statement classBlock(RunNotifier notifier) {
return impl.classBlock(notifier);
}
}
/*****************************************************************************
* Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - add support for conditional tests
* Christian W. Damus (CEA) - bug 432813
* Christian W. Damus (CEA) - bug 434993
* Christian W. Damus (CEA) - bug 436047
* Christian W. Damus - bug 485156
*
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.eclipse.core.commands.operations.DefaultOperationHistory;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.papyrus.infra.tools.util.ListHelper;
import org.eclipse.papyrus.junit.framework.classification.rules.ConditionRule;
import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
import com.google.common.base.Predicates;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
/**
* Internal implementation of the common classification-sensitive behaviour
* of the {@link ClassificationRunner} and {@link ClassificationRunnerWithParameters}
* test runners.
*
* @author Camille Letavernier
*/
class ClassificationRunnerImpl {
private final static long EVENT_LOOP_TIMEOUT = 2L * 60L * 1000L; // 2 minutes in millis
private final static long ONE_MB = 1024L * 1024L; // a megabyte, in bytes
private static final Supplier<TestRule> uiFlusherRuleSupplier = createUIFlusherRuleSupplier();
private final ThreadLocal<Object> preparedTest = new ThreadLocal<Object>();
private final Delegate delegate;
ClassificationRunnerImpl(Delegate delegate) throws InitializationError {
super();
this.delegate = delegate;
}
final void runChild(FrameworkMethod method, RunNotifier notifier) {
List<Annotation> allAnnotations = ListHelper.asList(method.getAnnotations());
allAnnotations.addAll(Arrays.asList(method.getMethod().getDeclaringClass().getAnnotations()));
if (ClassificationConfig.shouldRun(allAnnotations.toArray(new Annotation[allAnnotations.size()])) && conditionSatisfied(method)) {
delegate.runChild(method, notifier);
} else {
Description description = delegate.describeChild(method);
notifier.fireTestIgnored(description);
}
}
final Object createTest() throws Exception {
// Look for a prepared test instance
Object result = preparedTest.get();
if (result != null) {
// We won't need this test instance again
clearPreparedTest();
} else {
result = delegate.createTest();
}
return result;
}
final Object prepareTest() throws Exception {
// Prepare the test instance and stash it to return on the next invocation
Object result = delegate.createTest();
preparedTest.set(result);
return result;
}
final void clearPreparedTest() {
preparedTest.remove();
}
private boolean conditionSatisfied(FrameworkMethod method) {
boolean result = true;
// Does this test declare some precondition?
Conditional conditional = method.getAnnotation(Conditional.class);
if (conditional != null) {
try {
// We need the test instance to invoke the condition on it, so prepare it now
Object test = prepareTest();
result = ConditionRule.testCondition(method.getMethod().getDeclaringClass(), conditional, test);
} catch (Throwable t) {
// If we couldn't create the test, then we should just ignore it
result = false;
} finally {
if (!result) {
// We won't be running the test, so forget the prepared instance (if any)
clearPreparedTest();
}
}
}
return result;
}
List<TestRule> getTestRules(Object target) {
// MemoryLeakRules must be the outer-most rules, because leak assertions must only happen after all possible tear-down actions have run
return reorderForMemoryLeakRules(delegate.getTestRules(target));
}
private List<TestRule> reorderForMemoryLeakRules(List<TestRule> rules) {
// Quick scan for memory rules
if (!rules.isEmpty()) {
int memoryRuleCount = Iterables.size(Iterables.filter(rules, Predicates.instanceOf(MemoryLeakRule.class)));
if (memoryRuleCount > 0) {
// Bubble the memory rules to the end
int limit = rules.size() - memoryRuleCount;
for (int i = 0; i < limit; i++) {
if (rules.get(i) instanceof MemoryLeakRule) {
// Move the rule to the end and take a step back to get the next element
rules.add(rules.remove(i--));
}
}
}
}
return rules;
}
Statement classBlock(RunNotifier notifier) {
Statement result = delegate.classBlock(notifier);
// Wrap the class suite in a rule that flushes the UI thread to release memory referenced by UI runnables
TestRule uiFlusher = uiFlusherRuleSupplier.get();
if (uiFlusher != null) {
// This rule doesn't need any actual test description
result = uiFlusher.apply(result, Description.EMPTY);
}
return result;
}
private static Supplier<TestRule> createUIFlusherRuleSupplier() {
Supplier<TestRule> result = Suppliers.ofInstance(null);
try {
if (PlatformUI.isWorkbenchRunning()) {
result = Suppliers.memoize(new Supplier<TestRule>() {
@Override
public TestRule get() {
if (Display.getCurrent() != null) {
return new TestWatcher() {
@Override
protected void finished(Description description) {
final Display display = Display.getCurrent();
if (display == null) {
// Can't do UI manipulations and history listener hacking except on the UI thread
return;
}
flushUIEventQueue(display);
purgeZombieHistoryListeners();
clearDecorationScheduler();
}
};
}
return null;
}
});
}
} catch (LinkageError e) {
// Not running in Eclipse UI context. Fine
}
return result;
}
private static void flushUIEventQueue(Display display) {
long base = System.currentTimeMillis();
long timeout = EVENT_LOOP_TIMEOUT;
// Flush the UI thread's pending events
while (!display.isDisposed()) {
try {
if (!display.readAndDispatch()) {
break;
}
} catch (Exception e) {
// Ignore it
}
long now = System.currentTimeMillis();
if ((now - base) > timeout) {
// This seems to be taking a really long time. What's up?
base = now;
timeout = timeout * 3L / 2L; // Exponential back-off to avoid over-reporting
int freeMB = (int) (Runtime.getRuntime().freeMemory() / ONE_MB);
System.err.printf("========%nUI event queue clean-up seems to be running long.%nCurrent free memory: %d MB%n========%n%n", freeMB);
}
}
}
private static void purgeZombieHistoryListeners() {
// If there are no editors open any longer, then all of the action handlers currently
// listening to the operation history are leaked, so remove them. This ensures that we
// do not end up wasting time in notifying thousands of dead/broken/useless listeners
// every time a test case executes an operation on the history (which happens *a lot*)
IWorkbench bench = PlatformUI.getWorkbench();
IWorkbenchWindow window = (bench == null) ? null : bench.getActiveWorkbenchWindow();
if ((window == null) && (bench != null) && (bench.getWorkbenchWindowCount() > 0)) {
window = bench.getWorkbenchWindows()[0];
}
if (window != null && window.getActivePage().getEditorReferences().length == 0) {
final ListenerList historyListeners = OperationHistoryHelper.getOperationHistoryListeners();
final Object[] listeners = historyListeners.getListeners();
for (int i = 0; i < listeners.length; i++) {
if (OperationHistoryHelper.shouldRemoveHistoryListener(listeners[i])) {
historyListeners.remove(listeners[i]);
}
}
}
}
private static void clearDecorationScheduler() {
IWorkbench bench = PlatformUI.getWorkbench();
if (bench != null) {
IBaseLabelProvider bogusProvider = new BaseLabelProvider();
try {
// The DecoratorManager is a label-provider listener and
// it clears the scheduler on label-provider change events
((ILabelProviderListener) bench.getDecoratorManager()).labelProviderChanged(new LabelProviderChangedEvent(bogusProvider));
} finally {
bogusProvider.dispose();
}
}
}
//
// Nested types
//
static class OperationHistoryHelper {
static final Field listenersField;
static final Set<Class<?>> historyListenerClasses;
static {
try {
listenersField = DefaultOperationHistory.class.getDeclaredField("listeners");
listenersField.setAccessible(true);
historyListenerClasses = Sets.<Class<?>> newHashSet( //
Platform.getBundle("org.eclipse.gmf.runtime.diagram.ui.actions").loadClass("org.eclipse.gmf.runtime.diagram.ui.actions.internal.PropertyChangeContributionItem"), //
Platform.getBundle("org.eclipse.ui.workbench").loadClass("org.eclipse.ui.operations.OperationHistoryActionHandler$HistoryListener"));
} catch (Exception e) {
throw new ExceptionInInitializerError(e);
}
}
static ListenerList getOperationHistoryListeners() {
try {
return (ListenerList) listenersField.get(PlatformUI.getWorkbench().getOperationSupport().getOperationHistory());
} catch (Exception e) {
org.junit.Assert.fail(e.getLocalizedMessage());
return null; // Unreachable
}
}
static boolean shouldRemoveHistoryListener(Object listener) {
boolean result = historyListenerClasses.contains(listener.getClass().getName());
if (!result) {
// Maybe it's a subclass
for (Class<?> next : historyListenerClasses) {
if (next.isInstance(listener)) {
// Remember this
historyListenerClasses.add(listener.getClass());
result = true;
break;
}
}
}
return result;
}
}
/**
* Protocol for a delegate that provides the default test framework behaviour
* for the classification runner. These methods are as specified by the
* corresponding APIs of the {@link BlockJUnit4ClassRunner} class.
*/
interface Delegate {
void runChild(FrameworkMethod method, RunNotifier notifier);
Description describeChild(FrameworkMethod method);
Object createTest() throws Exception;
List<TestRule> getTestRules(Object target);
Statement classBlock(RunNotifier notifier);
}
}
/*****************************************************************************
* Copyright (c) 2016 Christian W. Damus 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:
* Christian W. Damus - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.util.List;
import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.junit.runners.Parameterized.UseParametersRunnerFactory;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
import org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters;
import org.junit.runners.parameterized.TestWithParameters;
/**
* A Test Runner which is aware of Classification-related annotations and {@link Conditional @Conditional} tests,
* for use with test {@link Parameters}.
*
* It ignores the test methods according to their annotations, and the policy defined
* in {@link ClassificationConfig}.
*
* @see Parameterized
* @see UseParametersRunnerFactory
* @see ClassificationRunnerWithParametersFactory
* @see ClassificationConfig
* @see TestCategory
* @see Conditional
*
*/
public class ClassificationRunnerWithParameters extends BlockJUnit4ClassRunnerWithParameters {
private final ClassificationRunnerImpl impl;
public ClassificationRunnerWithParameters(TestWithParameters test) throws InitializationError {
super(test);
this.impl = new ClassificationRunnerImpl(new ClassificationRunnerImpl.Delegate() {
@Override
public void runChild(FrameworkMethod method, RunNotifier notifier) {
ClassificationRunnerWithParameters.super.runChild(method, notifier);
}
@Override
public Description describeChild(FrameworkMethod method) {
return ClassificationRunnerWithParameters.super.describeChild(method);
}
@Override
public Object createTest() throws Exception {
return ClassificationRunnerWithParameters.super.createTest();
}
@Override
public List<TestRule> getTestRules(Object target) {
return ClassificationRunnerWithParameters.super.getTestRules(target);
}
@Override
public Statement classBlock(RunNotifier notifier) {
return ClassificationRunnerWithParameters.super.classBlock(notifier);
}
});
}
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
impl.runChild(method, notifier);
}
@Override
public Object createTest() throws Exception {
return impl.createTest();
}
@Override
protected List<TestRule> getTestRules(Object target) {
return impl.getTestRules(target);
}
@Override
protected Statement classBlock(RunNotifier notifier) {
return impl.classBlock(notifier);
}
}
/*****************************************************************************
* Copyright (c) 2016 Christian W. Damus 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:
* Christian W. Damus - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import org.junit.runner.RunWith;
import org.junit.runner.Runner;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.UseParametersRunnerFactory;
import org.junit.runners.model.InitializationError;
import org.junit.runners.parameterized.ParametersRunnerFactory;
import org.junit.runners.parameterized.TestWithParameters;
/**
* Factory for classification-sensitive parameterized test suites.
* Specify this factory in the {@literal @}{@link UseParametersRunnerFactory}
* annotation on your <tt>{@literal @}{@link RunWith}({@link Parameterized}.class)</tt>
* test class to support the classfication and condition annotations of the Papyrus
* test framework.
*
* @see Parameterized
* @see UseParametersRunnerFactory
* @since 1.2
*/
public class ClassificationRunnerWithParametersFactory implements ParametersRunnerFactory {
public ClassificationRunnerWithParametersFactory() {
super();
}
@Override
public Runner createRunnerForTestWithParameters(TestWithParameters test) throws InitializationError {
return new ClassificationRunnerWithParameters(test);
}
}
/*****************************************************************************
* Copyright (c) 2015 Christian W. Damus 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:
* Christian W. Damus - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Collections;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.Suite;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.RunnerBuilder;
import org.junit.runners.model.Statement;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.ObjectArrays;
/**
* A specialized Test {@linkplain Suite Suite} runner that recognizes the Papyrus-specific
* {@link ClassificationConfig classification} annotations on the suite as a whole. It also
* supports a dynamic specification of test suites to include via the {@literal @}{@link DynamicClasses}
* annotation, especially useful for generated tests that may or may not have been generated at
* the time of test execution (or at least of compilation of the test suite class).
*/
public class ClassificationSuite extends Suite {
/**
* Mapping of whether any tests at all in a suite tree are statically enabled, according to
* their annotations.
*/
private static final LoadingCache<Description, Boolean> enabledSuites = CacheBuilder.newBuilder().build(
CacheLoader.from(ClassificationSuite::isEnabled));
private Description description;
public ClassificationSuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
this(builder, klass, getAnnotatedClasses(klass));
}
public ClassificationSuite(Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
super(klass, withDynamicSuites(klass, suiteClasses));
}
public ClassificationSuite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
super(builder, klass, withDynamicSuites(klass, suiteClasses));
}
private static Class<?>[] getAnnotatedClasses(Class<?> class_) throws InitializationError {
SuiteClasses annotation = class_.getAnnotation(SuiteClasses.class);
if (annotation == null) {
throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", class_.getName()));
}
return annotation.value();
}
private static Class<?>[] withDynamicSuites(Class<?> suiteClass, Class<?>[] staticSuites) {
Class<?>[] result = staticSuites;
Class<?>[] dynamicSuites = getDynamicSuites(suiteClass);
if (dynamicSuites.length > 0) {
result = ObjectArrays.concat(staticSuites, dynamicSuites, Class.class);
}
return result;
}
private static Class<?>[] getDynamicSuites(Class<?> suiteClass) {
List<Class<?>> result;
DynamicClasses dynclasses = suiteClass.getAnnotation(DynamicClasses.class);
if (dynclasses == null) {
result = Collections.emptyList();
} else {
result = Lists.newArrayListWithCapacity(dynclasses.value().length);
for (String classname : dynclasses.value()) {
try {
result.add(suiteClass.getClassLoader().loadClass(classname));
} catch (Exception e) {
// OK. It's not there, so we just ignore it
}
}
}
return Iterables.toArray(result, Class.class);
}
@Override
protected List<Runner> getChildren() {
// If I don't match the current configuration, none of my tests will run, so don't even provide them
// because they just inflate the size of the progress meter
if (ClassificationConfig.shouldRun(getRunnerAnnotations())) {
return super.getChildren();
} else {
return Collections.emptyList();
}
}
@Override
public void run(RunNotifier notifier) {
// If I don't match the current configuration, none of my tests should be run
if (ClassificationConfig.shouldRun(getRunnerAnnotations())) {
super.run(notifier);
} else {
Description description = getDescription();
notifier.fireTestIgnored(description);
}
}
@Override
protected Statement classBlock(final RunNotifier notifier) {
// We never throw in these lazy calculations
return enabledSuites.getUnchecked(getDescription())
// Include the @BeforeClass, @AfterClass, and @ClassRule steps
? super.classBlock(notifier)
// Just the bare bones to record everything that is skipped
: skipAll(notifier);
}
@Override
public Description getDescription() {
if (description == null) {
description = super.getDescription();
}
return description;
}
/**
* Creates a statement that simply skips all of the tests in my suite, recursively.
*
* @param notifier
* tracks the execution (or, rather, skipping) of the tests
*
* @return the all-skipping statement
*/
protected Statement skipAll(RunNotifier notifier) {
return new Statement() {
@Override
public void evaluate() {
skipAll(getDescription(), notifier);
}
};
}
/**
* Skips all of the tests in the given {@code suite}, recursively.
*
* @param suite
* a test suite to skip
* @param notifier
* tracks the execution (or, rather, skipping) of the tests
*/
protected void skipAll(Description suite, RunNotifier notifier) {
for (Description next : suite.getChildren()) {
if (next.isSuite()) {
skipAll(next, notifier);
} else {
notifier.fireTestIgnored(next);
}
}
notifier.fireTestIgnored(suite);
}
/**
* Queries whether a given {@code suite} will run any tests at all.
*
* @param suite
* a test suite
* @return whether it has any leaf tests that will not be ignored for some reason
*/
static boolean isEnabled(Description suite) {
boolean result = false;
for (Description leaf : getLeafTests(suite)) {
Iterable<Annotation> annotations = Iterables.concat(
leaf.getAnnotations(),
Arrays.asList(leaf.getTestClass().getAnnotations()));
if (ClassificationConfig.shouldRun(Iterables.toArray(annotations, Annotation.class))) {
result = true;
break;
}
}
return result;
}
/**
* Obtains an iteration of all of the leaf-level tests in a {@code suite}, in depth-first order.
*
* @param suite
* a test suite to iterate
*
* @return all of its leaf-level tests
*/
static Iterable<Description> getLeafTests(Description suite) {
return new Iterable<Description>() {
@Override
public Iterator<Description> iterator() {
return new AbstractIterator<Description>() {
Deque<Iterator<Description>> stack = new ArrayDeque<>();
Iterator<Description> current = suite.getChildren().iterator();
// Advance the tractor
Iterator<Description> feed() {
while (!current.hasNext()) {
current = stack.pollLast();
if (current == null) {
current = Collections.emptyIterator();
break;
}
}
return current;
}
void push(Description suite) {
stack.addLast(current);
current = suite.getChildren().iterator();
}
@Override
protected Description computeNext() {
Description result = null;
while ((result == null) && feed().hasNext()) {
Description next = feed().next();
if (next.isTest() && (next.getTestClass() != null)) {
result = next;
} else if (next.isSuite()) {
// Push this suite onto the stack
push(next);
} else {
// Otherwise it's a weird test without a class?!?
System.err.println("Leaf test without a class: " + next);
}
}
if (result == null) {
result = endOfData();
}
return result;
}
};
}
};
}
//
// Nested types
//
/**
* An annotation like the {@literal @}{@link SuiteClasses} that specifies, by name, test suite classes
* to find and include dynamically. Any that are not available are simply ignored.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface DynamicClasses {
/**
* Names of test suite classes to optionally include in the test suite.
*/
String[] value();
}
}
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
*
* 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that a test is expensive, and should be excluded from a Lightweight test job (e.g. Gerrit)
*
*
* This annotation must be used with the {@link ClassificationRule}
*
* @author Camille Letavernier
*
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface ExpensiveTest {
/**
* A description
*
* @return
*/
String value() default "";
}
/*****************************************************************************
* Copyright (c) 2014 CEA LIST.
*
* 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:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.junit.framework.classification;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that a test currently fails. It can be used to sort new (unidentified) regressions
* from known (reported) issues.
*
* This annotation must be used with the {@link ClassificationRule}
*
* @author Camille Letavernier
*
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface FailingTest {
/**
* A specific message explaining why this test is failing
*
* @return
*/
String value() default "";
}