1 /*******************************************************************************
2 * ============LICENSE_START====================================================
4 * * ===========================================================================
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * * ===========================================================================
7 * * Licensed under the Apache License, Version 2.0 (the "License");
8 * * you may not use this file except in compliance with the License.
9 * * You may obtain a copy of the License at
11 * * http://www.apache.org/licenses/LICENSE-2.0
13 * * Unless required by applicable law or agreed to in writing, software
14 * * distributed under the License is distributed on an "AS IS" BASIS,
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * * See the License for the specific language governing permissions and
17 * * limitations under the License.
18 * * ============LICENSE_END====================================================
21 ******************************************************************************/
23 package org.onap.aaf.cadi.cm.test;
25 import java.io.ByteArrayInputStream;
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.onap.aaf.cadi.cm.CmAgent;
33 public class JU_CmAgent {
35 private static final String resourceDirString = "src/test/resources";
36 private static final String aafDir = resourceDirString + "/aaf";
38 private ByteArrayInputStream inStream;
42 System.setProperty("user.home", aafDir);
44 // Simulate user input
45 inStream = new ByteArrayInputStream("test\nhttp://example.com\nhttp://example.com".getBytes());
46 System.setIn(inStream);
50 public void tearDown() {
51 recursiveDelete(new File(aafDir));
100 args = new String[] {
106 args = new String[] {
113 private void recursiveDelete(File file) {
114 for (File f : file.listFiles()) {
115 if (f.isDirectory()) {