<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>dblib</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>dblib-common</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>dblib</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>dblib-features</artifactId>
<name>DBLIB Adaptor - Features</name>
<parent>
<artifactId>dblib</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>dblib-installer</artifactId>
<name>DBLIB Adaptor - Karaf Installer</name>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sdnc-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<name>DBLIB Adaptor</name>
<description>The DBLIB adaptor allows service logic to access persistent data in a local sql database</description>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<build>
<plugins>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>dblib</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>dblib-provider</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>DBLIB Adaptor - Provider</name>
<url>http://maven.apache.org</url>
<parent>
<artifactId>filters</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>filters-features</artifactId>
<name>Filters - Features</name>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>filters</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>filters-installer</artifactId>
<name>Filters - Karaf Installer</name>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sdnc-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>Filters</name>
<description>Servlet filter to implement ECOMP logging spec</description>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>filters</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>filters-provider</artifactId>
<packaging>bundle</packaging>
<organization>
<name>OpenECOMP</name>
</organization>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</project>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<version>1.7.1-Boron-SR1</version>
- <relativePath>../../../../../opendaylight/odlparent</relativePath>
</parent>
<parent>
<artifactId>sli</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sli-common</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>sli</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sli-features</artifactId>
<name>SLI - Features</name>
<parent>
<artifactId>sli</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sli-installer</artifactId>
<name>SLI - Karaf Installer</name>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sdnc-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<organization>
<name>openECOMP</name>
</organization>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</project>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sli</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sli-provider</artifactId>
<packaging>bundle</packaging>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import junit.framework.Assert;
import junit.framework.TestCase;
public class SvcLogicExpressionResolverTest extends TestCase {
try
{
- String testExpr = null;
SvcLogicContext ctx = new SvcLogicContext();
SvcLogicGraph graph = new SvcLogicGraph();
SvcLogicNode node = new SvcLogicNode(1, "return", graph);
graph.setRootNode(node);
-
- while ((testExpr = testsReader.readLine()) != null) {
- testExpr = testExpr.trim();
- if (testExpr.startsWith("#"))
+
+ String line = null;
+ int lineNo = 0;
+ while ((line = testsReader.readLine()) != null) {
+ ++lineNo;
+ if (line.startsWith("#"))
{
- testExpr = testExpr.substring(1).trim();
+ String testExpr = line.trim().substring(1).trim();
String[] nameValue = testExpr.split("=");
String name = nameValue[0].trim();
String value = nameValue[1].trim();
-
+
if (name.startsWith("$"))
{
LOG.info("Setting context attribute "+name+" = "+value);
}
else
{
+ // if the line contains #, what comes before is the expression to evaluate, and what comes after
+ // is the expected value
+ String[] substrings = line.split("#");
+ String expectedValue = substrings.length > 1 ? substrings[1].trim() : null;
+ String testExpr = substrings[0].trim();
+
LOG.info("Parsing expression "+testExpr);
SvcLogicExpression expr = SvcLogicExpressionFactory.parse(testExpr);
if (expr == null)
}
else
{
- LOG.info("Expression "+testExpr+" evaluates to "+exprValue);
+ LOG.info("Expression " + testExpr + " evaluates to " + exprValue);
+ if (expectedValue != null) {
+ Assert.assertEquals("Line " + lineNo + ": " + testExpr, expectedValue, exprValue);
+ }
}
}
}
# $network.segment[0].provider-segmentation-id = 1212
# $network.segment[1].provider-segmentation-id = 1213
# $availability-zone = mtsnj-esx-az01
-length($uni-circuit-id) > 0
-$uni-cir-units * 1000 * 100 / 100
-$uni-cir-units / 1000
-$uni-cir-units - 100
-$uni-cir-units + 100
-(value * 3 - $arg1 > 0) and (length($uni-circuit-id) == 0)
-'pg-'+$network.name
-$network.segment[0].provider-segmentation-id
-toUpperCase($network.name)
-toLowerCase($network.name)
-toUpperCase(substr($availability-zone, 0, 5))
-convertBase(1234, 10)
-convertBase(10, 16, 10)
-convertBase(ZZ, 36, 10)
-convertBase(10, 10, 36)
-(0 - 1) * $arg1
+length($uni-circuit-id) > 0 # true
+$uni-cir-units * 1000 * 100 / 100 # 10000
+$uni-cir-units / 1000 # 0
+$uni-cir-units - 100 # -90
+$uni-cir-units + 100 # 110
+(value * 3 - $arg1 > 0) and (length($uni-circuit-id) == 0) # true
+'pg-'+$network.name # pg-vCE0001.in
+$network.segment[0].provider-segmentation-id # 1212
+toUpperCase($network.name) # VCE0001.IN
+toLowerCase($network.name) # vce0001.in
+toUpperCase(substr($availability-zone, 0, 5)) # MTSNJ
+convertBase(1234, 10) # 1234
+convertBase(10, 16, 10) # 16
+convertBase(ZZ, 36, 10) # 1295
+convertBase(10, 10, 36) # a
+(0 - 1) * $arg1 # -1
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sli</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sli-recording</artifactId>
<packaging>bundle</packaging>
<parent>
<artifactId>sliPluginUtils</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<name>SliPluginUtils Plugin - Features</name>
<parent>
<artifactId>sliPluginUtils</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sliPluginUtils-installer</artifactId>
<name>SLI Plugin Utilities - Karaf Installer</name>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sliPluginUtils</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sdnc-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<name>Service Logic Interface Plugin Utilities</name>
<description>A package of static utility functions to be used when developing SLI plugins</description>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sliPluginUtils</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<name>SliPluginUtils Plugin - Provider</name>
<parent>
<artifactId>sliapi</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sliapi-features</artifactId>
<parent>
<artifactId>sliapi</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sliapi-installer</artifactId>
<packaging>pom</packaging>
<parent>
<artifactId>sliapi</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sliapi-model</artifactId>
<packaging>bundle</packaging>
<parent>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sdnc-core</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<groupId>org.openecomp.sdnc.core</groupId>
<artifactId>sliapi</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<properties>
<feature-name>sliapi</feature-name>
<parent>
<artifactId>sliapi</artifactId>
<groupId>org.openecomp.sdnc.core</groupId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<artifactId>sliapi-provider</artifactId>
<packaging>bundle</packaging>
release_name=1
sprint_number=1
-feature_revision=0
+feature_revision=1
base_version=${release_name}.${sprint_number}.${feature_revision}