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
5d23537e
Commit
5d23537e
authored
11 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
SP-724, BIS-428: fix test
SVN: 29456
parent
92aed7e5
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
openbis-common/sourceTest/java/ch/systemsx/cisd/openbis/common/io/hierarchical_content/ZipBasedHierarchicalContentTest.java
+27
-17
27 additions, 17 deletions
...hierarchical_content/ZipBasedHierarchicalContentTest.java
with
27 additions
and
17 deletions
openbis-common/sourceTest/java/ch/systemsx/cisd/openbis/common/io/hierarchical_content/ZipBasedHierarchicalContentTest.java
+
27
−
17
View file @
5d23537e
...
...
@@ -54,10 +54,20 @@ public class ZipBasedHierarchicalContentTest extends AbstractFileSystemTestCase
private
static
final
File
TEST_HDF5_CONTAINER
=
new
File
(
"../openbis-common/resource/test-data/HDF5ContainerBasedHierarchicalContentNodeTest/thumbnails.h5"
);
private
IHierarchicalContent
content
;
public
static
File
[]
getUnzippedFiles
()
{
File
[]
tempFiles
=
ZipBasedHierarchicalContent
.
TEMP_FOLDER
.
listFiles
(
new
FilenameFilter
()
{
@Override
public
boolean
accept
(
File
file
,
String
name
)
{
return
name
.
startsWith
(
ZipBasedHierarchicalContent
.
TEMP_FILE_PREFIX
);
}
});
return
tempFiles
;
}
@BeforeMethod
public
void
setUpContent
()
throws
Exception
public
static
void
removeUnzippedFiles
()
{
File
[]
unzippedFiles
=
getUnzippedFiles
();
for
(
File
unzippedFile
:
unzippedFiles
)
...
...
@@ -65,6 +75,15 @@ public class ZipBasedHierarchicalContentTest extends AbstractFileSystemTestCase
FileUtilities
.
delete
(
unzippedFile
);
}
}
private
IHierarchicalContent
content
;
@BeforeMethod
public
void
setUpContent
()
throws
Exception
{
removeUnzippedFiles
();
}
@AfterMethod
public
void
closeContent
()
...
...
@@ -129,19 +148,8 @@ public class ZipBasedHierarchicalContentTest extends AbstractFileSystemTestCase
HDF5ContainerBasedHierarchicalContentNodeTest
.
assertH5ExampleContent
(
hdf5Node
);
}
private
File
[]
getUnzippedFiles
()
{
File
[]
tempFiles
=
ZipBasedHierarchicalContent
.
TEMP_FOLDER
.
listFiles
(
new
FilenameFilter
()
{
@Override
public
boolean
accept
(
File
file
,
String
name
)
{
return
name
.
startsWith
(
ZipBasedHierarchicalContent
.
TEMP_FILE_PREFIX
);
}
});
return
tempFiles
;
content
.
close
();
assertEquals
(
"[]"
,
Arrays
.
asList
(
getUnzippedFiles
()).
toString
());
}
private
void
assertDirectoryNode
(
String
expectedPath
,
String
expectedName
,
IHierarchicalContentNode
node
)
...
...
@@ -228,7 +236,9 @@ public class ZipBasedHierarchicalContentTest extends AbstractFileSystemTestCase
{
path
+=
"/"
;
}
zipOutputStream
.
putNextEntry
(
new
ZipEntry
(
path
));
ZipEntry
entry
=
new
ZipEntry
(
path
);
entry
.
setTime
(
file
.
lastModified
());
zipOutputStream
.
putNextEntry
(
entry
);
}
catch
(
IOException
ex
)
{
throw
CheckedExceptionTunnel
.
wrapIfNecessary
(
ex
);
...
...
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