summaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/test/java/org
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-05-03 21:31:58 +0000
committerGerrit Code Review <gerrit@onap.org>2017-05-03 21:31:58 +0000
commita330af579866dacbe595e2e4ad1dd29cd3c96945 (patch)
treeb9455591600034dfd4f33a9c1f733336280f2208 /ECOMP-PAP-REST/src/test/java/org
parent5444e748b8651d8346dcb78c5ab8b0637dea197b (diff)
parente0addf5b588a1244f9679becd90999dfcb4c3a94 (diff)
Merge "Policy 1707 commit to LF"
Diffstat (limited to 'ECOMP-PAP-REST/src/test/java/org')
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java74
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServletTest.java21
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java44
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java27
4 files changed, 46 insertions, 120 deletions
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
index c5fa37925..6ab3d3588 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
@@ -20,7 +20,8 @@
package org.openecomp.policy.pap.ia;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.Date;
import java.util.HashMap;
@@ -32,79 +33,13 @@ import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
+import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-import org.openecomp.policy.jpa.BackUpMonitorEntity;
-import org.openecomp.policy.rest.jpa.ActionBodyEntity;
-import org.openecomp.policy.rest.jpa.ActionList;
-import org.openecomp.policy.rest.jpa.ActionPolicyDict;
-import org.openecomp.policy.rest.jpa.AddressGroup;
-import org.openecomp.policy.rest.jpa.Attribute;
-import org.openecomp.policy.rest.jpa.AttributeAssignment;
-import org.openecomp.policy.rest.jpa.BRMSParamTemplate;
-import org.openecomp.policy.rest.jpa.Category;
-import org.openecomp.policy.rest.jpa.ClosedLoopD2Services;
-import org.openecomp.policy.rest.jpa.ClosedLoopSite;
-import org.openecomp.policy.rest.jpa.ConfigurationDataEntity;
-import org.openecomp.policy.rest.jpa.ConstraintType;
-import org.openecomp.policy.rest.jpa.ConstraintValue;
-import org.openecomp.policy.rest.jpa.DCAEUsers;
-import org.openecomp.policy.rest.jpa.DCAEuuid;
-import org.openecomp.policy.rest.jpa.DatabaseLockEntity;
-import org.openecomp.policy.rest.jpa.Datatype;
-import org.openecomp.policy.rest.jpa.DecisionSettings;
-import org.openecomp.policy.rest.jpa.DescriptiveScope;
-import org.openecomp.policy.rest.jpa.EcompName;
-import org.openecomp.policy.rest.jpa.EnforcingType;
-import org.openecomp.policy.rest.jpa.FunctionArgument;
-import org.openecomp.policy.rest.jpa.FunctionDefinition;
-import org.openecomp.policy.rest.jpa.GlobalRoleSettings;
-import org.openecomp.policy.rest.jpa.GroupEntity;
-import org.openecomp.policy.rest.jpa.GroupPolicyScopeList;
-import org.openecomp.policy.rest.jpa.GroupServiceList;
-import org.openecomp.policy.rest.jpa.MicroServiceConfigName;
-import org.openecomp.policy.rest.jpa.MicroServiceLocation;
-import org.openecomp.policy.rest.jpa.MicroServiceModels;
-import org.openecomp.policy.rest.jpa.Obadvice;
-import org.openecomp.policy.rest.jpa.ObadviceExpression;
-import org.openecomp.policy.rest.jpa.PEPOptions;
-import org.openecomp.policy.rest.jpa.PIPConfigParam;
-import org.openecomp.policy.rest.jpa.PIPConfiguration;
-import org.openecomp.policy.rest.jpa.PIPResolver;
-import org.openecomp.policy.rest.jpa.PIPResolverParam;
-import org.openecomp.policy.rest.jpa.PIPType;
-import org.openecomp.policy.rest.jpa.PREFIXLIST;
-import org.openecomp.policy.rest.jpa.PdpEntity;
-import org.openecomp.policy.rest.jpa.PolicyAlgorithms;
-import org.openecomp.policy.rest.jpa.PolicyDBDaoEntity;
-import org.openecomp.policy.rest.jpa.PolicyEntity;
-import org.openecomp.policy.rest.jpa.PolicyManagement;
-import org.openecomp.policy.rest.jpa.PolicyRoles;
-import org.openecomp.policy.rest.jpa.PolicyScopeClosedLoop;
-import org.openecomp.policy.rest.jpa.PolicyScopeResource;
-import org.openecomp.policy.rest.jpa.PolicyScopeService;
-import org.openecomp.policy.rest.jpa.PolicyScopeType;
-import org.openecomp.policy.rest.jpa.PolicyScore;
-import org.openecomp.policy.rest.jpa.PolicyVersion;
-import org.openecomp.policy.rest.jpa.PortList;
-import org.openecomp.policy.rest.jpa.ProtocolList;
-import org.openecomp.policy.rest.jpa.RemoteCatalogValues;
-import org.openecomp.policy.rest.jpa.RuleAlgorithms;
-import org.openecomp.policy.rest.jpa.SecurityZone;
-import org.openecomp.policy.rest.jpa.ServiceList;
-import org.openecomp.policy.rest.jpa.SystemLogDB;
-import org.openecomp.policy.rest.jpa.TermList;
-import org.openecomp.policy.rest.jpa.UserInfo;
-import org.openecomp.policy.rest.jpa.VMType;
-import org.openecomp.policy.rest.jpa.VNFType;
-import org.openecomp.policy.rest.jpa.VSCLAction;
-import org.openecomp.policy.rest.jpa.VarbindDictionary;
-import org.openecomp.policy.rest.jpa.Zone;
-
import org.openecomp.policy.common.ia.DbAudit;
import org.openecomp.policy.common.ia.DbDAO;
import org.openecomp.policy.common.ia.IntegrityAuditProperties;
@@ -112,8 +47,7 @@ import org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity;
import org.openecomp.policy.common.im.jpa.ForwardProgressEntity;
import org.openecomp.policy.common.im.jpa.ResourceRegistrationEntity;
import org.openecomp.policy.common.im.jpa.StateManagementEntity;
-
-import org.apache.commons.lang3.SerializationUtils;
+import org.openecomp.policy.jpa.BackUpMonitorEntity;
@Ignore
public class DbAuditCompareEntriesTest {
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServletTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServletTest.java
index da11d72ce..b87d99059 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServletTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServletTest.java
@@ -20,7 +20,7 @@
package org.openecomp.policy.pap.xacml.rest;
-import static org.junit.Assert.assertTrue;
+/*import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
@@ -95,7 +95,7 @@ public class XACMLPapServletTest extends TestCase{
Mockito.when(servletConfig.getInitParameter("XACML_PROPERTIES_NAME")).thenReturn("xacml.pap.test.properties");
- System.setProperty("xacml.PAP.papEngineFactory", "org.openecomp.policy.xacml.std.pap.StdEngineFactory");
+ System.setProperty("xacml.PAP.papEngineFactory", "com.att.research.xacml.std.pap.StdEngineFactory");
System.setProperty("xacml.pap.pdps", "pdps");
System.setProperty("xacml.rest.pap.url", "http://localhost:8070/pap/");
System.setProperty("xacml.rest.pap.initiate.pdp", "false");
@@ -117,10 +117,10 @@ public class XACMLPapServletTest extends TestCase{
System.setProperty("node_type", "pap");
}
- /*
+
* This method initializes and cleans the DB so the XACMLPapServlet will be able to instantiate an
* IntegrityAudit object which will use the DB.
- */
+
public void initializeDb(){
logger.debug("initializeDb: enter");
Properties cleanProperties = new Properties();
@@ -171,7 +171,7 @@ public class XACMLPapServletTest extends TestCase{
}
}
-/* public void testDoGetPapTest(){
+ public void testDoGetPapTest(){
try{
Mockito.when(httpServletRequest.getRequestURI()).thenReturn("/pap/test");
papServlet.init(servletConfig);
@@ -186,9 +186,9 @@ public class XACMLPapServletTest extends TestCase{
fail();
}
assertTrue(true);
- }*/
+ }
-/*
+
* Need to figure a way to get it to match any message string
* public void testDoGetPapTestFpcFailure(){
try{
@@ -204,7 +204,7 @@ public class XACMLPapServletTest extends TestCase{
fail();
}
assertTrue(true);
- }*/
+ }
public void testDoGetLocal(){
try{
@@ -268,7 +268,7 @@ public class XACMLPapServletTest extends TestCase{
}
}
//why is this test trying to send no pdp id and expecting a 200 response?
- /*
+
public void testDoPost(){
final ByteArrayOutputStream os = new ByteArrayOutputStream ();
ByteArrayOutputStream multiPartResponse = new ByteArrayOutputStream();
@@ -293,7 +293,7 @@ public class XACMLPapServletTest extends TestCase{
fail();
}
}
- */
+
public void testDoPostPDPId(){
String groupId = "newPDP";
@@ -366,3 +366,4 @@ public class XACMLPapServletTest extends TestCase{
}
}
}
+*/ \ No newline at end of file
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
index 81f33c99b..1009e03bc 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDaoTest.java
@@ -36,41 +36,34 @@ import javax.persistence.Persistence;
import javax.persistence.PersistenceException;
import javax.persistence.Query;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.junit.After;
+import org.junit.Assert;
+//import org.apache.commons.logging.Log;
+//import org.apache.commons.logging.LogFactory;
+import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
-import org.openecomp.policy.pap.xacml.rest.adapters.PolicyRestAdapter;
-import org.openecomp.policy.pap.xacml.rest.components.ConfigPolicy;
-import org.openecomp.policy.pap.xacml.rest.components.Policy;
-import org.openecomp.policy.pap.xacml.rest.components.PolicyDBDao;
-import org.openecomp.policy.pap.xacml.rest.components.PolicyDBDaoTransaction;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
import org.openecomp.policy.pap.xacml.rest.components.PolicyDBDao.PolicyDBDaoTestClass;
import org.openecomp.policy.rest.XACMLRestProperties;
+import org.openecomp.policy.rest.adapter.PolicyRestAdapter;
import org.openecomp.policy.rest.jpa.ActionBodyEntity;
import org.openecomp.policy.rest.jpa.GroupEntity;
import org.openecomp.policy.rest.jpa.PdpEntity;
import org.openecomp.policy.rest.jpa.PolicyEntity;
import org.openecomp.policy.rest.util.Webapps;
-
-import com.att.research.xacml.api.pap.PAPException;
-
import org.openecomp.policy.xacml.api.pap.EcompPDPGroup;
import org.openecomp.policy.xacml.std.pap.StdPDPGroup;
import org.openecomp.policy.xacml.util.XACMLPolicyWriter;
-import com.att.research.xacml.util.XACMLProperties;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-//import org.apache.commons.logging.Log;
-//import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Ignore;
+import com.att.research.xacml.api.pap.PAPException;
+import com.att.research.xacml.util.XACMLProperties;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
-import org.junit.Assert;
-import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
-import org.openecomp.policy.common.logging.flexlogger.Logger;
-
@Ignore //only run locally as timing sometimes causes failures on Jenkins
public class PolicyDBDaoTest {
@@ -180,14 +173,14 @@ public class PolicyDBDaoTest {
// Assert.fail();
// }
String filePath = null;
- String xmlFile = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Policy xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" PolicyId=\"urn:com:xacml:policy:id:eaa4bb64-59cf-4517-bb44-b2eeabd50b11\" Version=\"1\" RuleCombiningAlgId=\"urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides\">\n <Description></Description>\n <Target>\n <AnyOf>\n <AllOf>\n <Match MatchId=\"org.openecomp.function.regex-match\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">99</AttributeValue>\n <AttributeDesignator Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\" AttributeId=\"cpu\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\" MustBePresent=\"false\"/>\n </Match>\n </AllOf>\n </AnyOf>\n </Target>\n <Rule RuleId=\"urn:com:xacml:rule:id:3350bf37-43d0-4a94-a317-febec81150d8\" Effect=\"Permit\">\n <Target/>\n <ObligationExpressions>\n <ObligationExpression ObligationId=\"test\" FulfillOn=\"Permit\">\n <AttributeAssignmentExpression AttributeId=\"performer\" Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">PDPAction</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"type\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">REST</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"url\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://localhost:8056/pcd</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"method\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">GET</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"body\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">$URLaction/com.Action_patbaction7.json</AttributeValue>\n </AttributeAssignmentExpression>\n </ObligationExpression>\n </ObligationExpressions>\n </Rule>\n</Policy>\n";
+ String xmlFile = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Policy xmlns=\"urn:oasis:names:tc:xacml:3.0:core:schema:wd-17\" PolicyId=\"urn:com:xacml:policy:id:eaa4bb64-59cf-4517-bb44-b2eeabd50b11\" Version=\"1\" RuleCombiningAlgId=\"urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:permit-overrides\">\n <Description></Description>\n <Target>\n <AnyOf>\n <AllOf>\n <Match MatchId=\"org.openecomp.labs.ecomp.function.regex-match\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#integer\">99</AttributeValue>\n <AttributeDesignator Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\" AttributeId=\"cpu\" DataType=\"http://www.w3.org/2001/XMLSchema#integer\" MustBePresent=\"false\"/>\n </Match>\n </AllOf>\n </AnyOf>\n </Target>\n <Rule RuleId=\"urn:com:xacml:rule:id:3350bf37-43d0-4a94-a317-febec81150d8\" Effect=\"Permit\">\n <Target/>\n <ObligationExpressions>\n <ObligationExpression ObligationId=\"test\" FulfillOn=\"Permit\">\n <AttributeAssignmentExpression AttributeId=\"performer\" Category=\"urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">PDPAction</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"type\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">REST</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"url\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">http://localhost:8056/pcd</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"method\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\">GET</AttributeValue>\n </AttributeAssignmentExpression>\n <AttributeAssignmentExpression AttributeId=\"body\" Category=\"urn:oasis:names:tc:xacml:3.0:attribute-category:resource\">\n <AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#anyURI\">$URLaction/com.Action_patbaction7.json</AttributeValue>\n </AttributeAssignmentExpression>\n </ObligationExpression>\n </ObligationExpressions>\n </Rule>\n</Policy>\n";
String jsonFile = "{\"actionAttribute\":\"Memory\"}";
try{
//policy file
InputStream in = new ByteArrayInputStream(xmlFile.getBytes());
String workspaceDir = "src/test/resources/junitTestCreatedDirectory/"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WORKSPACE)+"/admin/"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_REPOSITORY);
- FileUtils.forceMkdir(new File(workspaceDir+"/org/openecomp"));
+ FileUtils.forceMkdir(new File(workspaceDir+"/com/att"));
File outFile = new File(workspaceDir+"/org/openecomp/Action_mypol.xml");
OutputStream out = new FileOutputStream(outFile);
IOUtils.copy(in, out);
@@ -283,7 +276,7 @@ public class PolicyDBDaoTest {
}
willFail.close();
- fakeFile = new File("directorythatdoesnotexist/"+workspaceDir+"org/openecomp/Action_mypol2.xml");
+ fakeFile = new File("directorythatdoesnotexist/"+workspaceDir+"com/att/Action_mypol2.xml");
willFail = dbd.getNewTransaction();
try{
willFail.createPolicy(fakeFile.getAbsolutePath(), "user1");
@@ -319,7 +312,7 @@ public class PolicyDBDaoTest {
@Test
public void createFromPolicyObject(){
String workspaceDir = "src/test/resources/junitTestCreatedDirectory/"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WORKSPACE)+"/admin/"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_REPOSITORY);
- File parentPath = new File(workspaceDir+"/org/openecomp");
+ File parentPath = new File(workspaceDir+"/com/att");
File scope = new File(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_WORKSPACE)+"/admin/"+XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_REPOSITORY));
Policy policyObject = new ConfigPolicy();
policyObject.policyAdapter = new PolicyRestAdapter();
@@ -635,7 +628,6 @@ public class PolicyDBDaoTest {
System.out.println("Decrypted password: "+decr);
Assert.assertEquals("testpassword", decr);
} catch (Exception e) {
- // TODO Auto-generated catch block
e.printStackTrace();
Assert.fail();
}
@@ -670,7 +662,6 @@ public class PolicyDBDaoTest {
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
if(logger.isDebugEnabled()){
@@ -712,7 +703,6 @@ public class PolicyDBDaoTest {
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
if(logger.isDebugEnabled()){
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
index f71026c39..046164013 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/jpa/PolicyEntityTest.java
@@ -48,7 +48,6 @@ public class PolicyEntityTest {
private static Logger logger = FlexLogger.getLogger(PolicyEntityTest.class);
-// @Ignore
@Test
public void testAllOps(){
Properties properties = new Properties();
@@ -125,18 +124,18 @@ public class PolicyEntityTest {
//We will NOT set the ConfigurationDataEntity or ActionBodyEntity object just to test that it is optional
//set createdBy
- p1.setCreatedBy("super-admin");
+ p1.setCreatedBy("kevin");
//createdDate will be set when it is persisted
//set scope
- p1.setScope("com.test");
+ p1.setScope("mckiou.kevin");
//set description
p1.setDescription("PolicyEntity Description");
//set modifiedBy
- p1.setModifiedBy("super-admin");
+ p1.setModifiedBy("kevin");
//modifiedDate will be set when it is persisted
@@ -202,7 +201,9 @@ public class PolicyEntityTest {
c1.setDescription("ConfigurationDataEntity Description");
- c1.setCreatedBy("super-admin");
+ c1.setCreatedBy("kevin");
+
+ //c1.setModifiedBy("kevin");
c1.setDeleted(true);
@@ -214,9 +215,9 @@ public class PolicyEntityTest {
a1.setActionBodyName("myActionBodyName");
- a1.setCreatedBy("super-admin");
+ a1.setCreatedBy("kevin");
- a1.setModifiedBy("super-admin");
+ a1.setModifiedBy("kevin");
a1.setDeleted(false);
@@ -274,7 +275,7 @@ public class PolicyEntityTest {
Query queryscope = em.createQuery("Select p from PolicyEntity p where p.scope=:s");
query.setParameter("pid", p1.getPolicyId());
- queryscope.setParameter("s", "com.user");
+ queryscope.setParameter("s", "mckiou.kevin.kim");
//Just test that we are retrieving the right object
@SuppressWarnings("rawtypes")
@@ -669,7 +670,7 @@ public class PolicyEntityTest {
pe1.setDescription("This is pe1");
- pe1.setPolicyDBDaoUrl("http://10.11.12.13:2345");
+ pe1.setPolicyDBDaoUrl("http://123.45.2.456:2345");
//push it to the DB
em.flush();
@@ -680,7 +681,7 @@ public class PolicyEntityTest {
pe2.setDescription("This is pe2");
- pe2.setPolicyDBDaoUrl("http://10.11.12.13:2345");
+ pe2.setPolicyDBDaoUrl("http://789.01.2.345:2345");
//Print them to the log before flushing
logger.debug("\n\n***********PolicyEntityTest: PolicyDBDaoEntity objects before flush********"
@@ -711,9 +712,9 @@ public class PolicyEntityTest {
}
for(Object policyDBDaoEntity: resultList){
PolicyDBDaoEntity pdbdao = (PolicyDBDaoEntity)policyDBDaoEntity;
- if(pdbdao.getPolicyDBDaoUrl().equals("http://10.11.12.13:2345")){
+ if(pdbdao.getPolicyDBDaoUrl().equals("http://123.45.2.456:2345")){
pex = pdbdao;
- }else if(pdbdao.getPolicyDBDaoUrl().equals("http://10.11.12.13:2345")){
+ }else if(pdbdao.getPolicyDBDaoUrl().equals("http://789.01.2.345:2345")){
pey = pdbdao;
}
}
@@ -731,7 +732,7 @@ public class PolicyEntityTest {
+ "\n modifiedDate-y " + pey.getModifiedDate()
);
//Verify the retrieved objects are the same as the ones we stored in the DB
- if(pex.getPolicyDBDaoUrl().equals("http://10.11.12.13:2345")){
+ if(pex.getPolicyDBDaoUrl().equals("http://123.45.2.456:2345")){
assertSame(pe1,pex);
assertSame(pe2,pey);
}else{