aboutsummaryrefslogtreecommitdiffstats
path: root/ms/neng/src/test/java/org
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-09-12 17:38:39 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-09-12 17:39:26 +0530
commitad050dd208c39b76de12f7654f11ee95ff9bc54b (patch)
treec79b98e2f416200a58fcf28c527578bdf01795f6 /ms/neng/src/test/java/org
parent14494258aa1648da961a065c4379761e505f915e (diff)
added test cases to SequenceFormatter.java
to increase code coverage for PolicySequence.java Issue-ID: CCSDK-552 Change-Id: Ia630d079f1bbdd583e98b7a162f036a0b3a0d1ed Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'ms/neng/src/test/java/org')
-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());
+ }
}