Commit dff944f8 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added isServiceUp

parent b5b5f7bb
...@@ -150,10 +150,13 @@ public class CloudStormServiceTest { ...@@ -150,10 +150,13 @@ public class CloudStormServiceTest {
*/ */
@Test @Test
public void testWriteCloudStormTopologyFiles() throws Exception { public void testWriteCloudStormTopologyFiles() throws Exception {
System.out.println("writeCloudStormTopologyFiles"); if (ToscaHelper.isServiceUp(sureToscaBasePath)) {
CloudStormService instance = getService(messageExampleProvisioneRequestFilePath); System.out.println("writeCloudStormTopologyFiles");
Map<String, Object> result = instance.writeCloudStormTopologyFiles(tempInputDirPath); CloudStormService instance = getService(messageExampleProvisioneRequestFilePath);
assertNotNull(result); Map<String, Object> result = instance.writeCloudStormTopologyFiles(tempInputDirPath);
assertNotNull(result);
}
} }
/** /**
...@@ -163,25 +166,26 @@ public class CloudStormServiceTest { ...@@ -163,25 +166,26 @@ public class CloudStormServiceTest {
*/ */
@Test @Test
public void testBuildSSHKeyPair() throws Exception { public void testBuildSSHKeyPair() throws Exception {
System.out.println("buildSSHKeyPair"); if (ToscaHelper.isServiceUp(sureToscaBasePath)) {
CloudStormService instance = getService(messageExampleProvisioneRequestFilePath); System.out.println("buildSSHKeyPair");
initPaths(); CloudStormService instance = getService(messageExampleProvisioneRequestFilePath);
String result = instance.buildSSHKeyPair(tempInputDirPath, null); initPaths();
assertNotNull(result); String result = instance.buildSSHKeyPair(tempInputDirPath, null);
String userPublicKeyName = "id_rsa.pub"; assertNotNull(result);
String userPrivateName = FilenameUtils.removeExtension(userPublicKeyName); String userPublicKeyName = "id_rsa.pub";
assertTrue(new File(tempInputDirPath + File.separator + userPrivateName).exists()); String userPrivateName = FilenameUtils.removeExtension(userPublicKeyName);
assertTrue(new File(tempInputDirPath + File.separator + userPublicKeyName).exists()); assertTrue(new File(tempInputDirPath + File.separator + userPrivateName).exists());
assertTrue(new File(tempInputDirPath + File.separator + userPublicKeyName).exists());
instance = getService(messageExampleDeleteRequestFilePath);
initPaths();
result = instance.buildSSHKeyPair(tempInputDirPath, null);
assertNotNull(result);
userPublicKeyName = "id_rsa.pub";
userPrivateName = FilenameUtils.removeExtension(userPublicKeyName);
assertTrue(new File(tempInputDirPath + File.separator + userPrivateName).exists());
assertTrue(new File(tempInputDirPath + File.separator + userPublicKeyName).exists());
instance = getService(messageExampleDeleteRequestFilePath);
initPaths();
result = instance.buildSSHKeyPair(tempInputDirPath, null);
assertNotNull(result);
userPublicKeyName = "id_rsa.pub";
userPrivateName = FilenameUtils.removeExtension(userPublicKeyName);
assertTrue(new File(tempInputDirPath + File.separator + userPrivateName).exists());
assertTrue(new File(tempInputDirPath + File.separator + userPublicKeyName).exists());
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment