/*-
* ============LICENSE_START=======================================================
* SDC
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
*/
package org.openecomp.sdc.ci.tests.api;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.rules.TestName;
import org.junit.rules.TestWatcher;
import org.openecomp.sdc.ci.tests.config.Config;
import org.openecomp.sdc.ci.tests.rules.MyTestWatcher;
import org.openecomp.sdc.ci.tests.run.StartTest;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public abstract class AttSdcTest {
public static StringBuilder doc = new StringBuilder();
public static String file = null;
public static Config config = null;
// protected Gson gson = new Gson();
protected Gson prettyGson = new GsonBuilder().setPrettyPrinting().create();
protected TestName testName = null;
protected Logger logger = null;
protected static boolean displayException = false;
public AttSdcTest(TestName testName, String className) {
super();
StartTest.enableLogger();
this.testName = testName;
this.logger = LoggerFactory.getLogger(className);
String displayEx = System.getProperty("displayException");
if (displayEx != null && Boolean.valueOf(displayEx).booleanValue()) {
displayException = true;
}
}
@Rule
public TestWatcher tw = new MyTestWatcher(this);
@BeforeClass
public static void beforeClass() {
doc = new StringBuilder();
doc.append(
"