Package org.fcrepo.server.security

Examples of org.fcrepo.server.security.PolicyParser


                String schemaPath =
                    ((schemaLocation)
                            .startsWith(File.separator) ? "" : serverHome)
                            + schemaLocation;
                FileInputStream in = new FileInputStream(schemaPath);
                PolicyParser policyParser = new PolicyParser(in);
                ValidationUtility.setFeslPolicyParser(policyParser);
            } catch (IOException ioe) {
                throw new PolicyStoreException(ioe.getMessage(),ioe);
            } catch (SAXException se) {
                throw new PolicyStoreException(se.getMessage(),se);
View Full Code Here


    private static final String SCHEMA_BAD = "<not-a-schema/>";

    @Test (expected=SAXException.class)
    public void testConstructWithBadSchema() throws IOException, SAXException {
        new PolicyParser(StreamUtility.getStream(SCHEMA_BAD));
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseMalformedXMLValidationFalse()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_MALFORMEDXML), false);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseMalformedXMLValidationTrue()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_MALFORMEDXML), true);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseBadRootValidationFalse()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_BADROOT), false);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseBadRootValidationTrue()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_BADROOT), true);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseGoodRootNoContentValidationFalse()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_GOODROOT_NOCONTENT), false);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseGoodRootNoContentValidationTrue()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_GOODROOT_NOCONTENT), true);
    }
View Full Code Here

    }

    @Test
    public void testParseGoodRootQuestionableContentValidationFalse()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_QUESTIONABLE), false);
    }
View Full Code Here

    }

    @Test (expected=ValidationException.class)
    public void testParseGoodRootQuestionableContentValidationTrue()
            throws IOException, SAXException, ValidationException {
        PolicyParser parser = new MockPolicyParser();
        parser.parse(StreamUtility.getStream(POLICY_QUESTIONABLE), true);
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.security.PolicyParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.