Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
TangoParser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
Calculation
TangoParser
Commits
aa7c4f37
Commit
aa7c4f37
authored
May 18, 2022
by
gwen-soleil
Browse files
Options
Downloads
Patches
Plain Diff
fix test set up that was not waiting for the device initialisation completion.
parent
db40ada1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/fr/soleil/tango/server/tangoparser/testserver/TangoParserTest.java
+54
-56
54 additions, 56 deletions
.../tango/server/tangoparser/testserver/TangoParserTest.java
with
54 additions
and
56 deletions
src/test/java/fr/soleil/tango/server/tangoparser/testserver/TangoParserTest.java
+
54
−
56
View file @
aa7c4f37
...
...
@@ -16,6 +16,7 @@ import static org.mockito.Mockito.when;
import
java.lang.reflect.Array
;
import
java.util.Map
;
import
fr.esrf.TangoApi.DeviceProxy
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.Ignore
;
...
...
@@ -146,7 +147,7 @@ public class TangoParserTest {
private
static
SourceManager
mngr
=
Mockito
.
spy
(
SourceManager
.
class
);
@BeforeClass
public
static
void
setUp
()
throws
DevFailed
{
public
static
void
setUp
()
throws
DevFailed
,
InterruptedException
{
System
.
setProperty
(
"org.tango.server.checkalarms"
,
"false"
);
// assertThat(System.getProperty("TANGO_HOST"), notNullValue());
//System.setProperty("TANGO_HOST", "192.168.56.101:10000");
...
...
@@ -305,33 +306,30 @@ public class TangoParserTest {
ServerManager
.
getInstance
().
addClass
(
TangoParser
.
class
.
getSimpleName
(),
TangoParser
.
class
);
ServerManager
.
getInstance
().
start
(
new
String
[]{
INSTANCE_NAME
},
TangoParser
.
class
.
getSimpleName
());
boolean
launched
=
fals
e
;
boolean
launched
=
tru
e
;
long
maximumTime
=
20000
;
long
timer
=
maximumTime
;
long
stepTime
=
1500
;
DevState
startState
=
DevState
.
UNKNOWN
;
while
(!
launched
&&
timer
>
0
)
{
final
DeviceProxy
tangoParser
=
new
DeviceProxy
(
deviceNameParser
)
;
DevState
startState
=
tangoParser
.
state
();
try
{
while
(
startState
.
equals
(
DevState
.
INIT
)
&&
timer
>
0
)
{
Thread
.
sleep
(
stepTime
);
}
catch
(
final
InterruptedException
e
)
{
}
try
{
final
TangoAttribute
tangoParser
=
new
TangoAttribute
(
deviceNameParser
+
"/state"
);
startState
=
(
DevState
)
tangoParser
.
read
();
System
.
out
.
println
(
"State readed !"
);
launched
=
true
;
}
catch
(
DevFailed
e
)
{
launched
=
false
;
}
startState
=
tangoParser
.
state
();
System
.
out
.
println
(
"State = "
+
startState
);
timer
-=
stepTime
;
}
launched
=
timer
>
0
;
}
catch
(
DevFailed
e
)
{
DevFailedUtils
.
printDevFailed
(
e
);
throw
e
;
}
if
(
launched
)
{
System
.
out
.
println
(
"Device started in "
+
Double
.
toString
((
maximumTime
-
timer
)
/
1000.0
)
+
" seconds."
);
System
.
out
.
println
(
"Device state: "
+
startState
.
toString
()
);
System
.
out
.
println
(
"Device state: "
+
startState
);
}
else
{
System
.
out
.
println
(
"Device
failed to start."
+
startState
.
toStr
ing
()
);
System
.
out
.
println
(
"Device
start up took too much time, abort
ing
"
);
}
System
.
out
.
println
(
"Set up done"
);
...
...
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