============LICENSE_START=======================================================
ONAP Policy Engine - Drools PDP
================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ Copyright (C) 2017-2018 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.
<version>1.2.0-SNAPSHOT</version>
</parent>
- <build>
- <plugins>
-
- <!--
- 'maven-invoker-plugin' is used to build and install two versions of a
- Drools artifact, both of which are used in Junit tests. These Maven
- projects are invisible to Sonar and SonarQube, so there are no
- complaints about multiple projects with the same artifact, and they
- don't show up in the list of files or code line counts.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>3.0.1</version>
- <executions>
-
- <execution>
- <id>drools-artifact-1.1</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>test-compile</phase>
- <configuration>
- <pom>drools-artifact-1.1/pom.xml</pom>
- <goals>
- <goal>install</goal>
- </goals>
- <streamLogs>true</streamLogs>
- </configuration>
- </execution>
-
- <execution>
- <id>drools-artifact-1.2</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>test-compile</phase>
- <configuration>
- <pom>drools-artifact-1.2/pom.xml</pom>
- <goals>
- <goal>install</goal>
- </goals>
- <streamLogs>true</streamLogs>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
- </plugins>
- </build>
-
<dependencies>
<dependency>
<groupId>org.kie</groupId>
* ============LICENSE_START=======================================================
* policy-core
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
+import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
-
+import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.policy.drools.util.KieUtils;
/**
* These tests focus on the following classes:
*/
public class DroolsContainerTest
{
+ /**
+ * This test is centered around the creation of a 'PolicyContainer'
+ * and 'PolicySession', and the updating of that container to a new
+ * version.
+ */
+ @BeforeClass
+ public static void setUp() throws Exception
+ {
+ KieUtils.installArtifact
+ (Paths.get("src/test/resources/drools-artifact-1.1/src/main/resources/META-INF/kmodule.xml").toFile(),
+ Paths.get("src/test/resources/drools-artifact-1.1/pom.xml").toFile(),
+ "src/main/resources/rules/org/onap/policy/drools/core/test/rules.drl",
+ Paths.get("src/test/resources/drools-artifact-1.1/src/main/resources/rules.drl").toFile());
+
+ KieUtils.installArtifact
+ (Paths.get("src/test/resources/drools-artifact-1.2/src/main/resources/META-INF/kmodule.xml").toFile(),
+ Paths.get("src/test/resources/drools-artifact-1.2/pom.xml").toFile(),
+ "src/main/resources/rules/org/onap/policy/drools/core/test/rules.drl",
+ Paths.get("src/test/resources/drools-artifact-1.2/src/main/resources/rules.drl").toFile());
+ }
+
/**
* This test is centered around the creation of a 'PolicyContainer'
* and 'PolicySession', and the updating of that container to a new