2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.appc.client.lcm.impl.business;
27 import org.junit.Assert;
28 import org.junit.Ignore;
29 import org.junit.Test;
30 import org.onap.appc.client.lcm.api.ApplicationContext;
31 import org.onap.appc.client.lcm.api.LifeCycleManagerStateful;
32 import org.onap.appc.client.lcm.exceptions.AppcClientException;
33 import org.onap.appc.client.lcm.impl.business.LCMRequestProcessor;
35 import java.io.FileInputStream;
36 import java.io.FileNotFoundException;
37 import java.io.IOException;
38 import java.io.InputStream;
39 import java.util.Properties;
41 public class TestAppcLifeCycleManagerServiceFactoryImpl {
43 AppcLifeCycleManagerServiceFactoryImpl appcLifeCycleManagerServiceFactory=new AppcLifeCycleManagerServiceFactoryImpl();
46 public void testCreateLifeCycleManagerStateful() throws AppcClientException{
47 LifeCycleManagerStateful lifeCycleManagerStateful;
48 ApplicationContext applicationContext=new ApplicationContext();
49 applicationContext.setApplicationID("AppID");
50 applicationContext.setMechID("mechId");
51 String folder="src/test/resources/data";
52 Properties properties =getProperties(folder);
53 lifeCycleManagerStateful=appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(applicationContext,properties);
55 Assert.assertNotNull(lifeCycleManagerStateful);
59 public static Properties getProperties(String folder) {
60 Properties prop = new Properties();
62 InputStream conf = null;
64 conf = new FileInputStream(folder + "client-simulator.properties");
65 } catch (FileNotFoundException e) {
71 } catch (IOException e) {
76 prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("client-simulator.properties"));
77 } catch (Exception e) {
78 throw new RuntimeException("### ERROR ### - Could not load properties to test");