Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codeling
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
ADVERT
codeling
Commits
95bcafbe
Commit
95bcafbe
authored
Sep 18, 2017
by
Marco Konersmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Towards events in the cocome-case study
parent
934a6e9a
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51667 additions
and
74537 deletions
+51667
-74537
Language Integration/CoCoME/cocome.test/src/main/java/advert/cocome/transformations/integrationtest/CoCoMECaseStudyIT.java
...me/transformations/integrationtest/CoCoMECaseStudyIT.java
+51
-21
Language Integration/CoCoME/cocome.transformation/src/main/resources/COCOME2IAL.henshin
...come.transformation/src/main/resources/COCOME2IAL.henshin
+16642
-14809
Language Integration/CoCoME/cocome.transformation/src/main/resources/COCOME2IAL.henshin.fragment
...sformation/src/main/resources/COCOME2IAL.henshin.fragment
+4852
-3897
Language Integration/PCM/pcm/src/main/resources/de/mkonersmann/advert/pcm/pcm2il.henshin
...c/main/resources/de/mkonersmann/advert/pcm/pcm2il.henshin
+26660
-43995
Language Integration/PCM/pcm/src/main/resources/de/mkonersmann/advert/pcm/pcm2il.henshin.fragment
...sources/de/mkonersmann/advert/pcm/pcm2il.henshin.fragment
+3462
-11815
No files found.
Language Integration/CoCoME/cocome.test/src/main/java/advert/cocome/transformations/integrationtest/CoCoMECaseStudyIT.java
View file @
95bcafbe
...
...
@@ -19,12 +19,17 @@ import org.eclipse.core.runtime.CoreException;
import
org.eclipse.core.runtime.IPath
;
import
org.eclipse.core.runtime.Path
;
import
org.eclipse.emf.common.util.EList
;
import
org.eclipse.emf.common.util.URI
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.emf.ecore.resource.Resource
;
import
org.eclipse.emf.ecore.resource.ResourceSet
;
import
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
;
import
org.eclipse.jdt.core.IJavaProject
;
import
org.eclipse.jdt.core.JavaCore
;
import
org.junit.FixMethodOrder
;
import
org.junit.Test
;
import
org.junit.runners.MethodSorters
;
import
org.osgi.framework.FrameworkUtil
;
import
org.palladiosimulator.pcm.core.composition.AssemblyContext
;
import
org.palladiosimulator.pcm.repository.BasicComponent
;
import
org.palladiosimulator.pcm.repository.CompositeComponent
;
...
...
@@ -88,11 +93,21 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
specificationLanguage
,
null
,
projects
);
}
@Test
void
verifyAgainstOracleModel
()
{
CoCoMECaseStudyIT
.
class
.
getClassLoader
().
getResourceAsStream
(
"/oracle/"
)
protected
final
String
BUNDLE_NAME
=
FrameworkUtil
.
getBundle
(
getClass
()).
getSymbolicName
();
@Test
public
void
verifyAgainstOracleModel
()
{
List
<
EObject
>
expected
=
loadModel
(
URI
.
createPlatformPluginURI
(
BUNDLE_NAME
+
"/src/main/resources/expected_pcm.xmi"
,
true
));
new
CompareEcoreModels
().
compare
(
expected
,
pcmModel
);
}
private
List
<
EObject
>
loadModel
(
URI
uri
)
{
ResourceSet
resSet
=
new
ResourceSetImpl
();
final
Resource
resource
=
resSet
.
getResource
(
uri
,
true
);
return
resource
.
getContents
();
}
@Test
public
void
_3_verifySystem
()
{
System
system
=
getSystem
(
pcmModel
);
...
...
@@ -102,10 +117,13 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
public
void
_2_verifyRepository
()
{
Repository
repository
=
getRepository
(
pcmModel
);
EList
<
Interface
>
interfaces
=
repository
.
getInterfaces__Repository
();
assertEquals
(
11
,
interfaces
.
size
());
int
operationInterfacesCount
=
11
;
int
eventInterfacesCount
=
0
;
int
totalInterfacesCount
=
operationInterfacesCount
+
eventInterfacesCount
;
assertEquals
(
totalInterfacesCount
,
interfaces
.
size
());
EList
<
RepositoryComponent
>
components
=
repository
.
getComponents__Repository
();
assertEquals
(
1
8
,
components
.
size
());
assertEquals
(
1
9
,
components
.
size
());
}
@Test
...
...
@@ -114,43 +132,43 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
EList
<
RepositoryComponent
>
components
=
repository
.
getComponents__Repository
();
for
(
RepositoryComponent
repositoryComponent
:
components
)
{
switch
(
repositoryComponent
.
getEntityName
())
{
case
"ProductDispatcher"
:
case
"ProductDispatcher
Server
"
:
verifyComponentProductDispatcher
(
repositoryComponent
);
break
;
case
"Reporting"
:
case
"Reporting
Server
"
:
verifyComponentReporting
(
repositoryComponent
);
break
;
case
"Store"
:
verifyComponentStore
(
repositoryComponent
);
case
"Store
Server
"
:
verifyComponentStore
Server
(
repositoryComponent
);
break
;
case
"TrivialBank"
:
case
"TrivialBank
Server
"
:
verifyComponentTrivialBank
(
repositoryComponent
);
break
;
case
"CashBox"
:
case
"CashBox
Model
"
:
verifyComponentCashBox
(
repositoryComponent
);
break
;
case
"ExpressLight"
:
case
"ExpressLight
Model
"
:
verifyComponentExpressLight
(
repositoryComponent
);
break
;
case
"cashdeskline"
:
verifyComponentCashdeskline
(
repositoryComponent
);
break
;
case
"BarcodeScanner"
:
case
"BarcodeScanner
Model
"
:
verifyComponentBarcodeScanner
(
repositoryComponent
);
break
;
case
"CardReader"
:
case
"CardReader
Model
"
:
verifyComponentCardReader
(
repositoryComponent
);
break
;
case
"Printer"
:
case
"Printer
Model
"
:
verifyComponentPrinter
(
repositoryComponent
);
break
;
case
"UserDisplay"
:
case
"UserDisplay
Model
"
:
verifyComponentUserDisplay
(
repositoryComponent
);
break
;
case
"Coordinator"
:
case
"Coordinator
Model
"
:
verifyComponentCoordinator
(
repositoryComponent
);
break
;
case
"CashDesk"
:
case
"CashDesk
Model
"
:
verifyComponentCashDesk
(
repositoryComponent
);
break
;
case
"console"
:
...
...
@@ -162,6 +180,11 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
case
"inventory"
:
verifyComponentInventory
(
repositoryComponent
);
break
;
case
"CashDeskModel_Internal"
:
verifyComponentCashDeskInternal
(
repositoryComponent
);
break
;
default
:
fail
(
"Found unexpected component "
+
repository
.
getEntityName
());
}
}
}
...
...
@@ -201,11 +224,13 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
private
void
verifyComponentInventory
(
RepositoryComponent
repositoryComponent
)
{
verifyIsCompositeComponent
(
repositoryComponent
);
CompositeComponent
component
=
(
CompositeComponent
)
repositoryComponent
;
assertEquals
(
1
,
component
.
getProvidedRoles_InterfaceProvidingEntity
().
size
());
assertEquals
(
4
,
component
.
getProvidedRoles_InterfaceProvidingEntity
().
size
());
verifyHasAssemblyContextsOfComponents
(
component
,
"console"
,
"application"
);
verifyDelegatesProvision
(
component
,
new
String
[]
{
"IStoreInventory"
,
"application"
},
new
String
[]
{
"IStoreInventoryManager"
,
"application"
});
new
String
[]
{
"IStoreInventoryManager"
,
"application"
},
new
String
[]
{
"IReporting"
,
"ReportingServer"
},
new
String
[]
{
"IProductDispatcher"
,
"ProductDispatcherServer"
});
verifyDelegatesRequirement
(
component
);
verifyConnects
(
component
,
"console"
,
"application"
,
"IStoreInventoryManager"
);
verifyConnects
(
component
,
"console"
,
"application"
,
"IReporting"
);
...
...
@@ -226,6 +251,11 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
CompositeComponent
component
=
(
CompositeComponent
)
repositoryComponent
;
}
private
void
verifyComponentCashDeskInternal
(
RepositoryComponent
repositoryComponent
)
{
verifyIsWellFormedBasicComponent
(
repositoryComponent
);
BasicComponent
component
=
(
BasicComponent
)
repositoryComponent
;
}
private
void
verifyComponentCoordinator
(
RepositoryComponent
repositoryComponent
)
{
verifyIsWellFormedBasicComponent
(
repositoryComponent
);
BasicComponent
component
=
(
BasicComponent
)
repositoryComponent
;
...
...
@@ -280,7 +310,7 @@ public class CoCoMECaseStudyIT extends MayHaveIssues {
}
private
void
verifyComponentStore
(
RepositoryComponent
repositoryComponent
)
{
private
void
verifyComponentStore
Server
(
RepositoryComponent
repositoryComponent
)
{
verifyIsWellFormedBasicComponent
(
repositoryComponent
);
BasicComponent
component
=
(
BasicComponent
)
repositoryComponent
;
if
(
provides
(
component
,
"IStore"
))
{
...
...
Language Integration/CoCoME/cocome.transformation/src/main/resources/COCOME2IAL.henshin
View file @
95bcafbe
This diff is collapsed.
Click to expand it.
Language Integration/CoCoME/cocome.transformation/src/main/resources/COCOME2IAL.henshin.fragment
View file @
95bcafbe
This diff is collapsed.
Click to expand it.
Language Integration/PCM/pcm/src/main/resources/de/mkonersmann/advert/pcm/pcm2il.henshin
View file @
95bcafbe
This diff is collapsed.
Click to expand it.
Language Integration/PCM/pcm/src/main/resources/de/mkonersmann/advert/pcm/pcm2il.henshin.fragment
View file @
95bcafbe
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment