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
102abf04
Commit
102abf04
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
fixed StageTest
parent
b010838d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/teetime/framework/Stage.java
+8
-3
8 additions, 3 deletions
src/main/java/teetime/framework/Stage.java
src/test/java/teetime/framework/StageTest.java
+2
-0
2 additions, 0 deletions
src/test/java/teetime/framework/StageTest.java
with
10 additions
and
3 deletions
src/main/java/teetime/framework/Stage.java
+
8
−
3
View file @
102abf04
package
teetime.framework
;
package
teetime.framework
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -12,8 +12,9 @@ import teetime.framework.validation.InvalidPortConnection;
...
@@ -12,8 +12,9 @@ import teetime.framework.validation.InvalidPortConnection;
public
abstract
class
Stage
{
// NOPMD (should not start with "Abstract")
public
abstract
class
Stage
{
// NOPMD (should not start with "Abstract")
private
static
final
ConcurrentMap
<
String
,
Integer
>
INSTANCES_COUNTER
=
new
ConcurrentHashMap
<
String
,
Integer
>();
private
final
String
id
;
private
final
String
id
;
private
static
final
Map
<
String
,
Integer
>
INSTANCES_COUNTER
=
new
ConcurrentHashMap
<
String
,
Integer
>();
/**
/**
* A unique logger instance per stage instance
* A unique logger instance per stage instance
*/
*/
...
@@ -21,7 +22,7 @@ public abstract class Stage { // NOPMD (should not start with "Abstract")
...
@@ -21,7 +22,7 @@ public abstract class Stage { // NOPMD (should not start with "Abstract")
protected
Stage
()
{
protected
Stage
()
{
this
.
id
=
this
.
createId
();
this
.
id
=
this
.
createId
();
this
.
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
().
getName
()
+
"-"
+
this
.
id
);
this
.
logger
=
LoggerFactory
.
getLogger
(
this
.
id
);
}
}
public
String
getId
()
{
public
String
getId
()
{
...
@@ -46,6 +47,10 @@ public abstract class Stage { // NOPMD (should not start with "Abstract")
...
@@ -46,6 +47,10 @@ public abstract class Stage { // NOPMD (should not start with "Abstract")
return
newId
;
return
newId
;
}
}
static
void
clearInstanceCounters
()
{
// NOPMD (package-private to clear map in tests)
INSTANCES_COUNTER
.
clear
();
}
// public abstract Stage getParentStage();
// public abstract Stage getParentStage();
//
//
// public abstract void setParentStage(Stage parentStage, int index);
// public abstract void setParentStage(Stage parentStage, int index);
...
...
This diff is collapsed.
Click to expand it.
src/test/java/teetime/framework/StageTest.java
+
2
−
0
View file @
102abf04
...
@@ -10,6 +10,8 @@ public class StageTest {
...
@@ -10,6 +10,8 @@ public class StageTest {
@Test
@Test
public
void
testId
()
{
public
void
testId
()
{
Stage
.
clearInstanceCounters
();
Counter
<
Object
>
counter0
=
new
Counter
<
Object
>();
Counter
<
Object
>
counter0
=
new
Counter
<
Object
>();
Counter
<
Object
>
counter1
=
new
Counter
<
Object
>();
Counter
<
Object
>
counter1
=
new
Counter
<
Object
>();
Assert
.
assertEquals
(
"Counter-0"
,
counter0
.
getId
());
Assert
.
assertEquals
(
"Counter-0"
,
counter0
.
getId
());
...
...
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