Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
TDL Open Source
TOP IDE
Compare revisions
30ecb3b30a4ccf4b6365211344e1b5c9850c9f93...c345caf414cd85fa0d024cea76695ff00386d5f3
Commits (2)
Updated TRI
· 2e220c1d
Martti Käärik
authored
Mar 28, 2024
2e220c1d
Mark generated TDL files as derived and don't run OCL validation on them.
· c345caf4
Martti Käärik
authored
Apr 18, 2024
c345caf4
Hide whitespace changes
Inline
Side-by-side
plugins/org.etsi.mts.tdl.execution.java.runtime/pom.xml
View file @
c345caf4
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.etsi.mts.tdl
</groupId>
<artifactId>
org.etsi.mts.tdl.execution.java
</artifactId>
<version>
1.0.0
-SNAPSHOT
</version>
<version>
1.0.0
</version>
<build>
<sourceDirectory>
src
</sourceDirectory>
<plugins>
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/adapters/DefaultAdapter.java
View file @
c345caf4
...
...
@@ -2,20 +2,16 @@ package org.etsi.mts.tdl.execution.java.adapters;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.Reporter
;
import
org.etsi.mts.tdl.execution.java.tri.RuntimeHelper
;
import
org.etsi.mts.tdl.execution.java.tri.StopException
;
import
org.etsi.mts.tdl.execution.java.tri.Validator
;
import
org.etsi.mts.tdl.execution.java.tri.Verdict
;
public
class
DefaultAdapter
implements
Validator
,
Reporter
,
RuntimeHelper
{
public
class
DefaultAdapter
implements
Validator
,
Reporter
{
@Override
public
boolean
equals
(
Object
o0
,
Object
o1
)
{
// TODO Auto-generated method stub
return
false
;
}
@Override
public
<
T
>
T
clone
(
T
object
)
{
// TODO Auto-generated method stub
return
object
;
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/adapters/http/HttpSystemAdapter.java
View file @
c345caf4
...
...
@@ -25,6 +25,7 @@ import org.etsi.mts.tdl.execution.java.tri.Connection;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
import
org.etsi.mts.tdl.execution.java.tri.Mapping
;
import
org.etsi.mts.tdl.execution.java.tri.NamedElement
;
import
org.etsi.mts.tdl.execution.java.tri.Procedure
;
import
org.etsi.mts.tdl.execution.java.tri.Reporter
;
import
org.etsi.mts.tdl.execution.java.tri.SystemAdapter
;
...
...
@@ -267,6 +268,11 @@ public class HttpSystemAdapter implements SystemAdapter {
throw
new
UnsupportedOperationException
(
"Procedure-based communication is not supported by this adapter."
);
}
@Override
public
Data
callFunction
(
NamedElement
function
,
Argument
[]
arguments
)
{
throw
new
UnsupportedOperationException
(
"Custom function implementations should be provided by extensions."
);
}
protected
HttpRequestData
getRequestData
(
Data
message
)
{
if
(
message
.
getValue
()
instanceof
HttpRequestData
)
return
(
HttpRequestData
)
message
.
getValue
();
...
...
@@ -290,8 +296,8 @@ public class HttpSystemAdapter implements SystemAdapter {
Mapping
rs
=
m
.
getResource
();
boolean
isMapped
=
false
;
for
(
ElementAnnotation
a
:
rs
.
a
nnotations
)
{
if
(
a
.
key
.
equals
(
"Tdl::MappingName"
)
&&
a
.
v
alue
.
equals
(
"Java"
))
{
for
(
ElementAnnotation
a
:
rs
.
getA
nnotations
()
)
{
if
(
a
.
getKey
()
.
equals
(
"Tdl::MappingName"
)
&&
a
.
getV
alue
()
.
equals
(
"Java"
))
{
isMapped
=
true
;
break
;
}
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ArgumentImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
public
class
ArgumentImpl
<
T
,
V
>
extends
DataImpl
<
T
,
V
>
{
private
String
parameterName
;
public
ArgumentImpl
(
T
type
,
V
value
,
String
parameterName
)
{
super
(
type
,
value
);
this
.
parameterName
=
parameterName
;
}
public
ArgumentImpl
(
Data
<
T
,
V
>
data
,
String
parameterName
)
{
super
(
data
.
getType
(),
data
.
getValue
());
this
.
parameterName
=
parameterName
;
}
public
String
getParameterName
()
{
return
parameterName
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ConnectionImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Connection
;
import
org.etsi.mts.tdl.execution.java.tri.GateReference
;
public
class
ConnectionImpl
extends
ElementImpl
implements
Connection
{
private
final
GateReference
[]
endPoints
=
new
GateReference
[
2
];
public
ConnectionImpl
(
String
name
,
GateReference
sourceGate
,
GateReference
targetGate
)
{
super
(
name
);
getEndPoints
()[
0
]
=
sourceGate
;
getEndPoints
()[
1
]
=
targetGate
;
}
public
GateReference
[]
getEndPoints
()
{
return
endPoints
;
}
@Override
public
String
toString
()
{
if
(
name
!=
null
)
return
name
;
return
getEndPoints
()[
0
].
toString
()
+
" :: "
+
getEndPoints
()[
1
].
toString
();
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/DataImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
/**
* In Java environment the <code>type</code> is a Java class and
* <code>value</code> is an object of that class or a lambda expression that
* returns such object.
*/
public
class
DataImpl
<
T
,
V
>
implements
Data
<
T
,
V
>
{
private
T
type
;
private
V
value
;
public
DataImpl
(
T
type
,
V
value
)
{
this
.
type
=
type
;
this
.
value
=
value
;
}
public
V
getValue
()
{
return
value
;
}
public
T
getType
()
{
return
type
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ElementAnnotationImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
public
class
ElementAnnotationImpl
implements
ElementAnnotation
{
public
String
key
,
value
;
public
ElementAnnotationImpl
(
String
key
,
String
value
)
{
this
.
key
=
key
;
this
.
value
=
value
;
}
public
String
getKey
()
{
return
key
;
}
public
String
getValue
()
{
return
value
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ElementImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.etsi.mts.tdl.execution.java.tri.Element
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
public
class
ElementImpl
implements
Element
{
protected
String
name
;
private
List
<
ElementAnnotation
>
annotations
=
new
ArrayList
<
ElementAnnotation
>();
public
ElementImpl
()
{
}
public
ElementImpl
(
String
name
)
{
this
.
name
=
name
;
}
@Override
public
String
getName
()
{
return
name
;
}
@Override
public
List
<
ElementAnnotation
>
getAnnotations
()
{
return
annotations
;
}
public
void
setAnnotations
(
List
<
ElementAnnotation
>
annotations
)
{
this
.
annotations
=
annotations
;
}
public
ElementImpl
addAnnotation
(
String
key
,
String
value
)
{
this
.
getAnnotations
().
add
(
new
ElementAnnotationImpl
(
key
,
value
));
return
this
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/GateReferenceImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.ComponentInstanceRole
;
import
org.etsi.mts.tdl.execution.java.tri.Element
;
import
org.etsi.mts.tdl.execution.java.tri.GateReference
;
import
org.etsi.mts.tdl.execution.java.tri.GateTypeKind
;
import
org.etsi.mts.tdl.execution.java.tri.NamedElement
;
/**
* Encapsulation of a connection end-point specification. It's an aggregation of
* following TDL model elements:
* <ul>
* <li>GateInstance</li>
* <li>GateType</li>
* <li>ComponentInstance</li>
* <li>ComponentType</li>
* <li>ComponentInstanceRole</li>
* </ul>
*
*/
public
class
GateReferenceImpl
implements
GateReference
{
private
Element
gate
;
private
NamedElement
gateType
;
private
GateTypeKind
gateTypeKind
;
private
Element
component
;
private
NamedElement
componentType
;
private
ComponentInstanceRole
role
;
public
GateReferenceImpl
(
Element
gate
,
NamedElement
gateType
,
GateTypeKind
gateTypeKind
,
Element
component
,
NamedElement
componentType
,
ComponentInstanceRole
role
)
{
this
.
gate
=
gate
;
this
.
gateType
=
gateType
;
this
.
gateTypeKind
=
gateTypeKind
;
this
.
component
=
component
;
this
.
componentType
=
componentType
;
this
.
role
=
role
;
}
@Override
public
Element
getGate
()
{
return
gate
;
}
@Override
public
NamedElement
getGateType
()
{
return
gateType
;
}
@Override
public
GateTypeKind
getGateTypeKind
()
{
return
gateTypeKind
;
}
@Override
public
Element
getComponent
()
{
return
component
;
}
@Override
public
NamedElement
getComponentType
()
{
return
componentType
;
}
@Override
public
ComponentInstanceRole
getComponentRole
()
{
return
role
;
}
@Override
public
int
hashCode
()
{
return
gate
.
hashCode
()
<<
8
+
gateType
.
hashCode
()
<<
6
+
component
.
hashCode
()
<<
4
+
componentType
.
hashCode
()
<<
2
+
role
.
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
GateReferenceImpl
)
{
GateReferenceImpl
gr
=
(
GateReferenceImpl
)
obj
;
return
gate
.
equals
(
gr
.
gate
)
&&
gateType
.
equals
(
gr
.
gateType
)
&&
component
.
equals
(
gr
.
component
)
&&
componentType
.
equals
(
gr
.
componentType
)
&&
role
.
equals
(
gr
.
role
);
}
return
super
.
equals
(
obj
);
}
}
\ No newline at end of file
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/MappingImpl.java
View file @
c345caf4
...
...
@@ -3,10 +3,9 @@ package org.etsi.mts.tdl.execution.java.rt.core;
import
java.util.Hashtable
;
import
java.util.Map
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
import
org.etsi.mts.tdl.execution.java.tri.Mapping
;
public
class
MappingImpl
extends
Mapping
implements
TriImpl
<
MappingImpl
,
MappingImpl
>
{
public
class
MappingImpl
extends
ElementImpl
implements
Mapping
,
TriImpl
<
MappingImpl
,
MappingImpl
>
{
private
String
mappingName
;
private
boolean
resource
;
...
...
@@ -83,7 +82,7 @@ public class MappingImpl extends Mapping implements TriImpl<MappingImpl, Mapping
@Override
public
MappingImpl
addAnnotation
(
String
key
,
String
value
)
{
this
.
annotations
.
add
(
new
Element
Annotation
(
key
,
value
)
)
;
super
.
add
Annotation
(
key
,
value
);
return
this
;
}
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/NamedElementImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.NamedElement
;
public
class
NamedElementImpl
extends
ElementImpl
implements
NamedElement
{
protected
String
qualifiedName
;
public
NamedElementImpl
()
{
}
public
NamedElementImpl
(
String
name
,
String
qualifiedName
)
{
super
(
name
);
this
.
setQualifiedName
(
qualifiedName
);
}
@Override
public
String
getQualifiedName
()
{
return
qualifiedName
;
}
protected
void
setQualifiedName
(
String
qualifiedName
)
{
this
.
qualifiedName
=
qualifiedName
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ParameterImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Parameter
;
public
class
ParameterImpl
extends
ElementImpl
implements
Parameter
<
TypeImpl
>
{
private
TypeImpl
type
;
public
ParameterImpl
(
String
parameterName
)
{
super
(
parameterName
);
}
@Override
public
ParameterImpl
addAnnotation
(
String
key
,
String
value
)
{
super
.
addAnnotation
(
key
,
value
);
return
this
;
}
public
ParameterImpl
setType
(
TypeImpl
type
)
{
this
.
type
=
type
;
return
this
;
}
@Override
public
TypeImpl
getType
()
{
return
type
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/PojoArgument.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Argument
;
public
class
PojoArgument
<
V
>
extends
Argument
<
Class
<
V
>,
V
>
{
public
class
PojoArgument
<
V
>
extends
ArgumentImpl
<
Class
<
V
>,
V
>
{
public
PojoArgument
(
V
value
,
String
parameterName
)
{
super
((
Class
<
V
>)
value
.
getClass
(),
value
,
parameterName
);
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/PojoData.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
public
class
PojoData
<
V
>
extends
Data
<
Class
<
V
>,
V
>
{
public
class
PojoData
<
V
>
extends
DataImpl
<
Class
<
V
>,
V
>
{
public
PojoData
(
V
value
)
{
super
((
Class
<
V
>)
value
.
getClass
(),
value
);
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/PredefinedFunctionsImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
java.util.Collection
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.PredefinedFunctions
;
import
org.etsi.mts.tdl.execution.java.tri.Value
;
import
com.google.inject.Inject
;
/**
* Default implementation of predefined functions specified in TDL.
*/
public
class
PredefinedFunctionsImpl
implements
PredefinedFunctions
{
@Inject
public
PredefinedFunctionsImpl
()
{
}
@Override
public
boolean
equals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
)
{
return
d0
.
equals
(
d1
);
}
@Override
public
boolean
notEquals
(
Data
<?,
?>
d0
,
Data
<?,
?>
d1
)
{
return
!
equals
(
d0
,
d1
);
}
@Override
public
boolean
and
(
boolean
b0
,
boolean
b1
)
{
return
b0
&&
b1
;
}
@Override
public
boolean
or
(
boolean
b0
,
boolean
b1
)
{
return
b0
||
b1
;
}
@Override
public
boolean
xor
(
boolean
b0
,
boolean
b1
)
{
return
b0
^
b1
;
}
@Override
public
boolean
not
(
boolean
b
)
{
return
!
b
;
}
@Override
public
boolean
lt
(
int
i0
,
int
i1
)
{
return
i0
<
i1
;
}
@Override
public
boolean
gt
(
int
i0
,
int
i1
)
{
return
i0
>
i1
;
}
@Override
public
boolean
lteq
(
int
i0
,
int
i1
)
{
return
i0
<=
i1
;
}
@Override
public
boolean
gteq
(
int
i0
,
int
i1
)
{
return
i0
>=
i1
;
}
@Override
public
boolean
lt
(
long
i0
,
long
i1
)
{
return
i0
<
i1
;
}
@Override
public
boolean
gt
(
long
i0
,
long
i1
)
{
return
i0
>
i1
;
}
@Override
public
boolean
lteq
(
long
i0
,
long
i1
)
{
return
i0
<=
i1
;
}
@Override
public
boolean
gteq
(
long
i0
,
long
i1
)
{
return
i0
>=
i1
;
}
@Override
public
int
plus
(
int
i0
,
int
i1
)
{
return
i0
+
i1
;
}
@Override
public
int
minus
(
int
i0
,
int
i1
)
{
return
i0
-
i1
;
}
@Override
public
int
multiply
(
int
i0
,
int
i1
)
{
return
i0
*
i1
;
}
@Override
public
int
divide
(
int
i0
,
int
i1
)
{
return
i0
/
i1
;
}
@Override
public
int
mod
(
int
i0
,
int
i1
)
{
return
i0
%
i1
;
}
@Override
public
long
plus
(
long
i0
,
long
i1
)
{
return
i0
+
i1
;
}
@Override
public
long
minus
(
long
i0
,
long
i1
)
{
return
i0
-
i1
;
}
@Override
public
long
multiply
(
long
i0
,
long
i1
)
{
return
i0
*
i1
;
}
@Override
public
long
divide
(
long
i0
,
long
i1
)
{
return
i0
/
i1
;
}
@Override
public
long
mod
(
long
i0
,
long
i1
)
{
return
i0
%
i1
;
}
@Override
public
int
size
(
Data
<?,
?>
collection
)
{
Object
v
=
collection
.
getValue
();
if
(
v
instanceof
Collection
<?>)
return
((
Collection
<?>)
v
).
size
();
if
(
v
instanceof
Value
)
if
(((
Value
)
v
).
isCollection
())
return
((
Value
)
v
).
getItems
().
size
();
throw
new
IllegalArgumentException
(
"Argument is not a collection."
);
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/ProcedureImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.function.Consumer
;
import
org.etsi.mts.tdl.execution.java.tri.Parameter
;
import
org.etsi.mts.tdl.execution.java.tri.Procedure
;
/**
* May optionally be mapped to a method that implements the calling of the
* procedure
*/
public
class
ProcedureImpl
extends
NamedElementImpl
implements
Procedure
{
private
List
<
ParameterImpl
>
in
=
new
ArrayList
<
ParameterImpl
>();
private
List
<
ParameterImpl
>
out
=
new
ArrayList
<
ParameterImpl
>();
private
List
<
ParameterImpl
>
exception
=
new
ArrayList
<
ParameterImpl
>();
private
Consumer
<
Object
[]>
function
;
public
ProcedureImpl
addIn
(
ParameterImpl
p
)
{
this
.
in
.
add
(
p
);
return
this
;
}
public
ProcedureImpl
addOut
(
ParameterImpl
p
)
{
this
.
out
.
add
(
p
);
return
this
;
}
public
ProcedureImpl
addException
(
ParameterImpl
p
)
{
this
.
exception
.
add
(
p
);
return
this
;
}
@Override
public
List
<
Parameter
>
getIn
()
{
return
(
List
)
in
;
}
@Override
public
List
<
Parameter
>
getOut
()
{
return
(
List
)
out
;
}
@Override
public
List
<
Parameter
>
getException
()
{
return
(
List
)
exception
;
}
/**
* Optional function that implements this procedure call.
* <p>
* The function parameters must match the order and types of parameters of the
* procedure call. That is, for each parameter of a procedure call, a method
* parameter must exist such that the procedure call parameter type is mapped to
* the method parameter type (or class).
*/
public
void
setFunction
(
Consumer
<
Object
[]>
function
)
{
this
.
function
=
function
;
}
public
Consumer
<
Object
[]>
getFunction
()
{
return
function
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/StopExceptionImpl.java
0 → 100644
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.StopException
;
import
org.etsi.mts.tdl.execution.java.tri.Verdict
;
@SuppressWarnings
(
"serial"
)
public
class
StopExceptionImpl
extends
StopException
{
private
Verdict
verdict
;
public
StopExceptionImpl
(
String
message
)
{
super
(
message
);
}
public
StopExceptionImpl
(
String
message
,
Verdict
verdict
)
{
super
(
message
);
this
.
verdict
=
verdict
;
}
public
Verdict
getVerdict
()
{
return
verdict
;
}
}
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/TestControl.java
View file @
c345caf4
...
...
@@ -19,8 +19,6 @@ import org.etsi.mts.tdl.execution.java.tri.Data;
import
org.etsi.mts.tdl.execution.java.tri.GateReference
;
import
org.etsi.mts.tdl.execution.java.tri.PredefinedFunctions
;
import
org.etsi.mts.tdl.execution.java.tri.Reporter
;
import
org.etsi.mts.tdl.execution.java.tri.RuntimeHelper
;
import
org.etsi.mts.tdl.execution.java.tri.StopException
;
import
org.etsi.mts.tdl.execution.java.tri.SystemAdapter
;
import
org.etsi.mts.tdl.execution.java.tri.Validator
;
...
...
@@ -34,7 +32,6 @@ public class TestControl {
public
Validator
validator
;
public
Reporter
reporter
;
public
PredefinedFunctions
functions
;
public
RuntimeHelper
runtimeHelper
;
private
Connection
[]
connections
;
private
Map
<
Connection
,
ReceiverHub
>
receiverHubs
=
Collections
...
...
@@ -59,7 +56,6 @@ public class TestControl {
this
.
validator
=
injector
.
getInstance
(
Validator
.
class
);
this
.
reporter
=
injector
.
getInstance
(
Reporter
.
class
);
this
.
functions
=
injector
.
getInstance
(
PredefinedFunctions
.
class
);
this
.
runtimeHelper
=
injector
.
getInstance
(
RuntimeHelper
.
class
);
this
.
executor
=
Executors
.
newCachedThreadPool
();
this
.
completionService
=
new
ExecutorCompletionService
<
ExecutionResult
>(
executor
);
...
...
@@ -88,7 +84,7 @@ public class TestControl {
ExceptionalBehaviour
anyReceiver
=
new
ExceptionalBehaviour
(
false
);
anyReceiver
.
behaviour
=
()
->
{
throw
new
StopException
(
"Unexpected message received"
);
throw
new
StopException
Impl
(
"Unexpected message received"
);
};
anyReceiver
.
callable
=
new
ExecutionCallable
()
{
@Override
...
...
@@ -109,16 +105,16 @@ public class TestControl {
for
(
Connection
c
:
connections
)
{
int
testerEP
=
-
1
;
for
(
int
i
=
0
;
i
<=
1
;
i
++)
if
(
c
.
e
ndPoints
[
i
].
c
omponent
.
getName
().
equals
(
testerComponentName
)
&&
c
.
e
ndPoints
[
i
].
gate
.
getName
().
equals
(
testerGateName
))
{
if
(
c
.
getE
ndPoints
()
[
i
].
getC
omponent
()
.
getName
().
equals
(
testerComponentName
)
&&
c
.
getE
ndPoints
()
[
i
].
g
etG
ate
()
.
getName
().
equals
(
testerGateName
))
{
testerEP
=
i
;
break
;
}
if
(
testerEP
==
-
1
)
continue
;
int
targetEP
=
testerEP
==
0
?
1
:
0
;
if
(
c
.
e
ndPoints
[
targetEP
].
c
omponent
.
getName
().
equals
(
remoteComponentName
)
&&
c
.
e
ndPoints
[
targetEP
].
gate
.
getName
().
equals
(
remoteGateName
))
if
(
c
.
getE
ndPoints
()
[
targetEP
].
getC
omponent
()
.
getName
().
equals
(
remoteComponentName
)
&&
c
.
getE
ndPoints
()
[
targetEP
].
g
etG
ate
()
.
getName
().
equals
(
remoteGateName
))
return
c
;
}
throw
new
RuntimeException
(
String
.
format
(
"Unknown connection: from %s.%s to %s.%s"
,
testerComponentName
,
...
...
@@ -128,9 +124,9 @@ public class TestControl {
public
GateReference
getGateReference
(
String
testerComponentName
,
String
testerGateName
)
{
for
(
Connection
c
:
connections
)
{
for
(
int
i
=
0
;
i
<=
1
;
i
++)
if
(
c
.
e
ndPoints
[
i
].
c
omponent
.
getName
().
equals
(
testerComponentName
)
&&
c
.
e
ndPoints
[
i
].
gate
.
getName
().
equals
(
testerGateName
))
{
return
c
.
e
ndPoints
[
i
];
if
(
c
.
getE
ndPoints
()
[
i
].
getC
omponent
()
.
getName
().
equals
(
testerComponentName
)
&&
c
.
getE
ndPoints
()
[
i
].
g
etG
ate
()
.
getName
().
equals
(
testerGateName
))
{
return
c
.
getE
ndPoints
()
[
i
];
}
}
throw
new
RuntimeException
(
String
.
format
(
"Unknown gate: %s.%s"
,
testerComponentName
,
testerGateName
));
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/Timer.java
View file @
c345caf4
package
org.etsi.mts.tdl.execution.java.rt.core
;
import
org.etsi.mts.tdl.execution.java.tri.NamedElement
;
public
class
Timer
extends
NamedElement
{
public
class
Timer
extends
NamedElementImpl
{
private
TimeUnit
unit
;
...
...
plugins/org.etsi.mts.tdl.execution.java.runtime/src/org/etsi/mts/tdl/execution/java/rt/core/TypeImpl.java
View file @
c345caf4
...
...
@@ -7,12 +7,11 @@ import java.util.List;
import
java.util.Map
;
import
org.etsi.mts.tdl.execution.java.tri.Data
;
import
org.etsi.mts.tdl.execution.java.tri.ElementAnnotation
;
import
org.etsi.mts.tdl.execution.java.tri.Mapping
;
import
org.etsi.mts.tdl.execution.java.tri.Type
;
import
org.etsi.mts.tdl.execution.java.tri.Value
;
public
class
TypeImpl
extends
Type
implements
TriImpl
<
TypeImpl
,
TypeImpl
>
{
public
class
TypeImpl
extends
NamedElementImpl
implements
Type
,
TriImpl
<
TypeImpl
,
TypeImpl
>
{
private
boolean
structure
=
false
;
private
boolean
collection
=
false
;
private
boolean
enumerated
=
false
;
...
...
@@ -95,20 +94,20 @@ public class TypeImpl extends Type implements TriImpl<TypeImpl, TypeImpl> {
}
public
TypeImpl
addEnumLiteral
(
ValueImpl
literal
)
{
this
.
enumLiterals
.
add
(
new
Data
<
Type
,
Value
>(
this
,
literal
));
this
.
enumLiterals
.
add
(
new
Data
Impl
<
Type
,
Value
>(
this
,
literal
));
return
this
;
}
@Override
public
TypeImpl
setName
(
String
name
,
String
qualifiedName
)
{
this
.
name
=
name
;
this
.
q
ualifiedName
=
qualifiedName
;
this
.
setQ
ualifiedName
(
qualifiedName
)
;
return
this
;
}
@Override
public
TypeImpl
addAnnotation
(
String
key
,
String
value
)
{
this
.
annotations
.
add
(
new
Element
Annotation
(
key
,
value
)
)
;
super
.
add
Annotation
(
key
,
value
);
return
this
;
}
...
...
Prev
1
2
3
Next