-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#71 Add JUnit tests on business queries/ I_22 / sirius tables
Change-Id: Iddf9dfc499047c05ca9bcdbdb57a1c5c07a0ac90 Signed-off-by: Erwann Traisnel <erwann.traisnel@obeo.fr>
- Loading branch information
1 parent
6ebb220
commit 585e871
Showing
16 changed files
with
5,862 additions
and
7 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...rement/tests/org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>tableRequirements</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.polarsys.capella.project.nature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
...rement.tests.ju/model/CrossTable-OA/.settings/org.polarsys.capella.core.preferences.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cleanPreviousValidationResults=true | ||
eclipse.preferences.version=1 |
6 changes: 6 additions & 0 deletions
6
...sts/org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OA.afm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata:Metadata xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:metadata="http://www.polarsys.org/kitalpha/ad/metadata/1.0.0" id="_AQFFEPOBEeaZnfll6B5lKw"> | ||
<viewpointReferences id="_AbGpUPOBEeaZnfll6B5lKw" vpId="org.polarsys.capella.core.viewpoint" version="7.0.0"/> | ||
<viewpointReferences id="_B-acIDwuEe66NYq4UIzSXQ" vpId="org.polarsys.capella.basic.requirement" version="1.0.0"/> | ||
<additionalMetadata href="CrossTable-OAlib.afm#_FHHgMDwzEe66NYq4UIzSXQ"/> | ||
</metadata:Metadata> |
451 changes: 451 additions & 0 deletions
451
...ts/org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OA.aird
Large diffs are not rendered by default.
Oops, something went wrong.
486 changes: 486 additions & 0 deletions
486
...org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OA.capella
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
.../org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OAlib.afm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<metadata:Metadata xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:metadata="http://www.polarsys.org/kitalpha/ad/metadata/1.0.0" id="_FHHgMDwzEe66NYq4UIzSXQ"> | ||
<viewpointReferences id="_FHXX0DwzEe66NYq4UIzSXQ" vpId="org.polarsys.capella.core.viewpoint" version="7.0.0"/> | ||
<viewpointReferences id="_JO8lUDxAEe66rLiMTK70NQ" vpId="org.polarsys.capella.basic.requirement" version="1.0.0"/> | ||
</metadata:Metadata> |
29 changes: 29 additions & 0 deletions
29
...org.polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OAlib.aird
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description" uid="_FHIuUDwzEe66NYq4UIzSXQ" selectedViews="_FHmoYDwzEe66NYq4UIzSXQ _FIgnUDwzEe66NYq4UIzSXQ _FLebwDwzEe66NYq4UIzSXQ _FMbeADwzEe66NYq4UIzSXQ _FMhkoDwzEe66NYq4UIzSXQ _FNTAsDwzEe66NYq4UIzSXQ _FOUUYDwzEe66NYq4UIzSXQ _JPRVcDxAEe66rLiMTK70NQ" version="15.2.0.202303281325"> | ||
<semanticResources>CrossTable-OAlib.afm</semanticResources> | ||
<semanticResources>CrossTable-OAlib.capella</semanticResources> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FHmoYDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.kitalpha.ad.integration.sirius/description/ad.odesign#//@ownedViewpoints[name='ad']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FIgnUDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/physical.odesign#//@ownedViewpoints[name='Physical%20Architecture']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FLebwDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/context.odesign#//@ownedViewpoints[name='System%20Analysis']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FMbeADwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/EPBS.odesign#//@ownedViewpoints[name='EPBS%20architecture']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FMhkoDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/oa.odesign#//@ownedViewpoints[name='Operational%20Analysis']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FNTAsDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/common.odesign#//@ownedViewpoints[name='Common']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_FOUUYDwzEe66NYq4UIzSXQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.core.sirius.analysis/description/logical.odesign#//@ownedViewpoints[name='Logical%20Architecture']"/> | ||
</ownedViews> | ||
<ownedViews xmi:type="viewpoint:DView" uid="_JPRVcDxAEe66rLiMTK70NQ"> | ||
<viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.polarsys.capella.basic.requirement.sirius.analysis/description/Requirement.odesign#//@ownedViewpoints[name='Requirement']"/> | ||
</ownedViews> | ||
</viewpoint:DAnalysis> |
282 changes: 282 additions & 0 deletions
282
....polarsys.capella.basic.requirement.tests.ju/model/CrossTable-OA/CrossTable-OAlib.capella
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...c/org/polarsys/capella/basic/requirement/tests/ju/CapellaElement_OutgoingRequirement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. | ||
* | ||
* 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 | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.basic.requirement.tests.ju; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.polarsys.capella.test.business.queries.ju.BQTestCase; | ||
|
||
/** | ||
* @generated | ||
*/ | ||
public class CapellaElement_OutgoingRequirement extends BQTestCase { | ||
|
||
/** | ||
* @generated | ||
*/ | ||
public String getProjectForTest() { | ||
return "CrossTable-OA"; //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @generated | ||
*/ | ||
public String getLibProjectForTest() { | ||
return ""; //$NON-NLS-1$ | ||
} | ||
|
||
@Override | ||
public List<String> getRequiredTestModels() { | ||
return Arrays.asList(new String[] { getProjectForTest() }); | ||
} | ||
|
||
/** | ||
* @generated | ||
*/ | ||
@Override | ||
public String getBQFullQualifiedName() { | ||
return "org.polarsys.capella.basic.requirement.business.queries.CapellaElement_OutgoingRequirement"; //$NON-NLS-1$ | ||
} | ||
|
||
} |
153 changes: 153 additions & 0 deletions
153
...nt.tests.ju/src/org/polarsys/capella/basic/requirement/tests/ju/CrossTableOATestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. | ||
* | ||
* 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 | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.basic.requirement.tests.ju; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.sirius.table.metamodel.table.DTable; | ||
import org.polarsys.capella.basic.requirement.sirius.analysis.IRequirementDiagramNameConstants; | ||
|
||
public class CrossTableOATestCase extends RequirementsTableTestFramework { | ||
|
||
|
||
@Override | ||
public void test() throws Exception { | ||
init(); | ||
createTable(context, operationalAnalysisId, | ||
IRequirementDiagramNameConstants.OPERATIONAL_ACTIVITIES_REQUIREMENTS_DIAGRAM_NAME); | ||
DTable table = openTable(context, crossTableOAName); | ||
|
||
/** | ||
* Create requirement Trace between Capture Meteorological Data OA and Requirement Requirement Trace is created | ||
* between Capture Meteorological Data OA and Requirement\ with source element the OA and the target element as the | ||
* requirement | ||
*/ | ||
createRequirementTrace(table, _captureMetDataOA, _captureMetDataReq); | ||
|
||
/** | ||
* Create requirement Trace between Publish Meteorological Report OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Publish Meteorological Report OA and Requirement with source element the OA | ||
* and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _publishMetReportOA, _publishMetReportReq); | ||
|
||
/** | ||
* Create requirement Trace between Build Meteorological Report OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Build Meteorological Report OA and Requirement with source element the OA | ||
* and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _buildMetReportOA, _buildMetReportReq); | ||
|
||
/** | ||
* Create requirement Trace between Elaborate Meteorological Forecast OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Elaborate Meteorological Forecast OA and Requirement with source element the | ||
* OA and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _elabMetForecastOA, _elabMetForecastReq); | ||
|
||
/** | ||
* Create requirement Trace between Elaborate Current Situation OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Elaborate Current Situation OA and Requirement with source element the OA | ||
* and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _elabCurrSituationOA, _elabCurrSituationReq); | ||
|
||
/** | ||
* Create requirement Trace between Access Meteorological Report OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Access Meteorological Report OA and Requirement with source element the OA | ||
* and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _accessMetReportOA, _accessMetReportReq); | ||
|
||
/** | ||
* Create requirement Trace between Make Meteorological Data Evolve OA and Requirement | ||
* <P> | ||
* Requirement Trace is created between Make Meteorological Data Evolve OA and Requirement with source element the | ||
* OA and the target element as the requirement | ||
*/ | ||
createRequirementTrace(table, _makeMetDataEvolveOA, _makeMetDataEvolveReq); | ||
|
||
/** | ||
* Delete requirement Trace between Capture Meteorological Data OA and Requirement | ||
* <P> | ||
* Requirement Trace is deleted between Capture Meteorological Data OA and Requirement with source element the OA | ||
* and the target element as the requirement | ||
*/ | ||
deleteRequirementTrace(table, _captureMetDataOA, _captureMetDataReq); | ||
|
||
/** | ||
* Hide the OA "Publish Meteorological Report" from the table | ||
* <P> | ||
* The OA "Publish Meteorological Report" is hidden from the table | ||
*/ | ||
hideLine(context, table, _publishMetReportOA); | ||
|
||
/** | ||
* Hide the OA "Deliver Meteorological Information" from the table | ||
* <P> | ||
* The OA "Deliver Meteorological Information" is hidden from the table as well as all its children OA | ||
*/ | ||
hideLineWithChildren(table, _deliverMetInfoOA); | ||
|
||
/** | ||
* Hide the Requirement "Capture Meteorological Data" column from the table | ||
* <P> | ||
* The Requirement "Capture Meteorological Data" column is hidden from the table | ||
*/ | ||
hideColumn(context, table, _captureMetDataReq); | ||
|
||
/** | ||
* Execute Show/Hide lines with Elaborate Met Forecast OA and Make Met Data Evolve OA unselected and the rest of the | ||
* OAs selected | ||
* <P> | ||
* Elaborate Met Forecast OA and Make Met Data Evolve OA are hidden and all other lines are shown in the table | ||
*/ | ||
List<EObject> visibleLines = Arrays.asList(_deliverMetInfoOA, _publishMetReportOA, _buildMetReportOA, | ||
_elabCurrSituationOA, _accessMetReportOA, _captureMetDataOA); | ||
List<EObject> hiddenLines = Arrays.asList(_elabMetForecastOA, _makeMetDataEvolveOA); | ||
hideLines(context, table, visibleLines, hiddenLines); | ||
|
||
/** | ||
* Execute Show/Hide Columns with Capture Met Data, Elaborate Current Situation, and Publish Met Report requirements | ||
* unselected and the rest of the requirements selected | ||
* <P> | ||
* Capture Met Data, Elaborate Current Situation, and Publish Met Report requirement columns are hidden and all | ||
* other columns are shown in the table | ||
*/ | ||
List<EObject> visibleColumns = Arrays.asList(_buildMetReportReq, _elabMetForecastReq, _accessMetReportReq, | ||
_makeMetDataEvolveReq); | ||
List<EObject> hiddenColumns = Arrays.asList(_captureMetDataReq, _elabCurrSituationReq, _publishMetReportReq); | ||
hideColumns(context, table, visibleColumns, hiddenColumns); | ||
|
||
/** | ||
* Execute Show All Lines command on the table | ||
* <P> | ||
* All Lines in the table become visible | ||
*/ | ||
showAllLines(context, table); | ||
|
||
/** | ||
* Execute Show All Columns command on the table | ||
* <P> | ||
* All Columns in the table become visible | ||
*/ | ||
showAllColumns(context, table); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...sts.ju/src/org/polarsys/capella/basic/requirement/tests/ju/RequirementsTableTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. | ||
* | ||
* 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 | ||
* | ||
* Contributors: | ||
* Thales - initial API and implementation | ||
*******************************************************************************/ | ||
package org.polarsys.capella.basic.requirement.tests.ju; | ||
|
||
import org.eclipse.sirius.table.metamodel.table.DTable; | ||
import org.polarsys.capella.basic.requirement.sirius.analysis.IRequirementDiagramNameConstants; | ||
|
||
public class RequirementsTableTestCase extends RequirementsTableTestFramework { | ||
|
||
@Override | ||
public void test() throws Exception { | ||
init(); | ||
DTable table = createTable(context, rootReqPkgId, IRequirementDiagramNameConstants.REQUIREMENTS_DIAGRAM_NAME); | ||
|
||
/** | ||
* Create a new System User Requirement SUR1 in Root Req Pkg | ||
* <P> | ||
* New System User Requirement is created and added under Root Req Pkg | ||
*/ | ||
_systemUserReq = createRequirementSUR(table, _rootReqPkg); | ||
|
||
/** | ||
* Create a new System Functional Requirement SFR in Root Req Pkg | ||
* <P> | ||
* New System Functional Requirement is created and added under Root Req Pkg | ||
*/ | ||
_systemFuncReq = createRequirementSFR(table, _rootReqPkg); | ||
|
||
/** | ||
* Create a new System Functional Interface Requirement SFIR in Root Req Pkg | ||
* <P> | ||
* New System User Requirement is created and added under Root Req Pkg | ||
*/ | ||
createRequirementSFIR(table, _rootReqPkg); | ||
|
||
/** | ||
* Create a new System Non Functional Requirement SNFR in Root Req Pkg | ||
* <P> | ||
* New System Non Functional Requirement is created and added under Root Req Pkg | ||
*/ | ||
createRequirementSNFR(table, _rootReqPkg); | ||
|
||
/** | ||
* Create a new System Non Functional Interface Requirement SNFIR in Root Req Pkg | ||
* <P> | ||
* New System Non Functional Interface Requirement is created and added under Root Req Pkg | ||
*/ | ||
createRequirementSNFIR(table, _rootReqPkg); | ||
|
||
/** | ||
* Create a new Sub Req Pkg in Root Req Pkg | ||
* <P> | ||
* New Sub Req Pkg is created and added under Root Req Pkg | ||
*/ | ||
createRequirementREQPKG(table, _rootReqPkg); | ||
|
||
} | ||
} |
Oops, something went wrong.