2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 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=========================================================
20 package org.openecomp.policy.controlloop.compiler;
22 import static org.junit.Assert.*;
25 import java.io.FileInputStream;
26 import java.io.FileNotFoundException;
27 import java.io.IOException;
28 import java.io.InputStream;
30 import org.junit.Test;
32 public class ControlLoopCompilerTest {
35 public void testTest() {
37 this.test("src/test/resources/v1.0.0/test.yaml");
38 } catch (Exception e) {
44 public void testBad1() {
46 this.test("src/test/resources/v1.0.0/bad_trigger_1.yaml");
47 } catch (Exception e) {
52 public void testBad2() {
54 this.test("src/test/resources/v1.0.0/bad_trigger_2.yaml");
55 } catch (Exception e) {
61 public void testBad() {
63 this.test("src/test/resources/v1.0.0/bad_policies_1.yaml");
64 } catch (Exception e) {
68 public void test(String testFile) throws Exception {
69 try (InputStream is = new FileInputStream(new File(testFile))) {
70 ControlLoopCompiler.compile(is, null);
71 } catch (FileNotFoundException e) {
73 } catch (IOException e) {
75 } catch (Exception e) {