package org.onap.appc.ccadaptor;
+import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.powermock.reflect.Whitebox;
public class ConfigComponentAdaptorTest {
-
-
+
+
@Test
public void testGetCliRunningConfig(){
Properties props = null;
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testDownloadCliConfig(){
Properties props = null;
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testXmlDownload(){
Properties props = null;
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testXmlGetrunningconfig(){
Properties props = null;
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testEscapeSql(){
Properties props = null;
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testAll(){
Properties props = null;
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
- @Test(expected=Exception.class)
+
+ @Test
public void testAll1(){
Properties props = null;
ConfigComponentAdaptor cca = new ConfigComponentAdaptor(props);
parameters.put("Host_ip_address", "test");
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
+
@Test(expected=Exception.class)
public void testAll2(){
Properties props = null;
parameters.put("Host_ip_address", "test");
SvcLogicContext ctx = new SvcLogicContext();
ctx.setAttribute("service-data.vnf-config-parameters-list.vnf-config-parameters[0].update-configuration[0].block-key-name", "test");
- cca.configure(key, parameters, ctx);
+ cca.configure(key, parameters, ctx);
}
-
+
@Test
public void testGetStringBetweenQuotes() throws Exception{
Properties props = null;
String result =Whitebox.invokeMethod(cca, "getStringBetweenQuotes","\"testvalue\"");
Assert.assertEquals("testvalue", result);
}
-
+
@Test
public void testBuildXmlRequest() throws Exception{
Properties props = null;
ConfigComponentAdaptor cca = new ConfigComponentAdaptor(props);
Map<String, String> param = new HashMap<String,String>();
- Whitebox.invokeMethod(cca, "buildXmlRequest",param,"template");
+ Whitebox.invokeMethod(cca, "buildXmlRequest",param,"template");
}
-
+
@Test
public void testTrimResponse() throws Exception{
Properties props = null;
String result =Whitebox.invokeMethod(cca, "trimResponse","testData");
Assert.assertEquals("", result);
}
-
+
@Test
public void testBuildNetworkData2() throws Exception{
Properties props = null;
String result =Whitebox.invokeMethod(cca, "buildNetworkData2",ctx,"template","operation");
Assert.assertEquals("template", result);
}
-
+
//@Test
public void testGetLastFewLinesOfFile() throws Exception{
Properties props = null;
ConfigComponentAdaptor cca = new ConfigComponentAdaptor(props);
- Whitebox.invokeMethod(cca, "readFile","test");
+ Whitebox.invokeMethod(cca, "readFile","test");
}
-
+
@Test
public void testConnect() throws Exception{
Properties props = null;
cca.activate("key", ctx);
}
-
+
@Test(expected=Exception.class)
public void testActivate() throws Exception{
Properties props = null;
String result =Whitebox.invokeMethod(cca, "activate",ctx,true);
Assert.assertEquals("template", result);
}
-
+
@Test(expected=Exception.class)
public void testAudit() throws Exception{
Properties props = null;
String result =Whitebox.invokeMethod(cca, "audit",ctx,"test");
Assert.assertEquals("template", result);
}
-
+
@Test(expected=Exception.class)
public void testPrepare() throws Exception{
Properties props = null;