Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
0ff9c39b
Commit
0ff9c39b
authored
Dec 29, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed null attributes bug
parent
2db19479
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
38 deletions
+19
-38
ToscaHelperTest.java
...t/java/nl/uva/sne/drip/commons/utils/ToscaHelperTest.java
+17
-36
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+2
-2
No files found.
drip-commons/src/test/java/nl/uva/sne/drip/commons/utils/ToscaHelperTest.java
View file @
0ff9c39b
...
...
@@ -202,14 +202,12 @@ public class ToscaHelperTest {
toscaTemplateWithCredentials
=
instance
.
setVMTopologyInToscaTemplate
(
toscaTemplate
,
vmTopologyMap
);
}
System
.
err
.
println
(
instance
.
getId
());
instance
.
uploadToscaTemplate
(
toscaTemplateWithCredentials
);
System
.
err
.
println
(
instance
.
getId
());
NodeTemplate
topology_1
=
toscaTemplateWithCredentials
.
getTopologyTemplate
().
getNodeTemplates
().
get
(
"topology_1"
);
Map
<
String
,
Object
>
attributes
=
topology_1
.
getAttributes
();
assertNotNull
(
attributes
);
assertNotNull
(
attributes
.
get
(
"credential"
));
NodeTemplate
topology
=
toscaTemplateWithCredentials
.
getTopologyTemplate
().
getNodeTemplates
().
get
(
"topology
_1
"
);
NodeTemplate
topology
=
toscaTemplateWithCredentials
.
getTopologyTemplate
().
getNodeTemplates
().
get
(
"topology"
);
attributes
=
topology
.
getAttributes
();
assertNotNull
(
attributes
);
assertNotNull
(
attributes
.
get
(
"credential"
));
...
...
@@ -221,41 +219,24 @@ public class ToscaHelperTest {
assertNotNull
(
toscaCredentials
);
}
instance
.
uploadToscaTemplate
(
toscaTemplate
);
vmTopologies
=
instance
.
getVMTopologyTemplates
();
ToscaTemplate
toscaTemplateWithInterface
=
null
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
Provisioner
provisioner
=
new
Provisioner
();
provisioner
.
setName
(
"CloudsStorm"
);
provisioner
.
setDescription
(
"Interface for VM topology management with CloudsStorm. More at https://cloudsstorm.github.io/"
);
provisioner
.
setToscaInterfaceType
(
"tosca.interfaces.ARTICONF.CloudsStorm"
);
String
operation
=
"provision"
;
vmTopologyMap
=
instance
.
setProvisionerInterfaceInVMTopology
(
vmTopologyMap
,
provisioner
,
operation
);
toscaTemplateWithInterface
=
instance
.
setVMTopologyInToscaTemplate
(
toscaTemplate
,
vmTopologyMap
);
}
instance
.
uploadToscaTemplate
(
toscaTemplateWithInterface
);
topology_1
=
toscaTemplateWithCredentials
.
getTopologyTemplate
().
getNodeTemplates
().
get
(
"topology_1"
);
}
topology
=
toscaTemplateWithCredentials
.
getTopologyTemplate
().
getNodeTemplates
().
get
(
"topology"
);
/**
* Test of setVMTopologyInToscaTemplate method, of class ToscaHelper.
*/
@Test
public
void
testSetVMTopologyInToscaTemplate
()
{
System
.
out
.
println
(
"setVMTopologyInToscaTemplate"
);
ToscaTemplate
toscaTemplate
=
null
;
NodeTemplateMap
vmTopologyMap
=
null
;
ToscaHelper
instance
=
null
;
ToscaTemplate
expResult
=
null
;
ToscaTemplate
result
=
instance
.
setVMTopologyInToscaTemplate
(
toscaTemplate
,
vmTopologyMap
);
assertEquals
(
expResult
,
result
);
// TODO review the generated test code and remove the default call to fail.
fail
(
"The test case is a prototype."
);
instance
.
uploadToscaTemplate
(
toscaTemplate
);
}
/**
* Test of setProvisionerInterfaceInVMTopology method, of class ToscaHelper.
*/
@Test
public
void
testSetProvisionerInterfaceInVMTopology
()
throws
Exception
{
System
.
out
.
println
(
"setProvisionerInterfaceInVMTopology"
);
NodeTemplateMap
vmTopologyMap
=
null
;
Provisioner
provisioner
=
null
;
String
operation
=
""
;
ToscaHelper
instance
=
null
;
NodeTemplateMap
expResult
=
null
;
NodeTemplateMap
result
=
instance
.
setProvisionerInterfaceInVMTopology
(
vmTopologyMap
,
provisioner
,
operation
);
assertEquals
(
expResult
,
result
);
// TODO review the generated test code and remove the default call to fail.
fail
(
"The test case is a prototype."
);
}
}
drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
0ff9c39b
...
...
@@ -96,7 +96,7 @@ public class DRIPService {
}
private
ToscaTemplate
addCredentials
(
ToscaTemplate
toscaTemplate
)
throws
IOException
,
JsonProcessingException
,
ApiException
,
Exception
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
//
helper.uploadToscaTemplate(toscaTemplate);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
Credential
>
credentials
=
null
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
...
...
@@ -126,7 +126,7 @@ public class DRIPService {
}
private
ToscaTemplate
addProvisionInterface
(
ToscaTemplate
toscaTemplate
,
String
operation
)
throws
IOException
,
JsonProcessingException
,
ApiException
,
Exception
{
helper
.
uploadToscaTemplate
(
toscaTemplate
);
//
helper.uploadToscaTemplate(toscaTemplate);
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
Provisioner
>
provisioners
=
null
;
for
(
NodeTemplateMap
vmTopologyMap
:
vmTopologies
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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