vhardy 2002/11/19 00:29:32
Modified: test-resources/org/apache/batik/dom/svg unitTesting.xml
Added: test-sources/org/apache/batik/dom/svg SystemIdTest.java
Log:
Added regression test for publicId/systemId entries in dtdids.properties
Revision Changes Path
1.5 +9 -1
xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml
Index: unitTesting.xml
===================================================================
RCS file:
/home/cvs/xml-batik/test-resources/org/apache/batik/dom/svg/unitTesting.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- unitTesting.xml 23 May 2002 09:01:36 -0000 1.4
+++ unitTesting.xml 19 Nov 2002 08:29:32 -0000 1.5
@@ -43,4 +43,12 @@
<test id="presentationAttrRemovalTest"/>
</testGroup>
+ <!-- ================================================================ -->
+ <!-- Supported Public IDs test -->
+ <!-- ================================================================ -->
+ <test id="dom.svg.publicIds"
+ name="Checks that there are system ids for the supported public Ids"
+ class="org.apache.batik.dom.svg.SystemIdTest" />
+
+
</testSuite>
1.1
xml-batik/test-sources/org/apache/batik/dom/svg/SystemIdTest.java
Index: SystemIdTest.java
===================================================================
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.dom.svg;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.MissingResourceException;
import org.apache.batik.test.AbstractTest;
import org.apache.batik.test.TestReport;
import org.apache.batik.test.DefaultTestReport;
/**
* This class tests that there is System Id for each public Id
* in the dtdids.properties resource file.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vincent Hardy</a>
* @author $Id: SystemIdTest.java,v 1.1 2002/11/19 08:29:32 vhardy Exp $
*/
public class SystemIdTest extends AbstractTest {
public static final String ERROR_MISSING_SYSTEM_ID
= "error.missing.system.id";
public static final String KEY_MISSING_IDS
= "key.missing.ids";
public SystemIdTest() {
}
public TestReport runImpl() throws Exception {
ResourceBundle rb =
ResourceBundle.getBundle(SAXSVGDocumentFactory.DTDIDS,
Locale.getDefault());
String dtdids = rb.getString(SAXSVGDocumentFactory.KEY_PUBLIC_IDS);
StringTokenizer st = new StringTokenizer(dtdids, "-");
int nIds = st.countTokens();
String missingIds = "";
for (int i=0; i<nIds; i++) {
String publicId = st.nextToken();
publicId = "-" + publicId.trim();
System.out.println("Testing public id: " + publicId);
try {
rb.getString(SAXSVGDocumentFactory.KEY_SYSTEM_ID
+ publicId.replace(' ', '_'));
} catch (MissingResourceException e) {
missingIds += "[" + publicId + "] -- ";
}
}
if (!"".equals(missingIds)) {
DefaultTestReport report = new DefaultTestReport(this);
report.setErrorCode(ERROR_MISSING_SYSTEM_ID);
report.addDescriptionEntry(KEY_MISSING_IDS, missingIds);
report.setPassed(false);
return report;
}
return reportSuccess();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]