Skip to content

Commit a8ac56e

Browse files
committed
Merge pull request #68 from KristianKarl/3.4.1
Bug fixes for 3.4.1
2 parents 91fa5ae + b639830 commit a8ac56e

File tree

32 files changed

+1246
-214
lines changed

32 files changed

+1246
-214
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ mvn package -pl graphwalker-cli -am
2222

2323
The jar is in:
2424
```bash
25-
graphwalker-cli/target/graphwalker-cli-3.4.0-SNAPSHOT.jar
25+
graphwalker-cli/target/graphwalker-cli-3.4.1.jar
2626
```

graphwalker-cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.graphwalker</groupId>
99
<artifactId>graphwalker-project</artifactId>
10-
<version>3.4.0</version>
10+
<version>3.4.1</version>
1111
</parent>
1212

1313
<artifactId>graphwalker-cli</artifactId>

graphwalker-cli/src/test/java/org/graphwalker/cli/SourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public void generatePython() throws IOException {
4949
String args[] = {"source", "--input", "json/example.json", "template/python.template"};
5050
Result result = runCommand(args);
5151
Assert.assertThat(result.getError(), is(""));
52-
Assert.assertTrue(result.getOutput().length() > 1000 && result.getOutput().length() < 1100);
52+
Assert.assertTrue(result.getOutput().length() > 950 && result.getOutput().length() < 1150);
5353
}
5454
}
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
HEADER<{{
2-
use strict;
3-
use warnings;
4-
5-
##
6-
## 1) Generate perl stub source code:
7-
## java -jar graphwalker-3.4.0-SNAPSHOT.jar source -i model.graphml perl.template > model.perl
8-
##
9-
## 2) Start graphwalker:
10-
## java -jar graphwalker-3.4.0-SNAPSHOT.jar online -s RESTFUL -m model.graphml "random(edge_coverage(100))"
11-
##
12-
## 3) Run the per program:
13-
## perl login.perl http://localhost:8887/graphwalker
14-
##
15-
16-
use LWP::Simple;
17-
18-
my $host = $ARGV[0];
19-
20-
while ( get $host."/hasNext" eq "true"){
21-
# Get next step from GraphWalker
22-
my $step = get $host."/getNext";
23-
if ($step ne '') {
24-
# Run the step
25-
eval( $step ) or die;
26-
}
27-
}
28-
}}>HEADER
29-
#
30-
# This sub routine implements: '{LABEL}'
31-
#
32-
sub {LABEL}()
33-
{
34-
print "{LABEL}\n";
35-
}
36-
FOOTER<{{
37-
#End of generated source code
38-
}}>FOOTER
1+
HEADER<{{
2+
use strict;
3+
use warnings;
4+
5+
##
6+
## 1) Generate perl stub source code:
7+
## java -jar graphwalker-3.4.1.jar source -i model.graphml perl.template > model.perl
8+
##
9+
## 2) Start graphwalker:
10+
## java -jar graphwalker-3.4.1.jar online -s RESTFUL -m model.graphml "random(edge_coverage(100))"
11+
##
12+
## 3) Run the per program:
13+
## perl login.perl http://localhost:8887/graphwalker
14+
##
15+
16+
use LWP::Simple;
17+
18+
my $host = $ARGV[0];
19+
20+
while ( get $host."/hasNext" eq "true"){
21+
# Get next step from GraphWalker
22+
my $step = get $host."/getNext";
23+
if ($step ne '') {
24+
# Run the step
25+
eval( $step ) or die;
26+
}
27+
}
28+
}}>HEADER
29+
#
30+
# This sub routine implements: '{LABEL}'
31+
#
32+
sub {LABEL}()
33+
{
34+
print "{LABEL}\n";
35+
}
36+
FOOTER<{{
37+
#End of generated source code
38+
}}>FOOTER

