Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
ef233027
Commit
ef233027
authored
14 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
fix flaky test
SVN: 18798
parent
70f27133
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
base/sourceTest/java/ch/systemsx/cisd/base/tests/AbstractFileSystemTestCase.java
+16
-2
16 additions, 2 deletions
.../systemsx/cisd/base/tests/AbstractFileSystemTestCase.java
with
16 additions
and
2 deletions
base/sourceTest/java/ch/systemsx/cisd/base/tests/AbstractFileSystemTestCase.java
+
16
−
2
View file @
ef233027
...
...
@@ -18,6 +18,7 @@ package ch.systemsx.cisd.base.tests;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
org.apache.commons.io.FileUtils
;
import
org.testng.AssertJUnit
;
...
...
@@ -68,8 +69,13 @@ public abstract class AbstractFileSystemTestCase extends AssertJUnit
public
void
setUp
()
throws
IOException
{
deleteDirectory
(
workingDirectory
);
workingDirectory
.
mkdir
();
assertTrue
(
workingDirectory
.
isDirectory
()
&&
workingDirectory
.
listFiles
().
length
==
0
);
workingDirectory
.
mkdirs
();
assertEquals
(
true
,
workingDirectory
.
isDirectory
());
File
[]
files
=
workingDirectory
.
listFiles
();
if
(
files
!=
null
)
{
assertEquals
(
"Unexpected files "
+
Arrays
.
asList
(
files
),
0
,
files
.
length
);
}
}
private
void
deleteDirectory
(
File
dir
)
...
...
@@ -81,6 +87,14 @@ public abstract class AbstractFileSystemTestCase extends AssertJUnit
{
System
.
err
.
println
(
"Could not delete the directory "
+
dir
.
getPath
()
+
" because: "
+
e
.
getMessage
());
try
{
FileUtils
.
deleteDirectory
(
dir
);
}
catch
(
IOException
e2
)
{
System
.
err
.
println
(
"Could not delete the directory "
+
dir
.
getPath
()
+
" in second try because: "
+
e2
.
getMessage
());
}
}
}
...
...
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