Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VOSpace INAF
vospace-rest
Commits
03d32b5d
Commit
03d32b5d
authored
Sep 14, 2021
by
Sonia Zorba
Browse files
Removed unused code
parent
a64d0815
Pipeline
#2334
passed with stages
in 2 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/it/inaf/oats/vospace/persistence/NodeDAO.java
View file @
03d32b5d
...
...
@@ -140,25 +140,6 @@ public class NodeDAO {
return
Optional
.
of
(
node
);
}
public
List
<
String
>
listNodeChildren
(
String
path
)
{
String
sql
=
"SELECT n.name\n"
+
"FROM node n\n"
+
"WHERE n.path ~ ('*.' || id_from_vos_path(?) || '.*{1}')::lquery\n"
+
"ORDER BY n.path"
;
List
<
String
>
childrenNames
=
jdbcTemplate
.
query
(
conn
->
{
PreparedStatement
ps
=
conn
.
prepareStatement
(
sql
);
int
i
=
0
;
ps
.
setString
(++
i
,
path
);
return
ps
;
},
(
row
,
index
)
->
{
return
row
.
getString
(
"name"
);
});
return
childrenNames
;
}
public
Node
setNode
(
Node
newNode
)
{
return
setNode
(
newNode
,
false
);
}
...
...
src/test/java/it/inaf/oats/vospace/persistence/NodeDAOTest.java
View file @
03d32b5d
...
...
@@ -50,7 +50,7 @@ public class NodeDAOTest {
ReflectionTestUtils
.
setField
(
dao
,
"authority"
,
AUTHORITY
);
}
@Test
public
void
testCreateNode
()
{
DataNode
dataNode
=
new
DataNode
();
...
...
@@ -100,16 +100,6 @@ public class NodeDAOTest {
assertEquals
(
bTime
,
NodeProperties
.
getNodePropertyByURI
(
root
.
getNodes
().
get
(
0
),
NodeProperties
.
DATE_URI
));
}
@Test
public
void
testListNodeChildren
()
{
assertTrue
(
dao
.
listNodeChildren
(
"/test4"
).
isEmpty
());
List
<
String
>
children
=
dao
.
listNodeChildren
(
"/test2"
);
assertFalse
(
children
.
isEmpty
());
assertTrue
(
children
.
size
()
==
2
);
assertTrue
(
children
.
containsAll
(
List
.
of
(
"f4"
,
"f5"
)));
}
@Test
public
void
testGetQuotaAndMD5
()
{
...
...
@@ -285,7 +275,7 @@ public class NodeDAOTest {
}
@Test
public
void
testMoveNodeBranch
()
{
// Let's move /test3/m1 to /test3/group1
...
...
@@ -321,7 +311,7 @@ public class NodeDAOTest {
Optional
<
Long
>
optSourceChildId
=
dao
.
getNodeId
(
"/test3/m1/m2"
);
assertTrue
(
optSourceChildId
.
isPresent
());
Optional
<
Long
>
optSourceChildLinkId
=
dao
.
getNodeId
(
"/test3/m1/link1"
);
assertTrue
(
optSourceChildLinkId
.
isPresent
());
...
...
@@ -341,38 +331,38 @@ public class NodeDAOTest {
Optional
<
Long
>
recheckSourceChild
=
dao
.
getNodeId
(
"/test3/m1/m2"
);
assertTrue
(
recheckSourceChild
.
isPresent
());
Optional
<
Long
>
resultIdChildLink
=
dao
.
getNodeId
(
"/test3/group1/copy_of_m1/link1"
);
assertTrue
(
resultIdChildLink
.
isPresent
());
Optional
<
Long
>
recheckSourceChildLink
=
dao
.
getNodeId
(
"/test3/m1/link1"
);
assertTrue
(
recheckSourceChildLink
.
isPresent
());
}
@Test
public
void
testMoveAndCopyIntegrated
()
{
assertTrue
(
dao
.
getNodeId
(
"/mycontainer"
).
isPresent
());
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/destination2"
).
isPresent
());
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/destination2/control"
).
isPresent
());
dao
.
copyBranch
(
"/mycontainer/destination2/control"
,
"/mycontainer/control"
);
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/container1"
).
isPresent
());
Optional
<
ShortNodeDescriptor
>
optSnd
=
Optional
<
ShortNodeDescriptor
>
optSnd
=
dao
.
getShortNodeDescriptor
(
"/mycontainer/destination2"
,
"user3"
,
List
.
of
(
"group1"
));
dao
.
moveNodeBranch
(
dao
.
getNodeId
(
"/mycontainer/container1"
).
get
(),
optSnd
.
get
().
getDestinationNodeLtreePath
());
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/destination2/container1"
).
isPresent
());
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/container1"
).
isEmpty
());
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/container1"
).
isEmpty
());
dao
.
copyBranch
(
"/mycontainer/destination2/container1"
,
"/mycontainer/container1"
);
assertTrue
(
dao
.
getNodeId
(
"/mycontainer/container1"
).
isPresent
());
}
@Test
public
void
testRenameNode
()
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment