diff options
Diffstat (limited to 'sli/provider')
6 files changed, 82 insertions, 99 deletions
diff --git a/sli/provider/pom.xml b/sli/provider/pom.xml index 4a90ae00..1b21b002 100755 --- a/sli/provider/pom.xml +++ b/sli/provider/pom.xml @@ -1,44 +1,40 @@ <?xml version="1.0"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <parent> + <parent> <groupId>org.onap.ccsdk.parent</groupId> <artifactId>binding-parent</artifactId> <version>1.0.1-SNAPSHOT</version> - <relativePath/> + <relativePath /> </parent> - <groupId>org.onap.ccsdk.sli.core</groupId> - <artifactId>sli-provider</artifactId> - <version>0.2.1-SNAPSHOT</version> - <packaging>bundle</packaging> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-provider</artifactId> + <version>0.2.1-SNAPSHOT</version> + <packaging>bundle</packaging> - <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name> - <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description> + <name>ccsdk-sli-core :: sli :: ${project.artifactId}</name> + <description>SLI Provider is the OSGi bundle that exposes the service logic interpreter as a service.</description> - <properties> + <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>mdsal-artifacts</artifactId> - <version>1.6.1</version> - <type>pom</type> - <scope>import</scope> - </dependency> - </dependencies> - </dependencyManagement> - <dependencies> - <dependency> - <groupId>ch.vorburger.mariaDB4j</groupId> - <artifactId>mariaDB4j</artifactId> - <version>2.2.3</version> - <scope>test</scope> - </dependency> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>mdsal-artifacts</artifactId> + <version>1.6.1</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> <groupId>org.onap.ccsdk.sli.core</groupId> <artifactId>sli-model</artifactId> @@ -62,11 +58,6 @@ <version>${slf4j.version}</version> </dependency> <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - <version>${slf4j.version}</version> - </dependency> - <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>${commons.lang.version}</version> @@ -74,23 +65,28 @@ </dependency> - <dependency> - <groupId>org.opendaylight.controller</groupId> - <artifactId>sal-binding-api</artifactId> - </dependency> - - <!-- Testing Dependencies --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>sal-binding-api</artifactId> + </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> + <!-- Testing Dependencies --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <version>10.11.1.1</version> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/sli/provider/src/main/resources/svclogic.properties b/sli/provider/src/main/resources/svclogic.properties deleted file mode 100644 index 49d39ab4..00000000 --- a/sli/provider/src/main/resources/svclogic.properties +++ /dev/null @@ -1,25 +0,0 @@ -### -# ============LICENSE_START======================================================= -# ONAP : CCSDK -# ================================================================================ -# 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========================================================= -### - -org.onap.ccsdk.sli.dbtype = dblib -org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true -org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver -org.onap.ccsdk.sli.jdbc.database = sdnctl diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java index 4c112ab2..0a8bf71a 100644 --- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java +++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/ITCaseSvcLogicGraphExecutor.java @@ -24,8 +24,7 @@ package org.onap.ccsdk.sli.core.sli.provider; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; -import ch.vorburger.mariadb4j.DB; -import ch.vorburger.mariadb4j.DBConfigurationBuilder; + import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; @@ -40,6 +39,7 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.onap.ccsdk.sli.core.dblib.DBResourceManager; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicGraph; import org.onap.ccsdk.sli.core.sli.SvcLogicParser; @@ -74,6 +74,7 @@ public class ITCaseSvcLogicGraphExecutor { put("set", new SetNodeExecutor()); put("switch", new SwitchNodeExecutor()); put("update", new UpdateNodeExecutor()); + put("while", new WhileNodeExecutor()); } }; @@ -88,16 +89,6 @@ public class ITCaseSvcLogicGraphExecutor { Properties svcprops = new Properties(); svcprops.load(propStr); - // Start MariaDB4j database - DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); - config.setPort(0); // 0 => autom. detect free port - DB db = DB.newEmbeddedDB(config.build()); - db.start(); - - // Override jdbc URL and database name - svcprops.setProperty("org.onap.ccsdk.sli.jdbc.database", "test"); - svcprops.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); - SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops); assertNotNull(store); @@ -144,18 +135,9 @@ public class ITCaseSvcLogicGraphExecutor { Properties svcprops = new Properties(); svcprops.load(propStr); - // Start MariaDB4j database - DBConfigurationBuilder config = DBConfigurationBuilder.newBuilder(); - config.setPort(0); // 0 => autom. detect free port - DB db = DB.newEmbeddedDB(config.build()); - db.start(); - - // Override jdbc URL and database name - svcprops.setProperty("org.onap.ccsdk.sli.jdbc.database", "test"); - svcprops.setProperty("org.onap.ccsdk.sli.jdbc.url", config.getURL("test")); - SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops); + assertNotNull(store); @@ -214,10 +196,13 @@ public class ITCaseSvcLogicGraphExecutor { fail("Could not resolve test case file " + testCaseFile); } + LinkedList<SvcLogicGraph> graphs = parser.parse(testCaseUrl.getPath()); assertNotNull(graphs); + // Load grqphs into db to support call node + parser.load(testCaseUrl.getPath(), store); for (SvcLogicGraph graph : graphs) { if (graph.getRpc().equals(testCaseMethod)) { Properties props = ctx.toProperties(); diff --git a/sli/provider/src/test/resources/executor.tests b/sli/provider/src/test/resources/executor.tests index e4e60208..5468c8d6 100755 --- a/sli/provider/src/test/resources/executor.tests +++ b/sli/provider/src/test/resources/executor.tests @@ -1,6 +1,8 @@ l3sdn_logic_v10.xml:switchTester:test-value="" l3sdn_logic_v10.xml:switchTester:test-value="hi" l3sdn_logic_v10.xml:forRecordTester +l3sdn_logic_v10.xml:whileNodeTester l3sdn_logic_v10.xml:resourceTester l3sdn_logic_v10.xml:configureTester -l3sdn_logic_v10.xml:javaPluginTester
\ No newline at end of file +l3sdn_logic_v10.xml:javaPluginTester +l3sdn_logic_v10.xml:allNodesTester
\ No newline at end of file diff --git a/sli/provider/src/test/resources/l3sdn_logic_v10.xml b/sli/provider/src/test/resources/l3sdn_logic_v10.xml index 1386df10..cbb5db1b 100644 --- a/sli/provider/src/test/resources/l3sdn_logic_v10.xml +++ b/sli/provider/src/test/resources/l3sdn_logic_v10.xml @@ -49,6 +49,27 @@ </for> </method> + <method rpc="whileNodeTester" mode="sync"> + <block> + <set> + <parameter name="counter" value="0" /> + + </set> + <while test="`$counter < 10`"> + <set> + <parameter name="counter" value="`$counter + 1`" /> + </set> + + <switch test="`$counter > 6`"> + <outcome value="true"> + <break /> + </outcome> + </switch> + </while> + </block> + + </method> + <method rpc="resourceTester" mode="sync"> <block> <set> @@ -167,6 +188,8 @@ <call rpc="javaPluginTester" mode="sync"/> + <call rpc="whileNodeTester" mode="sync"/> + </block> </method> diff --git a/sli/provider/src/test/resources/svclogic.properties b/sli/provider/src/test/resources/svclogic.properties index 49d39ab4..426960f7 100644 --- a/sli/provider/src/test/resources/svclogic.properties +++ b/sli/provider/src/test/resources/svclogic.properties @@ -19,7 +19,9 @@ # ============LICENSE_END========================================================= ### -org.onap.ccsdk.sli.dbtype = dblib +org.onap.ccsdk.sli.dbtype = jdbc org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver org.onap.ccsdk.sli.jdbc.database = sdnctl +org.onap.ccsdk.sli.jdbc.user = test +org.onap.ccsdk.sli.jdbc.password = test |