Skip to content

Commit

Permalink
Merge branch 'master' into merge-into-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaglam authored Nov 30, 2020
2 parents feba374 + a268507 commit cc900f5
Show file tree
Hide file tree
Showing 92 changed files with 483 additions and 450 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Vitruv-Applications-ComponentBasedSystems</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ import static tools.vitruv.applications.util.temporary.pcm.PcmRepositoryUtil.*
*
* @author Alexander Monev
*/
public class PcmJamoppUtilsGuice {
class PcmJamoppUtilsGuice {

private static val Logger logger = Logger.getLogger(PcmJamoppUtilsGuice.simpleName)
static val Logger logger = Logger.getLogger(PcmJamoppUtilsGuice.simpleName)

public static final int SELECT_KEEP_OLD_BINDING = 0;
public static final int SELECT_REPLACE_WITH_NEW_BINDING = 1;

def public static createConfigureMethodForAssemblyContext(AssemblyContext assemblyContext,
def static createConfigureMethodForAssemblyContext(AssemblyContext assemblyContext,
RepositoryComponent component, CorrespondenceModel correspondenceModel, UserInteractor userInteractor) {
var Class jaMoPPCompositeClass = null
try {
Expand All @@ -83,7 +83,7 @@ public class PcmJamoppUtilsGuice {
return classMethod
}

public def static EObject[] createBindCall(AssemblyContext assemblyContext, RepositoryComponent component,
def static EObject[] createBindCall(AssemblyContext assemblyContext, RepositoryComponent component,
ClassMethod configureMethod, CorrespondenceModel correspondenceModel, UserInteractor userInteractor) {

if (configureMethod.parameters.nullOrEmpty) {
Expand Down Expand Up @@ -397,7 +397,7 @@ public class PcmJamoppUtilsGuice {

}

def public static checkIfUserWantsToReplaceInterfaceBinding(String interfaceName, String className,
def static checkIfUserWantsToReplaceInterfaceBinding(String interfaceName, String className,
UserInteractor ui) {
val msg = "Interface " + interfaceName + " is already mapped to basic component " + className +
" . Adding another binding for the same interface will lead to a runtime exception by Guice."
Expand Down Expand Up @@ -709,15 +709,15 @@ public class PcmJamoppUtilsGuice {
return null
}

public def static saveResourceForClass(ConcreteClassifier jaMoPPClass) {
def static saveResourceForClass(ConcreteClassifier jaMoPPClass) {
jaMoPPClass.eResource.save(null)
}

public def static saveResourceForSystem(ComposedStructure system) {
def static saveResourceForSystem(ComposedStructure system) {
EcoreResourceBridge.saveResource(system.eResource)
}

public def static EObject[] createBindCallForConnector(AssemblyContext assemblyContext,
def static EObject[] createBindCallForConnector(AssemblyContext assemblyContext,
AssemblyConnector assemblyConnector, CorrespondenceModel correspondenceModel,
UserInteractor userInteractor) {
val configureMethod = correspondenceModel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import static tools.vitruv.applications.util.temporary.java.JavaTypeUtil.getNorm

class EjbJava2PcmHelper {

public static def boolean overridesInterfaceMethod(ClassMethod classMethod, Class jaMoPPClass){
static def boolean overridesInterfaceMethod(ClassMethod classMethod, Class jaMoPPClass){
return null !== getOverridenInterfaceMethod(classMethod, jaMoPPClass)
}

public static def getOverridenInterfaceMethod(ClassMethod classMethod, Class jaMoPPClass){
static def getOverridenInterfaceMethod(ClassMethod classMethod, Class jaMoPPClass){
val implementedEjbInterfaces = jaMoPPClass.implements.map[getNormalizedClassifierFromTypeReference(it)]
.filter(typeof(Interface)).filter[EjbAnnotationHelper.isEjbBuisnessInterface(it)]
for(ejbInterface : implementedEjbInterfaces){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tools.vitruv.applications.pcmjava.ejbtransformations.java2pcm.TuidUpdateP
import tools.vitruv.applications.pcmjava.util.java2pcm.Java2PcmPackagePreprocessor

class EjbJava2PcmChangePropagationSpecification extends mir.reactions.ejbjava2pcm.Ejbjava2pcmChangePropagationSpecification {
public override setup() {
override setup() {
addChangePreprocessor(new TuidUpdatePreprocessor());
addChangePreprocessor(new Java2PcmPackagePreprocessor());
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class TypeReferenceCorrespondenceHelper {
private new() {
}

private static final Logger logger = Logger.getLogger(TypeReferenceCorrespondenceHelper.simpleName)
static final Logger logger = Logger.getLogger(TypeReferenceCorrespondenceHelper.simpleName)

private static var ClaimableMap<Class<? extends PrimitiveType>, DataType> primitveTypeMappingMap;
static var ClaimableMap<Class<? extends PrimitiveType>, DataType> primitveTypeMappingMap;

private def static initPrimitiveTypeMap() {
primitveTypeMappingMap = new ClaimableHashMap
Expand Down Expand Up @@ -98,7 +98,7 @@ class TypeReferenceCorrespondenceHelper {
return primitveTypeMappingMap.claimValueForKey(primitiveType.class)
}

public def static DataType getCorrespondingPCMDataTypeForTypeReference(TypeReference typeReference,
def static DataType getCorrespondingPCMDataTypeForTypeReference(TypeReference typeReference,
CorrespondenceModel correspondenceModel, UserInteractor userInteractor, Repository repo,
long arrayDimension) {
var DataType pcmDataType = getDataTypeFromTypeReference(typeReference, correspondenceModel, userInteractor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class DataTypeCorrespondenceHelper { // FIXME TS this seems to be a utility clas
private new() {
}

private static final Logger logger = Logger.getLogger(DataTypeCorrespondenceHelper.simpleName)
static final Logger logger = Logger.getLogger(DataTypeCorrespondenceHelper.simpleName)

private static var ClaimableMap<PrimitiveTypeEnum, Type> primitveTypeMappingMap;
static var ClaimableMap<PrimitiveTypeEnum, Type> primitveTypeMappingMap;

private def static initPrimitiveTypeMap() {
primitveTypeMappingMap = new ClaimableHashMap<PrimitiveTypeEnum, Type>()
Expand All @@ -53,14 +53,14 @@ class DataTypeCorrespondenceHelper { // FIXME TS this seems to be a utility clas
primitveTypeMappingMap.put(PrimitiveTypeEnum.STRING, stringClassifier)
}

public synchronized def static Type claimJaMoPPTypeForPrimitiveDataType(PrimitiveDataType pdt) {
synchronized def static Type claimJaMoPPTypeForPrimitiveDataType(PrimitiveDataType pdt) {
if (null === primitveTypeMappingMap) {
initPrimitiveTypeMap()
}
return EcoreUtil.copy(primitveTypeMappingMap.claimValueForKey(pdt.type))
}

public static def TypeReference claimUniqueCorrespondingJaMoPPDataTypeReference(DataType dataType,
static def TypeReference claimUniqueCorrespondingJaMoPPDataTypeReference(DataType dataType,
CorrespondenceModel ci) {
if (null === dataType) {
return TypesFactory.eINSTANCE.createVoid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
package tools.vitruv.applications.umlclassumlcomponents.class2comp

public class UmlClass2UmlCompChangePropagation extends mir.reactions.class2comp.Class2compChangePropagationSpecification {

override protected setup() {
super.setup()
}

class UmlClass2UmlCompChangePropagation extends mir.reactions.class2comp.Class2compChangePropagationSpecification {
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
package tools.vitruv.applications.umlclassumlcomponents.comp2class

public class UmlComp2UmlClassChangePropagation extends mir.reactions.comp2class.Comp2classChangePropagationSpecification {

override protected setup() {
super.setup()
}

class UmlComp2UmlClassChangePropagation extends mir.reactions.comp2class.Comp2classChangePropagationSpecification {
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,24 @@ import org.eclipse.uml2.uml.Package
import static org.junit.Assert.*

class SharedIntegrationTestUtil {

public static val OUTPUT_NAME = "model/model.uml"

public static def Resource getTestModelResource(String fileName) {
static def Resource getTestModelResource(String fileName) {
val path = "TestModels/" + fileName
val resourceSet = new ResourceSetImpl()
val res = resourceSet.getResource(URI.createFileURI(path), true)
return res
}


public static def assertCountOfTypeInList(List<NamedElement> elementsList, Class<? extends NamedElement> umlType, int count) {
static def assertCountOfTypeInList(List<NamedElement> elementsList, Class<? extends NamedElement> umlType, int count) {
val typeElements = elementsList.filter(umlType)
assertEquals(count, typeElements.size)
}

public static def assertCountOfTypeInPackage(List<NamedElement> elementsList, int packageNumber, Class<? extends NamedElement> umlType, int count) {
static def assertCountOfTypeInPackage(List<NamedElement> elementsList, int packageNumber, Class<? extends NamedElement> umlType, int count) {
val packages = elementsList.filter(Package)
val packagedElements = packages.get(packageNumber).packagedElements
assertCountOfTypeInList(packagedElements.map[e | e as NamedElement], umlType, count)
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.eclipse.uml2.uml.NamedElement
import static org.junit.Assert.*

class SharedTestUtil {

/***************
*Constants:*
****************/
Expand Down Expand Up @@ -34,10 +33,9 @@ class SharedTestUtil {
*Assert Helper:*
****************/

public static def void assertTypeAndName(EObject umlObject, Class<? extends NamedElement> umlType, String name) {
static def void assertTypeAndName(EObject umlObject, Class<? extends NamedElement> umlType, String name) {
assertTrue(umlObject.class.isInstance(umlType) || umlObject.class.genericInterfaces.contains(umlType))
//Second condition encloses 'impl'-Classes
assertEquals(name, (umlObject as NamedElement).name)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import tools.vitruv.framework.userinteraction.UserInteractor

class SharedUtil {

public static def int modalTextUserinteracting(UserInteractor userInteractor, String msg, String... selections) {
static def int modalTextUserinteracting(UserInteractor userInteractor, String msg, String... selections) {
return userInteractor.singleSelectionDialogBuilder.message(msg).choices(selections)
.windowModality(WindowModality.MODAL).startInteraction()
}

public static def boolean modalTextYesNoUserInteractor(UserInteractor userInteractor, String msg) {
static def boolean modalTextYesNoUserInteractor(UserInteractor userInteractor, String msg) {
return 0 == userInteractor.modalTextUserinteracting(msg, "Yes", "No")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import org.eclipse.emf.ecore.resource.Resource
* @author Fei
*/
abstract class AbstractUmlJavaTest extends VitruviusApplicationTest {
private static val logger = Logger.getLogger(typeof(VitruviusApplicationTest).simpleName)
static val logger = Logger.getLogger(typeof(VitruviusApplicationTest).simpleName)

override protected getVitruvDomains() {
return #[new UmlDomainProvider().domain, new JavaDomainProvider().domain];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import static tools.vitruv.applications.umljava.testutil.UmlTestUtil.*
*/
class TestUtil {

private static val logger = Logger.getLogger(TestUtil)
static val logger = Logger.getLogger(TestUtil)

private new() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import edu.kit.ipd.sdq.activextendannotations.Utility
*/
@Utility
class UmlJavaTypePropagationHelper {
private static val logger = Logger.getLogger(UmlJavaTypePropagationHelper.simpleName)
static val logger = Logger.getLogger(UmlJavaTypePropagationHelper.simpleName)

public static val UML_PRIMITIVE_BOOLEAN_TAG = "Boolean"
public static val UML_PRIMITIVE_REAL_TAG = "Real"
public static val UML_PRIMITIVE_INTEGER_TAG = "Integer"
public static val UML_PRIMITIVE_STRING_TAG = "String"

private static val List<Class<?>> supportedCollectionTypes = #[ArrayList, LinkedList, HashSet]
static val List<Class<?>> supportedCollectionTypes = #[ArrayList, LinkedList, HashSet]

/**
* Prompts a message to the user that allows him to choose a collection datatype.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class JavaContainerAndClassifierUtil {
* @return the found classifier, or null if there is no matching classifer.
* @throws IllegalStateException if there are multiple classifers in the package with a matching name.
*/
public static def <T extends ConcreteClassifier> T findClassifier(String name, Package javaPackage, java.lang.Class<T> classifierType) {
static def <T extends ConcreteClassifier> T findClassifier(String name, Package javaPackage, java.lang.Class<T> classifierType) {
val matchingClassifiers = javaPackage.compilationUnits.map[it.classifiers].flatten.filter(classifierType).filter[it.name.toFirstUpper == name.toFirstUpper]
if (matchingClassifiers.size > 1) throw new IllegalStateException("Multiple matching classifers were found: " + matchingClassifiers)
return matchingClassifiers.head
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class UmlTypeUtil { // TODO TS merge with UmlClassifierAndPackagableUtil?
public static val UML_PRIMITIVE_INTEGER_TAG = "Integer"
public static val UML_PRIMITIVE_STRING_TAG = "String"

public static def List<PrimitiveType> getSupportedPredefinedUmlPrimitiveTypes(ResourceSet rs) {
static def List<PrimitiveType> getSupportedPredefinedUmlPrimitiveTypes(ResourceSet rs) {
var List<PrimitiveType> umlPrimitiveTypes = #[]
val uri = URI.createURI("pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml")
val resource = rs.getResource(uri, true)
umlPrimitiveTypes = resource.allContents.filter(PrimitiveType).toList
return umlPrimitiveTypes
}

public static def List<PrimitiveType> getSupportedPredefinedUmlPrimitiveTypes(Function<URI, Resource> resourceRetriever) {
static def List<PrimitiveType> getSupportedPredefinedUmlPrimitiveTypes(Function<URI, Resource> resourceRetriever) {
var List<PrimitiveType> umlPrimitiveTypes = #[]
val uri = URI.createURI("pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml")
val resource = resourceRetriever.apply(uri)
Expand All @@ -38,7 +38,7 @@ class UmlTypeUtil { // TODO TS merge with UmlClassifierAndPackagableUtil?
return umlPrimitiveTypes
}

public static def registerPredefinedUmlPrimitiveTypes(CorrespondenceModel cm, ResourceSet rs) {
static def registerPredefinedUmlPrimitiveTypes(CorrespondenceModel cm, ResourceSet rs) {
var List<PrimitiveType> umlPrimitiveTypes = getSupportedPredefinedUmlPrimitiveTypes(rs)
for (primitive : umlPrimitiveTypes) {
val alreadyRegistered = ReactionsCorrespondenceHelper.getCorrespondingObjectsOfType(cm, UMLPackage.Literals.PRIMITIVE_TYPE, primitive.name,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions releng/tools.vitruv.applications.cbs.frameworkwrapper/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tools.vitruv.applications.cbs.frameworkwrapper</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: tools.vitruv.applications.cbs.frameworkwrapper
Bundle-SymbolicName: tools.vitruv.applications.cbs.frameworkwrapper
Automatic-Module-Name: tools.vitruv.applications.cbs.frameworkwrapper
Bundle-Version: 0.1.0.qualifier
Require-Bundle: tools.vitruv.dsls.reactions,
tools.vitruv.dsls.mappings,
Expand Down
6 changes: 3 additions & 3 deletions releng/tools.vitruv.applications.cbs.frameworkwrapper/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tools.vitruv</groupId>
Expand All @@ -7,7 +9,5 @@
<relativePath>../tools.vitruv.applications.cbs.parent</relativePath>
</parent>
<artifactId>tools.vitruv.applications.cbs.frameworkwrapper</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import org.palladiosimulator.pcm.repository.Repository

import static org.junit.Assert.assertEquals

import static extension tools.vitruv.framework.correspondence.CorrespondenceModelUtil.*
import static extension edu.kit.ipd.sdq.commons.util.java.lang.IterableUtil.*

class EjbPackageMappingTest extends EjbJava2PcmTransformationTest {

@Test
Expand Down
Loading

0 comments on commit cc900f5

Please sign in to comment.