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
4e583dce
Commit
4e583dce
authored
9 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
added first test
parent
41fff673
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/main/java/teetime/framework/Execution.java
+1
-1
1 addition, 1 deletion
src/main/java/teetime/framework/Execution.java
src/test/java/teetime/framework/TerminationTest.java
+48
-0
48 additions, 0 deletions
src/test/java/teetime/framework/TerminationTest.java
with
50 additions
and
2 deletions
pom.xml
+
1
−
1
View file @
4e583dce
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<javadocOutputDir>
apidocs
</javadocOutputDir>
<javadocOutputDir>
apidocs
</javadocOutputDir>
<java.version>
1.6
</java.version>
<java.version>
1.6
</java.version>
<checkstyle.version>
2.16
</checkstyle.version>
<checkstyle.version>
2.16
</checkstyle.version>
<findbugs.version>
3.0.1
</findbugs.version>
<findbugs.version>
3.0.1
</findbugs.version>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/teetime/framework/Execution.java
+
1
−
1
View file @
4e583dce
...
@@ -118,7 +118,7 @@ public final class Execution<T extends Configuration> {
...
@@ -118,7 +118,7 @@ public final class Execution<T extends Configuration> {
}
}
// TODO: implement
// TODO: implement
p
rivate
void
abortEventually
()
{
p
ublic
void
abortEventually
()
{
configurationContext
.
abortConfigurationRun
();
configurationContext
.
abortConfigurationRun
();
waitForTermination
();
waitForTermination
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/teetime/framework/TerminationTest.java
0 → 100644
+
48
−
0
View file @
4e583dce
package
teetime.framework
;
import
org.junit.Test
;
import
teetime.stage.InitialElementProducer
;
public
class
TerminationTest
{
@Test
(
timeout
=
2000
)
public
void
doesNotGetStuckInAdd
()
throws
InterruptedException
{
Execution
<
TerminationConfig
>
execution
=
new
Execution
<
TerminationConfig
>(
new
TerminationConfig
());
execution
.
executeNonBlocking
();
Thread
.
sleep
(
1000
);
execution
.
abortEventually
();
}
private
class
TerminationConfig
extends
Configuration
{
InitialElementProducer
<
Integer
>
init
=
new
InitialElementProducer
<
Integer
>(
1
,
2
,
3
,
4
,
5
,
6
);
DoesNotRetrieveElements
sinkStage
=
new
DoesNotRetrieveElements
();
public
TerminationConfig
()
{
connectPorts
(
init
.
getOutputPort
(),
sinkStage
.
getInputPort
(),
1
);
addThreadableStage
(
sinkStage
);
}
}
private
class
DoesNotRetrieveElements
extends
AbstractConsumerStage
<
Integer
>
{
@Override
protected
void
execute
(
final
Integer
element
)
{
try
{
Thread
.
sleep
(
10000
);
}
catch
(
InterruptedException
e
)
{
// Will happen in this test
}
}
@Override
protected
void
terminate
()
{
Thread
.
currentThread
().
interrupt
();
System
.
out
.
println
(
"TADA "
+
this
.
shouldBeTerminated
());
}
}
}
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