2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 * ============LICENSE_END=========================================================
25 package org.onap.appc.client.lcm.impl.business;
28 import org.junit.Assert;
29 import org.junit.Ignore;
30 import org.junit.Test;
31 import org.onap.appc.client.lcm.api.ApplicationContext;
32 import org.onap.appc.client.lcm.api.LifeCycleManagerStateful;
33 import org.onap.appc.client.lcm.exceptions.AppcClientException;
34 import org.onap.appc.client.lcm.impl.business.LCMRequestProcessor;
36 import java.io.FileInputStream;
37 import java.io.FileNotFoundException;
38 import java.io.IOException;
39 import java.io.InputStream;
40 import java.util.Properties;
42 public class TestAppcLifeCycleManagerServiceFactoryImpl {
44 AppcLifeCycleManagerServiceFactoryImpl appcLifeCycleManagerServiceFactory=new AppcLifeCycleManagerServiceFactoryImpl();
47 public void testCreateLifeCycleManagerStateful() throws AppcClientException{
48 LifeCycleManagerStateful lifeCycleManagerStateful;
49 ApplicationContext applicationContext=new ApplicationContext();
50 applicationContext.setApplicationID("AppID");
51 applicationContext.setMechID("mechId");
52 String folder="src/test/resources/data";
53 Properties properties =getProperties(folder);
54 lifeCycleManagerStateful=appcLifeCycleManagerServiceFactory.createLifeCycleManagerStateful(applicationContext,properties);
56 Assert.assertNotNull(lifeCycleManagerStateful);
60 public static Properties getProperties(String folder) {
61 Properties prop = new Properties();
63 InputStream conf = null;
65 conf = new FileInputStream(folder + "client-simulator.properties");
66 } catch (FileNotFoundException e) {
72 } catch (IOException e) {
77 prop.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("client-simulator.properties"));
78 } catch (Exception e) {
79 throw new RuntimeException("### ERROR ### - Could not load properties to test");