Skip to content

Commit

Permalink
[junits] (#74)
Browse files Browse the repository at this point in the history
Change-Id: I12e051504d6ad85d97415366a579e79775505460
Signed-off-by: Georgiana-Elena ECOBICI <georgiana-elena.ecobici@thalesgroup.com>

Co-authored-by: Georgiana-Elena ECOBICI <georgiana-elena.ecobici@thalesgroup.com>
  • Loading branch information
georgiana-e and georgiana-ecobici committed Nov 10, 2020
1 parent 1f90d7a commit fbf7704
Show file tree
Hide file tree
Showing 20 changed files with 8,812 additions and 8,427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TextualScenarioValidator extends AbstractTextualScenarioValidator {
}

@Check
def checkMessagesExist(SequenceMessageType message) {
def checkMessagesExist(SequenceMessage message) {
if (!EmbeddedEditorInstanceHelper.getExchangeNames(message.getSource, message.getTarget).contains(
message.name)) {
error('Exchange does not exist between \"' + message.source + "\" and \"" + message.target +"\"!"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
/*******************************************************************************
* Copyright (c) 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
******************************************************************************/
/**
* Copyright (c) 2020 THALES GLOBAL SERVICES.
*
Expand Down Expand Up @@ -107,7 +95,7 @@ public void checkParticipantKeywordIsValid(final Participant participant) {
}

@Check
public void checkMessagesExist(final SequenceMessageType message) {
public void checkMessagesExist(final SequenceMessage message) {
boolean _contains = EmbeddedEditorInstanceHelper.getExchangeNames(message.getSource(), message.getTarget()).contains(
message.getName());
boolean _not = (!_contains);
Expand Down
12,118 changes: 6,116 additions & 6,002 deletions tests/org.polarsys.capella.scenario.editor.ju/model/TextualEditor/TextualEditor.aird

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
Expand All @@ -10,15 +22,14 @@ public class ArmTimerMessagesFromXtextToDiagramTestCase extends TextualScenarioT

public static final String armTimerMessageDiagramName = "[IS] Capability 1 Arm Timer";
public static final String armTimerMessageFileContentExpected = "[IS]_Capability_1_Arm_Timer";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>(Arrays.asList("->> SA 2 : Arm Timer",
"->> SA 3 : Arm Timer"));

testUpdateDiagram(armTimerMessageDiagramName, armTimerMessageFileContentExpected,
"[IS]_Capability_1_Arm_Timer_New", elementsNew);
List<String> elementsNew = new ArrayList<String>(Arrays.asList("->> SA 2 : Arm Timer", "->> SA 3 : Arm Timer"));

testUpdateDiagram(armTimerMessageDiagramName, armTimerMessageFileContentExpected, "[IS]_Capability_1_Arm_Timer_New",
elementsNew);
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
Expand All @@ -10,14 +22,14 @@ public class CreateDeleteMessagesFromXtextToDiagramTestCase extends TextualScena

public static final String createDeleteMessageDiagramName = "[IS] Capability 1 Create Delete";
public static final String createDeleteMessageFileContentExpected = "[IS]_Capability_1_Create_Delete";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>(Arrays.asList("System ->+ SA 3 : create1",
List<String> elementsNew = new ArrayList<String>(Arrays.asList("System ->+ SA 3 : create1",
"SA 3 ->+ SA 2 : create2", "SA 2 ->x SA 3 : delete", "System ->x SA 2 : delete2"));
testUpdateDiagram(createDeleteMessageDiagramName, createDeleteMessageFileContentExpected,

testUpdateDiagram(createDeleteMessageDiagramName, createDeleteMessageFileContentExpected,
"[IS]_Capability_1_Create_Delete_New", elementsNew);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
package org.polarsys.capella.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DeleteCombinedFragmentFromXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String deleteCombinedFragmentSimpleDiagramName = "[FS] Capability 1 Combined Fragments";
public static final String deleteCombinedFragmentSimpleFileContentExpected = "[FS]_Capability_1_Combined_Fragments";
public static final String deleteCombinedFragmentESDiagramName = "[ES] Capability 1 Combined Fragments";
public static final String deleteCombinedFragmentESFileContentExpected = "[ES]_Capability_1_Combined_Fragments";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(deleteCombinedFragmentSimpleDiagramName, deleteCombinedFragmentSimpleFileContentExpected,
"[FS]_Capability_1_Combined_Fragments_New", elementsNew);
testUpdateDiagram(deleteCombinedFragmentESDiagramName, deleteCombinedFragmentESFileContentExpected,
"[ES]_Capability_1_Combined_Fragments_New", elementsNew);
}

}
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DeleteCombinedFragmentFromXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String deleteCombinedFragmentSimpleDiagramName = "[FS] Capability 1 Combined Fragments";
public static final String deleteCombinedFragmentSimpleFileContentExpected = "[FS]_Capability_1_Combined_Fragments";
public static final String deleteCombinedFragmentESDiagramName = "[ES] Capability 1 Combined Fragments";
public static final String deleteCombinedFragmentESFileContentExpected = "[ES]_Capability_1_Combined_Fragments";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(deleteCombinedFragmentSimpleDiagramName, deleteCombinedFragmentSimpleFileContentExpected,
"[FS]_Capability_1_Combined_Fragments_New", elementsNew);
testUpdateDiagram(deleteCombinedFragmentESDiagramName, deleteCombinedFragmentESFileContentExpected,
"[ES]_Capability_1_Combined_Fragments_New", elementsNew);
}

}
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
package org.polarsys.capella.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DeleteOperandsXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String deleteOperandsDiagramName = "[IS] Capability 1 Delete Operands";
public static final String deleteOperandsFileContentExpected = "[IS]_Capability_1_Delete_Operands";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(deleteOperandsDiagramName, deleteOperandsFileContentExpected,
"[IS]_Capability_1_Delete_Operands_New", elementsNew);
}

}
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DeleteOperandsXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String deleteOperandsDiagramName = "[IS] Capability 1 Delete Operands";
public static final String deleteOperandsFileContentExpected = "[IS]_Capability_1_Delete_Operands";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(deleteOperandsDiagramName, deleteOperandsFileContentExpected,
"[IS]_Capability_1_Delete_Operands_New", elementsNew);
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
Expand All @@ -12,18 +24,18 @@ public class DeleteStateFragmentFromXtextToDiagramTestCase extends TextualScenar
public static final String deleteStateFragmentSimpleFileContentExpected = "[FS]_Capability_1_(Simple)";
public static final String deleteStateFragmentESDiagramName = "[ES] Capability 1 (Simple)";
public static final String deleteStateFragmentESFileContentExpected = "[ES]_Capability_1_(Simple)";

@Override
public void test() throws Exception {
init();
List<String> elementsNew1 = new ArrayList<String>(Arrays.asList("on SystemFunction 2 state State 1"));
List<String> elementsNew2 = new ArrayList<String>(Arrays.asList("on SA 2 function SystemFunction 1"));

testUpdateDiagram(deleteStateFragmentSimpleDiagramName, deleteStateFragmentSimpleFileContentExpected,
testUpdateDiagram(deleteStateFragmentSimpleDiagramName, deleteStateFragmentSimpleFileContentExpected,
"[FS]_Capability_1_(Simple)_New", elementsNew1);
testUpdateDiagram(deleteStateFragmentESDiagramName, deleteStateFragmentESFileContentExpected,
testUpdateDiagram(deleteStateFragmentESDiagramName, deleteStateFragmentESFileContentExpected,
"[ES]_Capability_1_(Simple)_New", elementsNew2);

}

}
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
package org.polarsys.capella.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DuplicatedCombinedFragmentsAndOperandsXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String duplicatedCFAndOperandsDiagramName = "[IS] Capability 1 Duplicated CF and Operands";
public static final String duplicatedCFAndOperandsFileContentExpected = "[IS]_Capability_1_Duplicated_CF_And_Operands";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(duplicatedCFAndOperandsDiagramName, duplicatedCFAndOperandsFileContentExpected,
"[IS]_Capability_1_Duplicated_CF_And_Operands_New", elementsNew);
}

}
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
import java.util.List;

import org.polarsys.capella.scenario.editor.ju.util.TextualScenarioTestFramework;

public class DuplicatedCombinedFragmentsAndOperandsXtextToDiagramTestCase extends TextualScenarioTestFramework {

public static final String duplicatedCFAndOperandsDiagramName = "[IS] Capability 1 Duplicated CF and Operands";
public static final String duplicatedCFAndOperandsFileContentExpected = "[IS]_Capability_1_Duplicated_CF_And_Operands";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>();

testUpdateDiagram(duplicatedCFAndOperandsDiagramName, duplicatedCFAndOperandsFileContentExpected,
"[IS]_Capability_1_Duplicated_CF_And_Operands_New", elementsNew);
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*******************************************************************************
* Copyright (c) 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.scenario.editor.ju.testcases;

import java.util.ArrayList;
Expand All @@ -10,13 +22,13 @@ public class DuplicatedMessagesFromXtextToDiagramTestCase extends TextualScenari

public static final String duplicatedMessagesDiagramName = "[IS] Capability 1 Duplicated Messages";
public static final String duplicatedMessagesFileContentExpected = "[IS]_Capability_1_Duplicated_Messages";

@Override
public void test() throws Exception {
init();
List<String> elementsNew = new ArrayList<String>(Arrays.asList("SA 2 -> SA 3 : m1", "SA 2 -> SA 3 : m1"));
testUpdateDiagram(duplicatedMessagesDiagramName, duplicatedMessagesFileContentExpected,

testUpdateDiagram(duplicatedMessagesDiagramName, duplicatedMessagesFileContentExpected,
"[IS]_Capability_1_Duplicated_Messages_New", elementsNew);
}

Expand Down
Loading

0 comments on commit fbf7704

Please sign in to comment.