Commit 9971a7a9 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

OOP: added semantic test to regressiontests


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 7a41e75c
/******************************************************************************
* Copyright (c) 2000-2021 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Magyari, Miklos
*
******************************************************************************/
module classesNegativeSemantic {
type component CT {
port PT pt_PT;
}
type port PT message { inout integer; } with { extension "internal" }
type union MyUnion {
integer a,
charstring b
};
type class CorrectClass1 { }
type class BadInheritance extends MyUnion {
}
}
......@@ -23,7 +23,8 @@ import org.junit.runners.Suite.SuiteClasses;
ExpectedValueTypeTest.class,
Structured.class,
ConfigFileTest.class,
OOP_Syntax_tests.class
OOP_Syntax_tests.class,
OOP_Semantic_tests.class
})
public class Basic_tests {
}
/******************************************************************************
* Copyright (c) 2000-2021 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
******************************************************************************/
package org.eclipse.titan.regressiontests.designer.statictests.Basic_tests;
import java.util.ArrayList;
import org.eclipse.core.resources.IMarker;
import org.eclipse.titan.designer.Activator;
import org.eclipse.titan.designer.preferences.PreferenceConstants;
import org.eclipse.titan.regressiontests.designer.Designer_plugin_tests;
import org.eclipse.titan.regressiontests.library.MarkerToCheck;
import org.junit.BeforeClass;
import org.junit.Test;
public class OOP_Semantic_tests {
private static final String DIR_PATH = "src/Basic_tests/";
private static final String OOP_NEGATIVE_BASIC_SEMANTIC = "/OopNegativeSemanticTest.ttcn";
private static boolean parseOOP;
@BeforeClass
public static void setUp() throws Exception {
parseOOP = Activator.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.ENABLEOOPEXTENSION);
if (parseOOP)
return;
Designer_plugin_tests.ignoreMarkersOnFile(DIR_PATH + OOP_NEGATIVE_BASIC_SEMANTIC);
}
@Test
public void OOPNegativeSemantic_Test() throws Exception {
if (parseOOP)
Designer_plugin_tests.checkSemanticMarkersOnFile(oopNegative_ttcn_initializer(), DIR_PATH + OOP_NEGATIVE_BASIC_SEMANTIC);
}
private ArrayList<MarkerToCheck> oopNegative_ttcn_initializer() {
//oopNegativeSemanticTest.ttcn
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(1);
int lineNum = 28;
markersToCheck.add(new MarkerToCheck("class type expected", lineNum, IMarker.SEVERITY_ERROR));
return markersToCheck;
}
}
......@@ -54,11 +54,11 @@ public class OOP_Syntax_tests {
}
private ArrayList<MarkerToCheck> oopNegative_ttcn_initializer() {
//oopNegative.ttcn
//oopNegativeBasicSyntax.ttcn
ArrayList<MarkerToCheck> markersToCheck = new ArrayList<MarkerToCheck>(1);
int lineNum = 21;
markersToCheck.add(new MarkerToCheck("mismatched input ';' expecting '{'", lineNum, IMarker.SEVERITY_ERROR));
return markersToCheck;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment