Search in sources :

Example 1 with XACMLParsingException

use of org.opencastproject.authorization.xacml.XACMLParsingException in project opencast by opencast.

the class AclScannerTest method testCorruptedFileInstall.

@Test
public void testCorruptedFileInstall() throws Exception {
    File file = new File(AclScannerTest.class.getResource("/xacml_errors.xml").toURI());
    try {
        aclScanner.install(file);
        fail("Should not be parsed.");
    } catch (XACMLParsingException e) {
        assertTrue("The file can not be parsed.", e.getCause() instanceof SAXParseException);
    }
}
Also used : XACMLParsingException(org.opencastproject.authorization.xacml.XACMLParsingException) SAXParseException(org.xml.sax.SAXParseException) File(java.io.File) Test(org.junit.Test)

Example 2 with XACMLParsingException

use of org.opencastproject.authorization.xacml.XACMLParsingException in project opencast by opencast.

the class AclScannerTest method testCorruptedFileUpdate.

@Test
public void testCorruptedFileUpdate() throws Exception {
    File file = new File(AclScannerTest.class.getResource("/xacml_errors.xml").toURI());
    try {
        aclScanner.update(file);
        fail("Should not be parsed.");
    } catch (XACMLParsingException e) {
        assertTrue("The file can not be parsed.", e.getCause() instanceof SAXParseException);
    }
}
Also used : XACMLParsingException(org.opencastproject.authorization.xacml.XACMLParsingException) SAXParseException(org.xml.sax.SAXParseException) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)2 Test (org.junit.Test)2 XACMLParsingException (org.opencastproject.authorization.xacml.XACMLParsingException)2 SAXParseException (org.xml.sax.SAXParseException)2