First part of onap rename
[appc.git] / appc-client / client-kit / src / test / java / org / openecomp / appc / client / lcm / impl / business / TestAppcLifeCycleManagerServiceFactoryImpl.java
1 package org.onap.appc.client.lcm.impl.business;
2
3
4 import org.junit.Assert;
5 import org.junit.Ignore;
6 import org.junit.Test;
7 import org.onap.appc.client.lcm.api.ApplicationContext;
8 import org.onap.appc.client.lcm.api.LifeCycleManagerStateful;
9 import org.onap.appc.client.lcm.exceptions.AppcClientException;
10 import org.onap.appc.client.lcm.impl.business.LCMRequestProcessor;
11
12 import java.io.FileInputStream;
13 import java.io.FileNotFoundException;
14 import java.io.IOException;
15 import java.io.InputStream;
16 import java.util.Properties;
17
18 public class TestAppcLifeCycleManagerServiceFactoryImpl {
19
20     AppcLifeCycleManagerServiceFactoryImpl appcLifeCycleManagerServiceFactory=new AppcLifeCycleManagerServiceFactoryImpl();
21
22     @Ignore
23     public void testCreateLifeCycleManagerStateful() throws AppcClientException{
24         LifeCycleManagerStateful lifeCycleManagerStateful;
25         ApplicationContext applicationContext=new ApplicationContext();
26         applicationContext.setApplicationID("AppID");
27         applicationContext.setMechID("mechId");
28         String folder="src/test/resources/data";
29         Properties properties =getProperties(folder);
30         lifeCycleManagerStateful=appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(applicationContext,properties);
31
32         Assert.assertNotNull(lifeCycleManagerStateful);
33
34     }
35
36     public static Properties getProperties(String folder) {
37         Properties prop = new Properties();
38
39         InputStream conf = null;
40         try {
41             conf = new FileInputStream(folder + "client-simulator.properties");
42         } catch (FileNotFoundException e) {
43
44         }
45         if (conf != null) {
46             try {
47                 prop.load(conf);
48             } catch (IOException e) {
49                 e.printStackTrace();
50             }
51         } else {
52             try {
53                 prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("client-simulator.properties"));
54             } catch (Exception e) {
55                 throw new RuntimeException("### ERROR ### - Could not load properties to test");
56             }
57         }
58         return prop;
59     }
60 }