X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ONAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Fjpa%2FActionDictionaryJPATest.java;fp=ONAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Fjpa%2FActionDictionaryJPAClasses.java;h=61f44bdbfcf770c0e2502f7cb67229afc3d38ff7;hb=9450c8d0102b9188933b5d26193df754a70a7157;hp=af705967c268b3ed82d31c228a86e61e6297a769;hpb=79343205a720ef656837275f973de93f1d26b3e9;p=policy%2Fengine.git diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPAClasses.java b/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java similarity index 83% rename from ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPAClasses.java rename to ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java index af705967c..61f44bdbf 100644 --- a/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPAClasses.java +++ b/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java @@ -30,9 +30,9 @@ import org.junit.Test; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; -public class ActionDictionaryJPAClasses { +public class ActionDictionaryJPATest { - private static Logger logger = FlexLogger.getLogger(ActionDictionaryJPAClasses.class); + private static Logger logger = FlexLogger.getLogger(ActionDictionaryJPATest.class); private UserInfo userInfo; @Before @@ -246,4 +246,48 @@ public class ActionDictionaryJPAClasses { data.setExpression("Test"); assertTrue("Test".equals(data.getExpression())); } + + @Test + public void testDatatype(){ + Datatype data = new Datatype(); + new Datatype(null); + new Datatype(1, new Datatype()); + data.setArguments(new HashSet<>()); + assertTrue(data.getArguments()!=null); + data.setAttributes(new HashSet<>()); + assertTrue(data.getAttributes()!=null); + data.setFunctions(new HashSet<>()); + assertTrue(data.getFunctions()!=null); + data.setId(1); + assertTrue(1 == data.getId()); + data.setShortName("Test"); + assertTrue("Test".equals(data.getShortName())); + data.setXacmlId("Test"); + assertTrue("Test".equals(data.getXacmlId())); + data.addArgument(new FunctionArgument()); + data.addAttribute(new Attribute()); + data.addFunction(new FunctionDefinition()); + data.removeArgument(new FunctionArgument()); + data.removeAttribute(new Attribute()); + data.removeAttribute(new FunctionDefinition()); + assertTrue(data.getIdentifer()!=null); + assertTrue(data.getIdentiferByShortName()!=null); + data.setIsStandard(Datatype.STANDARD); + assertTrue(data.isStandard()); + data.setIsStandard(Datatype.CUSTOM); + assertTrue(data.isCustom()); + } + + @Test + public void testPolicyAlgorithms(){ + PolicyAlgorithms data = new PolicyAlgorithms(); + data.setId(1); + assertTrue(1 == data.getId()); + data.setShortName("Test"); + assertTrue("Test".equals(data.getShortName())); + data.setXacmlId("Test"); + assertTrue("Test".equals(data.getXacmlId())); + data.setIsStandard(PolicyAlgorithms.STANDARD); + assertTrue(data.isStandard()); + } }