graphwalker-cli/src/test/resources/template/python.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ HEADER<{{
22
import requests,json
33
##
44
## 1) Generate python stub source code:
5-
## java -jar graphwalker-3.4.0-SNAPSHOT.jar source -i model.graphml python.template > model.py
5+
## java -jar graphwalker-3.4.1.jar source -i model.graphml python.template > model.py
66
##
77
## 2) Start graphwalker:
8-
## java -jar graphwalker-3.4.0-SNAPSHOT.jar online --json --service RESTFUL -m model.graphml "random(edge_coverage(100))"
8+
## java -jar graphwalker-3.4.1.jar online --json --service RESTFUL -m model.graphml "random(edge_coverage(100))"
99
##
1010
## 3) Run the per program:
1111
## python model.py

graphwalker-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.graphwalker</groupId>
99
<artifactId>graphwalker-project</artifactId>
10-
<version>3.4.0</version>
10+
<version>3.4.1</version>
1111
</parent>
1212

1313
<artifactId>graphwalker-core</artifactId>

graphwalker-core/src/main/java/org/graphwalker/core/statistics/Profiler.java

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,30 @@ public List<Element> getUnvisitedElements(Context context) {
9696
return elementList;
9797
}
9898

99+
public List<Element> getUnvisitedElements() {
100+
List<Element> elementList = new ArrayList<>();
101+
for (Context context : getContexts()) {
102+
for (Element e : context.getModel().getElements()) {
103+
if (!isVisited(e)) {
104+
elementList.add(e);
105+
}
106+
}
107+
}
108+
return elementList;
109+
}
110+
111+
public List<Element> getVisitedEdges() {
112+
List<Element> elementList = new ArrayList<>();
113+
for (Context context : getContexts()) {
114+
for (Element e : context.getModel().getElements()) {
115+
if (isVisited(e) && e instanceof Edge.RuntimeEdge) {
116+
elementList.add(e);
117+
}
118+
}
119+
}
120+
return elementList;
121+
}
122+
99123
public List<Element> getUnvisitedEdges(Context context) {
100124
List<Element> elementList = new ArrayList<>();
101125
for (Element e : context.getModel().getElements()) {
@@ -106,6 +130,18 @@ public List<Element> getUnvisitedEdges(Context context) {
106130
return elementList;
107131
}
108132

133+
public List<Element> getUnvisitedEdges() {
134+
List<Element> elementList = new ArrayList<>();
135+
for (Context context : getContexts()) {
136+
for (Element e : context.getModel().getElements()) {
137+
if (!isVisited(e) && e instanceof Edge.RuntimeEdge) {
138+
elementList.add(e);
139+
}
140+
}
141+
}
142+
return elementList;
143+
}
144+
109145
public List<Element> getUnvisitedVertices(Context context) {
110146
List<Element> elementList = new ArrayList<>();
111147
for (Element e : context.getModel().getElements()) {
@@ -116,6 +152,30 @@ public List<Element> getUnvisitedVertices(Context context) {
116152
return elementList;
117153
}
118154

155+
public List<Element> getUnvisitedVertices() {
156+
List<Element> elementList = new ArrayList<>();
157+
for (Context context : getContexts()) {
158+
for (Element e : context.getModel().getElements()) {
159+
if (!isVisited(e) && e instanceof Vertex.RuntimeVertex) {
160+
elementList.add(e);
161+
}
162+
}
163+
}
164+
return elementList;
165+
}
166+
167+
public List<Element> getVisitedVertices() {
168+
List<Element> elementList = new ArrayList<>();
169+
for (Context context : getContexts()) {
170+
for (Element e : context.getModel().getElements()) {
171+
if (isVisited(e) && e instanceof Vertex.RuntimeVertex) {
172+
elementList.add(e);
173+
}
174+
}
175+
}
176+
return elementList;
177+
}
178+
119179
public Path<Element> getPath() {
120180
return profile.getPath();
121181
}

graphwalker-dsl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.graphwalker</groupId>
99
<artifactId>graphwalker-project</artifactId>
10-
<version>3.4.0</version>
10+
<version>3.4.1</version>
1111
</parent>
1212

1313
<artifactId>graphwalker-dsl</artifactId>

graphwalker-io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.graphwalker</groupId>
99
<artifactId>graphwalker-project</artifactId>
10-
<version>3.4.0</version>
10+
<version>3.4.1</version>
1111
</parent>
1212

1313
<artifactId>graphwalker-io</artifactId>

graphwalker-java/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.graphwalker</groupId>
99
<artifactId>graphwalker-project</artifactId>
10-
<version>3.4.0</version>
10+
<version>3.4.1</version>
1111
</parent>
1212

1313
<artifactId>graphwalker-java</artifactId>
@@ -44,6 +44,11 @@
4444
<groupId>com.google.code.gson</groupId>
4545
<artifactId>gson</artifactId>
4646
</dependency>
47+
<dependency>
48+
<groupId>org.hamcrest</groupId>
49+
<artifactId>hamcrest-all</artifactId>
50+
<scope>test</scope>
51+
</dependency>
4752
</dependencies>
4853

4954
<build>

0 commit comments

Comments
 (0)