Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-datamodel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-datamodel
Commits
d8c0ecf6
Commit
d8c0ecf6
authored
4 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
Added support to param list in Transfer representation + tests
parent
f70095c4
No related branches found
No related tags found
No related merge requests found
Pipeline
#1321
passed
4 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/net/ivoa/xml/vospace/v2/Transfer.java
+37
-1
37 additions, 1 deletion
src/main/java/net/ivoa/xml/vospace/v2/Transfer.java
src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java
+11
-1
11 additions, 1 deletion
src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java
with
48 additions
and
2 deletions
src/main/java/net/ivoa/xml/vospace/v2/Transfer.java
+
37
−
1
View file @
d8c0ecf6
...
@@ -69,7 +69,8 @@ import javax.xml.bind.annotation.XmlType;
...
@@ -69,7 +69,8 @@ import javax.xml.bind.annotation.XmlType;
"direction"
,
"direction"
,
"view"
,
"view"
,
"protocols"
,
"protocols"
,
"keepBytes"
"keepBytes"
,
"param"
})
})
// <edit>
// <edit>
@XmlRootElement
@XmlRootElement
...
@@ -88,6 +89,9 @@ public class Transfer {
...
@@ -88,6 +89,9 @@ public class Transfer {
@XmlAttribute
@XmlAttribute
protected
String
version
;
protected
String
version
;
// </edit>
// </edit>
// <edit> Fix: param is missing in VOSpace XSD
@XmlElement
(
nillable
=
true
)
protected
List
<
Param
>
param
;
/**
/**
* Gets the value of the target property.
* Gets the value of the target property.
...
@@ -224,4 +228,36 @@ public class Transfer {
...
@@ -224,4 +228,36 @@ public class Transfer {
}
}
// </edit>
// </edit>
// <edit>
/**
* Gets the value of the param property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the param property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getParam().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Param }
*
*
*/
public
List
<
Param
>
getParam
()
{
if
(
param
==
null
)
{
param
=
new
ArrayList
<
Param
>();
}
return
this
.
param
;
}
// </edit>
}
}
This diff is collapsed.
Click to expand it.
src/test/java/net/ivoa/xml/vospace/v2/TransferTest.java
+
11
−
1
View file @
d8c0ecf6
package
net.ivoa.xml.vospace.v2
;
package
net.ivoa.xml.vospace.v2
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
it.inaf.oats.vospace.datamodel.NodeProperties
;
import
java.io.StringReader
;
import
java.io.StringReader
;
import
java.io.StringWriter
;
import
java.io.StringWriter
;
import
javax.xml.bind.JAXB
;
import
javax.xml.bind.JAXB
;
...
@@ -45,6 +46,12 @@ public class TransferTest {
...
@@ -45,6 +46,12 @@ public class TransferTest {
transfer
.
getProtocols
().
add
(
protocol
);
transfer
.
getProtocols
().
add
(
protocol
);
Param
groupWriteParam
=
new
Param
();
groupWriteParam
.
setUri
(
NodeProperties
.
GROUP_WRITE_URI
);
groupWriteParam
.
setValue
(
"group1 group2"
);
transfer
.
getParam
().
add
(
groupWriteParam
);
return
transfer
;
return
transfer
;
}
}
...
@@ -53,6 +60,9 @@ public class TransferTest {
...
@@ -53,6 +60,9 @@ public class TransferTest {
assertEquals
(
serialized
.
getTarget
(),
deserialized
.
getTarget
());
assertEquals
(
serialized
.
getTarget
(),
deserialized
.
getTarget
());
assertEquals
(
serialized
.
getDirection
(),
deserialized
.
getDirection
());
assertEquals
(
serialized
.
getDirection
(),
deserialized
.
getDirection
());
assertEquals
(
serialized
.
getProtocols
().
size
(),
deserialized
.
getProtocols
().
size
());
assertEquals
(
serialized
.
getProtocols
().
size
(),
deserialized
.
getProtocols
().
size
());
assertEquals
(
serialized
.
getParam
().
size
(),
deserialized
.
getParam
().
size
());
assertEquals
(
serialized
.
getProtocols
().
get
(
0
).
getEndpoint
(),
deserialized
.
getProtocols
().
get
(
0
).
getEndpoint
());
assertEquals
(
serialized
.
getProtocols
().
get
(
0
).
getEndpoint
(),
deserialized
.
getProtocols
().
get
(
0
).
getEndpoint
());
assertEquals
(
serialized
.
getParam
().
get
(
0
).
getUri
(),
deserialized
.
getParam
().
get
(
0
).
getUri
());
assertEquals
(
serialized
.
getParam
().
get
(
0
).
getValue
(),
deserialized
.
getParam
().
get
(
0
).
getValue
());
}
}
}
}
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