X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Fjpa%2FActionDictionaryJpaTest.java;fp=ONAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Frest%2Fjpa%2FActionDictionaryJPATest.java;h=b2c3a77c1155895d0500a038eb122b6b0ce205c7;hp=580b3e35d32ba7634a30940ebfeb94a257da998b;hb=f4ec47c009cdc385a7efed02dda5d26f2ec31b57;hpb=927a79e5b7f9cacd2798504ac158f0a75dc64da8 diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java b/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJpaTest.java similarity index 84% rename from ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java rename to ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJpaTest.java index 580b3e35d..b2c3a77c1 100644 --- a/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJPATest.java +++ b/ONAP-REST/src/test/java/org/onap/policy/rest/jpa/ActionDictionaryJpaTest.java @@ -3,6 +3,7 @@ * ONAP-REST * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +18,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.policy.rest.jpa; import static org.junit.Assert.assertTrue; @@ -30,11 +32,16 @@ import org.junit.Test; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; -public class ActionDictionaryJPATest { +public class ActionDictionaryJpaTest { - private static Logger logger = FlexLogger.getLogger(ActionDictionaryJPATest.class); + private static Logger logger = FlexLogger.getLogger(ActionDictionaryJpaTest.class); private UserInfo userInfo; + /** + * Set up the test. + * + * @throws Exception on test errors + */ @Before public void setUp() throws Exception { logger.info("setUp: Entering"); @@ -45,7 +52,7 @@ public class ActionDictionaryJPATest { } @Test - public void testActionDictionary(){ + public void testActionDictionary() { ActionPolicyDict data = new ActionPolicyDict(); data.setId(1); assertTrue(1 == data.getId()); @@ -66,24 +73,24 @@ public class ActionDictionaryJPATest { data.prePersist(); data.preUpdate(); data.setCreatedDate(new Date()); - assertTrue(data.getCreatedDate()!=null); + assertTrue(data.getCreatedDate() != null); data.setModifiedDate(new Date()); - assertTrue(data.getModifiedDate()!=null); + assertTrue(data.getModifiedDate() != null); data.setUserCreatedBy(userInfo); - assertTrue(data.getUserCreatedBy()!=null); + assertTrue(data.getUserCreatedBy() != null); data.setUserModifiedBy(userInfo); - assertTrue(data.getUserModifiedBy()!=null); + assertTrue(data.getUserModifiedBy() != null); } @Test - public void testFunctionArgument(){ + public void testFunctionArgument() { FunctionArgument data = new FunctionArgument(); data.setArgIndex(1); assertTrue(1 == data.getArgIndex()); data.setDatatypeBean(new Datatype()); - assertTrue(data.getDatatypeBean()!=null); + assertTrue(data.getDatatypeBean() != null); data.setFunctionDefinition(new FunctionDefinition()); - assertTrue(data.getFunctionDefinition()!=null); + assertTrue(data.getFunctionDefinition() != null); data.setId(1); assertTrue(1 == data.getId()); data.isBag(); @@ -94,16 +101,16 @@ public class ActionDictionaryJPATest { } @Test - public void testFunctionDefinition(){ + public void testFunctionDefinition() { FunctionDefinition data = new FunctionDefinition(); data.setArgLb(1); assertTrue(1 == data.getArgLb()); data.setArgUb(1); assertTrue(1 == data.getArgUb()); data.setDatatypeBean(new Datatype()); - assertTrue(data.getDatatypeBean()!=null); + assertTrue(data.getDatatypeBean() != null); data.setFunctionArguments(new ArrayList<>()); - assertTrue(data.getFunctionArguments()!=null); + assertTrue(data.getFunctionArguments() != null); data.setHigherOrderArg_LB(1); assertTrue(1 == data.getHigherOrderArg_LB()); data.setHigherOrderArg_UB(1); @@ -126,7 +133,7 @@ public class ActionDictionaryJPATest { } @Test - public void testCategory(){ + public void testCategory() { Category data = new Category(); new Category(null); data.setAttributes(new HashSet<>()); @@ -137,7 +144,7 @@ public class ActionDictionaryJPATest { Category.extractGrouping("urn:oasis:names:tc:xacml:1.0:subject-category:intermediary-subject"); data.getIdentifer(); data.toString(); - assertTrue(data.getAttributes()!=null); + assertTrue(data.getAttributes() != null); data.setGrouping("Test"); assertTrue("Test".equals(data.getGrouping())); data.setId(1); @@ -149,12 +156,12 @@ public class ActionDictionaryJPATest { } @Test - public void testConstraintType(){ + public void testConstraintType() { ConstraintType data = new ConstraintType(); new ConstraintType("Test", "Test"); ConstraintType.getRangeTypes(); data.setAttributes(new HashSet<>()); - assertTrue(data.getAttributes()!=null); + assertTrue(data.getAttributes() != null); data.setConstraintType("Test"); assertTrue("Test".equals(data.getConstraintType())); data.setDescription("Test"); @@ -164,13 +171,13 @@ public class ActionDictionaryJPATest { } @Test - public void testConstraintValue(){ + public void testConstraintValue() { ConstraintValue data = new ConstraintValue(); data.clone(); new ConstraintValue(new ConstraintValue()); - new ConstraintValue("Test","Test"); + new ConstraintValue("Test", "Test"); data.setAttribute(new Attribute()); - assertTrue(data.getAttribute()!=null); + assertTrue(data.getAttribute() != null); data.setId(1); assertTrue(1 == data.getId()); data.setProperty("Test"); @@ -180,7 +187,7 @@ public class ActionDictionaryJPATest { } @Test - public void testObadvice(){ + public void testObadvice() { Obadvice data = new Obadvice(); new Obadvice(); new Obadvice("Test", "Test"); @@ -201,7 +208,7 @@ public class ActionDictionaryJPATest { data.setModifiedBy("Test"); assertTrue("Test".equals(data.getModifiedBy())); data.setObadviceExpressions(new HashSet<>()); - assertTrue(data.getObadviceExpressions()!=null); + assertTrue(data.getObadviceExpressions() != null); data.setType("Test"); assertTrue("Test".equals(data.getType())); data.setXacmlId("Test"); @@ -209,21 +216,21 @@ public class ActionDictionaryJPATest { } @Test - public void testObadviceExpression(){ + public void testObadviceExpression() { ObadviceExpression data = new ObadviceExpression(); data.clone(); data.setAttribute(new Attribute()); - assertTrue(data.getAttribute()!=null); + assertTrue(data.getAttribute() != null); data.setId(1); assertTrue(1 == data.getId()); data.setObadvice(new Obadvice()); - assertTrue(data.getObadvice()!=null); + assertTrue(data.getObadvice() != null); data.setType("Test"); assertTrue("Test".equals(data.getType())); } @Test - public void testRuleAlgorithms(){ + public void testRuleAlgorithms() { RuleAlgorithms data = new RuleAlgorithms(); data.isCustom(); data.isStandard(); @@ -237,7 +244,7 @@ public class ActionDictionaryJPATest { } @Test - public void testAttributeAssignment(){ + public void testAttributeAssignment() { AttributeAssignment data = new AttributeAssignment(); data.setId(1); assertTrue(1 == data.getId()); @@ -248,16 +255,16 @@ public class ActionDictionaryJPATest { } @Test - public void testDatatype(){ + public void testDatatype() { Datatype data = new Datatype(); new Datatype(null); new Datatype(1, new Datatype()); data.setArguments(new HashSet<>()); - assertTrue(data.getArguments()!=null); + assertTrue(data.getArguments() != null); data.setAttributes(new HashSet<>()); - assertTrue(data.getAttributes()!=null); + assertTrue(data.getAttributes() != null); data.setFunctions(new HashSet<>()); - assertTrue(data.getFunctions()!=null); + assertTrue(data.getFunctions() != null); data.setId(1); assertTrue(1 == data.getId()); data.setShortName("Test"); @@ -270,8 +277,8 @@ public class ActionDictionaryJPATest { data.removeArgument(new FunctionArgument()); data.removeAttribute(new Attribute()); data.removeAttribute(new FunctionDefinition()); - assertTrue(data.getIdentifer()!=null); - assertTrue(data.getIdentiferByShortName()!=null); + assertTrue(data.getIdentifer() != null); + assertTrue(data.getIdentiferByShortName() != null); data.setIsStandard(Datatype.STANDARD); assertTrue(data.isStandard()); data.setIsStandard(Datatype.CUSTOM); @@ -279,7 +286,7 @@ public class ActionDictionaryJPATest { } @Test - public void testPolicyAlgorithms(){ + public void testPolicyAlgorithms() { PolicyAlgorithms data = new PolicyAlgorithms(); data.setId(1); assertTrue(1 == data.getId());