Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTime-Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Tavares de Sousa
TeeTime-Framework
Commits
7c0d5cef
Commit
7c0d5cef
authored
10 years ago
by
Nils Christian Ehmke
Browse files
Options
Downloads
Patches
Plain Diff
Corrected the used pipes in the StageTester
parent
e99f2c40
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/teetime/framework/test/StageTester.java
+8
-9
8 additions, 9 deletions
src/main/java/teetime/framework/test/StageTester.java
with
8 additions
and
9 deletions
src/main/java/teetime/framework/test/StageTester.java
+
8
−
9
View file @
7c0d5cef
...
@@ -17,7 +17,6 @@ package teetime.framework.test;
...
@@ -17,7 +17,6 @@ package teetime.framework.test;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
teetime.framework.Analysis
;
import
teetime.framework.Analysis
;
...
@@ -33,7 +32,7 @@ import teetime.stage.IterableProducer;
...
@@ -33,7 +32,7 @@ import teetime.stage.IterableProducer;
/**
/**
* This class can be used to test single stages in JUnit test cases.
* This class can be used to test single stages in JUnit test cases.
*
*
* @author Nils Christian Ehmke
* @author Nils Christian Ehmke
*/
*/
public
final
class
StageTester
{
public
final
class
StageTester
{
...
@@ -60,10 +59,6 @@ public final class StageTester {
...
@@ -60,10 +59,6 @@ public final class StageTester {
return
this
.
send
(
Arrays
.
asList
(
input
));
return
this
.
send
(
Arrays
.
asList
(
input
));
}
}
public
<
I
>
InputHolder
<
I
>
send
(
final
I
input
)
{
return
this
.
send
(
Collections
.
singletonList
(
input
));
}
public
<
O
>
OutputHolder
<
O
>
receive
(
final
List
<
O
>
output
)
{
public
<
O
>
OutputHolder
<
O
>
receive
(
final
List
<
O
>
output
)
{
OutputHolder
<
O
>
outputHolder
=
new
OutputHolder
<
O
>(
output
);
OutputHolder
<
O
>
outputHolder
=
new
OutputHolder
<
O
>(
output
);
this
.
outputHolders
.
add
(
outputHolder
);
this
.
outputHolders
.
add
(
outputHolder
);
...
@@ -140,16 +135,20 @@ public final class StageTester {
...
@@ -140,16 +135,20 @@ public final class StageTester {
private
final
class
Configuration
extends
AnalysisConfiguration
{
private
final
class
Configuration
extends
AnalysisConfiguration
{
public
Configuration
()
{
public
Configuration
()
{
IPipeFactory
p
ipeFactory
=
AnalysisConfiguration
.
PIPE_FACTORY_REGISTRY
.
getPipeFactory
(
ThreadCommunication
.
INTR
A
,
PipeOrdering
.
ARBITRARY
,
false
);
final
IPipeFactory
interP
ipeFactory
=
PIPE_FACTORY_REGISTRY
.
getPipeFactory
(
ThreadCommunication
.
INT
E
R
,
PipeOrdering
.
QUEUE_BASED
,
false
);
for
(
InputHolder
<?>
inputHolder
:
inputHolders
)
{
for
(
InputHolder
<?>
inputHolder
:
inputHolders
)
{
final
IterableProducer
<
Object
>
producer
=
new
IterableProducer
<
Object
>(
inputHolder
.
getInput
());
final
IterableProducer
<
Object
>
producer
=
new
IterableProducer
<
Object
>(
inputHolder
.
getInput
());
p
ipeFactory
.
create
(
producer
.
getOutputPort
(),
inputHolder
.
getPort
());
interP
ipeFactory
.
create
(
producer
.
getOutputPort
(),
inputHolder
.
getPort
());
addThreadableStage
(
producer
);
addThreadableStage
(
producer
);
}
}
addThreadableStage
(
stage
);
final
IPipeFactory
intraPipeFactory
=
PIPE_FACTORY_REGISTRY
.
getPipeFactory
(
ThreadCommunication
.
INTRA
,
PipeOrdering
.
ARBITRARY
,
false
);
for
(
OutputHolder
<?>
outputHolder
:
outputHolders
)
{
for
(
OutputHolder
<?>
outputHolder
:
outputHolders
)
{
final
CollectorSink
<
Object
>
sink
=
new
CollectorSink
<
Object
>(
outputHolder
.
getOutput
());
final
CollectorSink
<
Object
>
sink
=
new
CollectorSink
<
Object
>(
outputHolder
.
getOutput
());
p
ipeFactory
.
create
(
outputHolder
.
getPort
(),
sink
.
getInputPort
());
intraP
ipeFactory
.
create
(
outputHolder
.
getPort
(),
sink
.
getInputPort
());
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment