import org.onap.policy.pap.xacml.rest.components.PolicyDBDao.PolicyDBDaoTestClass;
import org.onap.policy.rest.XACMLRestProperties;
import org.onap.policy.rest.adapter.PolicyRestAdapter;
+import org.onap.policy.rest.dao.PolicyDBException;
import org.onap.policy.rest.jpa.GroupEntity;
import org.onap.policy.rest.jpa.PdpEntity;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.xacml.std.pap.StdPDPGroup;
import org.onap.policy.xacml.util.XACMLPolicyWriter;
-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;
EntityManagerFactory emf;
@Before
public void init(){
- System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME,"xacml.pap.properties");
+ System.setProperty(XACMLProperties.XACML_PROPERTIES_NAME,"src/test/resources/xacml.pap.properties");
emf = Persistence.createEntityManagerFactory("testPapPU");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
group.deleteGroup(groupToDelete, groupToMoveTo,"testuser");
group.commitTransaction();
Assert.fail();
- } catch(PAPException pe){
+ } catch(PolicyDBException pe){
//good, can't delete group with pdps
group.rollbackTransaction();
} catch(Exception e){
em.close();
}
- @Test
- public void encryptionTest(){
- try {
- String encr = d.encryptPassword("testpassword");
- System.out.println("original password: "+"testpassword");
- System.out.println("Encrypted password: "+encr);
- String decr = d.decryptPassword(encr);
- System.out.println("Decrypted password: "+decr);
- Assert.assertEquals("testpassword", decr);
- } catch (Exception e) {
- logger.error("Exception Occured"+e);
- Assert.fail();
- }
-
- }
@Test
public void getDescriptionFromXacmlTest(){
String myTestDesc = "hello this is a test";