Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
languages
Tagging
Commits
f0e3328d
Commit
f0e3328d
authored
May 21, 2018
by
Alexander David Hellwig
Browse files
Moved tests to Tagging-Examples repository
parent
9de24792
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/test/java/de/monticore/lang/tagging/ParserTagValueTest.java
View file @
f0e3328d
...
...
@@ -25,6 +25,7 @@ import de.monticore.lang.tagging._ast.ASTTag;
import
de.monticore.lang.tagging._ast.ASTTagElement
;
import
de.monticore.lang.tagging._ast.ASTTaggingUnit
;
import
de.monticore.lang.tagging._parser.TaggingParser
;
import
de.monticore.lang.tagging._symboltable.TaggingResolver
;
import
org.junit.Ignore
;
import
org.junit.Test
;
...
...
@@ -34,6 +35,7 @@ import java.util.List;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
...
...
@@ -78,29 +80,4 @@ public class ParserTagValueTest {
// System.out.println(tags.getTags().size());
// System.out.println(tags.getTags().get(0).getTagValue().length());
}*/
@Test
public
void
testArrayTagging
()
throws
IOException
{
TaggingParser
parser
=
new
TaggingParser
();
ASTTaggingUnit
taggingUnit
=
parser
.
parse
(
"src/test/resources/array/Array.tag"
).
get
();
List
<
ASTTag
>
tags
=
taggingUnit
.
getTagBody
().
getTags
();
List
<
ASTScope
>
taggedElements
=
tags
.
stream
()
.
map
(
ASTTag:
:
getScopes
)
.
flatMap
(
Collection:
:
stream
)
.
collect
(
Collectors
.
toList
());
Set
<
String
>
nameStrings
=
taggedElements
.
stream
()
.
map
(
ASTScope:
:
getQualifiedNameString
)
.
collect
(
Collectors
.
toSet
());
assertTrue
(
nameStrings
.
size
()
==
5
);
assertTrue
(
nameStrings
.
contains
(
"InstanceArrayComp.subcomps[1]"
));
assertTrue
(
nameStrings
.
contains
(
"InstanceArrayComp.subcomps[5]"
));
assertTrue
(
nameStrings
.
contains
(
"PortArrayComp.arrayIn[1]"
));
assertTrue
(
nameStrings
.
contains
(
"PortArrayComp.arrayIn[3]"
));
assertTrue
(
nameStrings
.
contains
(
"Comp.subCompInst[6].portArray[4]"
));
}
}
src/test/resources/array/Array.tag
deleted
100644 → 0
View file @
9de24792
package
array
;
conforms
to
nfp
.
TracebilityTagSchema
;
tags
Array
{
//
Tag
a
Subcomponent
array
tag
InstanceArrayComp
.
subcomps
[
1
]
with
IsTraceable
;
tag
InstanceArrayComp
.
subcomps
[
5
]
with
IsTraceable
;
//
Tag
an
array
Port
tag
PortArrayComp
.
arrayIn
[
1
]
with
IsTraceable
;
tag
PortArrayComp
.
arrayIn
[
3
]
with
IsTraceable
;
//
Combination
of
both
tag
Comp
.
subCompInst
[
6
].
portArray
[
4
]
with
IsTraceable
;
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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