summaryrefslogtreecommitdiffstats
path: root/cps-ri/src
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ri/src')
-rw-r--r--cps-ri/src/test/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceTest.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceTest.java b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceTest.java
index 4501e5f0c..5c402917d 100644
--- a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceTest.java
+++ b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceTest.java
@@ -23,7 +23,6 @@ import static junit.framework.TestCase.assertEquals;
import com.google.common.collect.ImmutableSet;
import java.util.Arrays;
-import java.util.Collections;
import org.assertj.core.api.Assertions;
import org.junit.ClassRule;
import org.junit.Test;
@@ -35,6 +34,7 @@ import org.onap.cps.spi.exceptions.AnchorNotFoundException;
import org.onap.cps.spi.exceptions.DataNodeNotFoundException;
import org.onap.cps.spi.exceptions.DataspaceNotFoundException;
import org.onap.cps.spi.model.DataNode;
+import org.onap.cps.spi.model.DataNodeBuilder;
import org.onap.cps.spi.repository.FragmentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -42,7 +42,6 @@ import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.junit4.SpringRunner;
-
@RunWith(SpringRunner.class)
@SpringBootTest
public class CpsDataPersistenceServiceTest {
@@ -67,7 +66,6 @@ public class CpsDataPersistenceServiceTest {
private static final long GRAND_CHILD_ID_4006 = 4006;
private static final String GRAND_CHILD_XPATH1 = "/parent-1/child-1/grandchild-1";
-
@ClassRule
public static DatabaseTestContainer databaseTestContainer = DatabaseTestContainer.getInstance();
@@ -91,14 +89,16 @@ public class CpsDataPersistenceServiceTest {
@Sql({CLEAR_DATA, SET_DATA})
public void testStoreDataNodeAtNonExistingDataspace() {
cpsDataPersistenceService
- .storeDataNode("Non Existing Dataspace Name", ANCHOR_NAME1, new DataNode());
+ .storeDataNode("Non Existing Dataspace Name", ANCHOR_NAME1,
+ new DataNodeBuilder().build());
}
@Test(expected = AnchorNotFoundException.class)
@Sql({CLEAR_DATA, SET_DATA})
public void testStoreDataNodeAtNonExistingAnchor() {
cpsDataPersistenceService
- .storeDataNode(DATASPACE_NAME, "Non Existing Anchor Name", new DataNode());
+ .storeDataNode(DATASPACE_NAME, "Non Existing Anchor Name",
+ new DataNodeBuilder().build());
}
@Test(expected = DataIntegrityViolationException.class)
@@ -188,12 +188,13 @@ public class CpsDataPersistenceServiceTest {
}
private static DataNode createDataNodeTree(final String... xpaths) {
- final DataNode dataNode = DataNode.builder().xpath(xpaths[0]).childDataNodes(Collections.emptySet()).build();
+ final DataNodeBuilder dataNodeBuilder = new DataNodeBuilder().withXpath(xpaths[0]);
if (xpaths.length > 1) {
final String[] xPathsDescendant = Arrays.copyOfRange(xpaths, 1, xpaths.length);
final DataNode childDataNode = createDataNodeTree(xPathsDescendant);
- dataNode.setChildDataNodes(ImmutableSet.of(childDataNode));
+ dataNodeBuilder.withChildDataNodes(ImmutableSet.of(childDataNode));
+
}
- return dataNode;
+ return dataNodeBuilder.build();
}
}
} /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash

if [ ! "$#" -eq 1 ]
then
  echo "Usage: ./remove_dns.sh [remote DNS server]"
  exit
fi

DNS_IPADDR=$1
IP_TO_PKTGEN_NET=$(cat /opt/config/ip_to_pktgen_net.txt)
IP_TO_DNS_NET=$(cat /opt/config/ip_to_dns_net.txt)

vppctl lb as $IP_TO_PKTGEN_NET"/32" $DNS_IPADDR del
vppctl create gre tunnel src $IP_TO_DNS_NET dst $DNS_IPADDR del

# Update the number of vDNSs currently active
FD="/opt/VES/evel/evel-library/code/VESreporting/active_dns.txt"
CURR_DNS=$(cat $FD)
let CURR_DNS=$CURR_DNS-1
if [[ $CURR_DNS -lt 0 ]]
then
  CURR_DNS=0
fi
echo $CURR_DNS > $FD