diff options
-rw-r--r-- | ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/gen/SequenceFormatterTest.java | 43 |
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()); + } } |