aboutsummaryrefslogtreecommitdiffstats
path: root/ms/neng/src/test/java
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-09-12 17:17:57 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-12 17:17:57 +0000
commitd56e37e648b9cbb56a5a3411137011d45e1f3687 (patch)
treec3bdcbcef73af89142d055ee00ed70a71338266f /ms/neng/src/test/java
parentf7920b2182cfe33117e7c332d9f7159af98b5b12 (diff)
parentad050dd208c39b76de12f7654f11ee95ff9bc54b (diff)
Merge "added test cases to SequenceFormatter.java"
Diffstat (limited to 'ms/neng/src/test/java')
-rw-r--r--ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java43
1 files changed, 41 insertions, 2 deletions
diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java
index df28ccce..5a161319 100644
--- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java
+++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
@@ -22,13 +24,22 @@ package org.onap.ccsdk.apps.ms.neng.core.gen;
import static org.junit.Assert.assertEquals;
+import org.junit.Before;
import org.junit.Test;
import org.onap.ccsdk.apps.ms.neng.core.policy.PolicySequence;
public class SequenceFormatterTest {
+
+ private PolicySequence poly;
+
+ @Before
+ public void setUp()
+ {
+ poly = new PolicySequence();
+ }
+
@Test
public void formatSequence() throws Exception {
- PolicySequence poly = new PolicySequence();
poly.setLength(3);;
assertEquals("001", SequenceFormatter.formatSequence(1, poly));
poly.setLength(2);;
@@ -39,7 +50,6 @@ public class SequenceFormatterTest {
@Test
public void formatSequenceAlpha() throws Exception {
- PolicySequence poly = new PolicySequence();
poly.setLength(3);;
poly.setType(PolicySequence.Type.ALPHA);
assertEquals("001", SequenceFormatter.formatSequence(1, poly));
@@ -48,4 +58,33 @@ public class SequenceFormatterTest {
poly.setLength(4);;
assertEquals("000b", SequenceFormatter.formatSequence(11, poly));
}
+
+ @Test
+ public void testGetSetIncrement()
+ {
+ poly.setIncrement(1L);
+ assertEquals(1L, poly.getIncrement());
+ }
+
+ @Test
+ public void testGetSetMaxValue()
+ {
+ poly.setMaxValue(1L);
+ assertEquals(1L, poly.getMaxValue());
+ }
+
+ @Test
+ public void testGetSetKey()
+ {
+ poly.setKey("testKey");
+ assertEquals("testKey", poly.getKey());
+ }
+
+ @Test
+ public void testGetSetLastReleaseSeqNumTried()
+ {
+ poly.setLastReleaseSeqNumTried(1L);
+ Long expected=1L;
+ assertEquals(expected, poly.getLastReleaseSeqNumTried());
+ }
}