diff --git a/build.xml b/build.xml index 3f17b5112..747889239 100644 --- a/build.xml +++ b/build.xml @@ -836,15 +836,15 @@ Authors: - - + + + diff --git a/tests/schema/config/UnparsedEntityCheckingTest.java b/tests/schema/config/UnparsedEntityCheckingTest.java index 3c7798fc6..3eaa2ef99 100644 --- a/tests/schema/config/UnparsedEntityCheckingTest.java +++ b/tests/schema/config/UnparsedEntityCheckingTest.java @@ -17,11 +17,8 @@ package schema.config; -import junit.framework.Assert; - import org.apache.xerces.dom.PSVIElementNSImpl; import org.apache.xerces.xs.ItemPSVI; -import org.xml.sax.SAXException; /** * @author Peter McCracken, IBM @@ -47,90 +44,43 @@ public UnparsedEntityCheckingTest(String name) { super(name); } - public void testDefaultValid() { - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + public void testDefaultValid() throws Exception { + validateDocument(); checkDefault(); - throw new RuntimeException(); } - public void testSetFalseValid() { - try { - fValidator.setFeature(UNPARSED_ENTITY_CHECKING, false); - } catch (SAXException e) { - Assert.fail("Error setting feature."); - } - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + public void testSetFalseValid() throws Exception { + fValidator.setFeature(UNPARSED_ENTITY_CHECKING, false); + validateDocument(); checkDefault(); } - public void testSetTrueValid() { - try { - fValidator.setFeature(UNPARSED_ENTITY_CHECKING, true); - } catch (SAXException e) { - Assert.fail("Error setting feature."); - } - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + public void testSetTrueValid() throws Exception { + fValidator.setFeature(UNPARSED_ENTITY_CHECKING, true); + validateDocument(); checkDefault(); } - public void testDefaultInvalid() { + public void testDefaultInvalid() throws Exception { ((PSVIElementNSImpl) fRootNode).setAttributeNS(null, "unparsedEntityAttr", "invalid"); - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + validateDocument(); checkInvalid(); } - public void testSetFalseInvalid() { + public void testSetFalseInvalid() throws Exception { ((PSVIElementNSImpl) fRootNode).setAttributeNS(null, "unparsedEntityAttr", "invalid"); - try { - fValidator.setFeature(UNPARSED_ENTITY_CHECKING, false); - } catch (SAXException e) { - Assert.fail("Error setting feature."); - } - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + fValidator.setFeature(UNPARSED_ENTITY_CHECKING, false); + validateDocument(); checkDefault(); } - public void testSetTrueInvalid() { + public void testSetTrueInvalid() throws Exception { ((PSVIElementNSImpl) fRootNode).setAttributeNS(null, "unparsedEntityAttr", "invalid"); - try { - fValidator.setFeature(UNPARSED_ENTITY_CHECKING, true); - } catch (SAXException e) { - Assert.fail("Error setting feature."); - } - try { - validateDocument(); - } catch (Exception e) { - Assert.fail("Validation failed: " + e.getMessage()); - } - + fValidator.setFeature(UNPARSED_ENTITY_CHECKING, true); + validateDocument(); checkInvalid(); }