adding xalanj test case for, jira issue xalanj-2584
diff --git a/java/src/org/apache/qetest/XMLParse.java b/java/src/org/apache/qetest/XMLParse.java
new file mode 100644
index 0000000..c0d654e
--- /dev/null
+++ b/java/src/org/apache/qetest/XMLParse.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.qetest;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+
+/**
+ * A utility class, to check well-formedness of an XML document,
+ * using an XML DOM parser.
+ *
+ * @author mukulg@apache.org
+ * @version $Id$
+ */
+public class XMLParse {
+
+ private String xmlFilePath = null;
+
+ public XMLParse(String xmlFilePath) {
+ this.xmlFilePath = xmlFilePath;
+ }
+
+ public boolean parse() {
+ boolean isDocumentWellFormedXml = false;
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document document = builder.parse(xmlFilePath);
+ if (document != null) {
+ isDocumentWellFormedXml = true;
+ }
+ }
+ catch (Exception ex) {
+ // NO OP
+ }
+
+ return isDocumentWellFormedXml;
+ }
+
+}
diff --git a/java/src/org/apache/qetest/XMLParserTestDriver.java b/java/src/org/apache/qetest/XMLParserTestDriver.java
new file mode 100644
index 0000000..5a5cb77
--- /dev/null
+++ b/java/src/org/apache/qetest/XMLParserTestDriver.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.qetest;
+
+/**
+ * A test driver class, to invoke an XML document parser.
+ *
+ * @author mukulg@apache.org
+ * @version $Id$
+ */
+ public class XMLParserTestDriver {
+
+ private static String SUCCESS_MESG = "The test case passed";
+
+ private static String FAIL_MESG = "Test failed. Please solve this, before checking in";
+
+ private static String FILE_EXT_SEPARATOR = ".";
+
+ public static void main(String[] args) {
+ String xmlFilePath = args[0];
+ String contextProcessor = args[1];
+ documentParse(xmlFilePath, contextProcessor);
+ }
+
+ private static void documentParse(String xmlFilePath, String contextProcessor) {
+ XMLParse xmlParse = new XMLParse(xmlFilePath);
+ boolean isDocumentWellFormedXml = xmlParse.parse();
+ if (isDocumentWellFormedXml) {
+ System.out.println(SUCCESS_MESG + " [" + contextProcessor + " : " + xmlFilePath.substring(0,
+ xmlFilePath.indexOf(FILE_EXT_SEPARATOR)) + "]!");
+ }
+ else {
+ System.out.println(FAIL_MESG + " [" + contextProcessor + " : " + xmlFilePath.substring(0,
+ xmlFilePath.indexOf(FILE_EXT_SEPARATOR)) + "]!");
+ }
+ }
+
+ }
diff --git a/tests/2.7.3_release/2.7.3_release.bat b/tests/2.7.3_release/2.7.3_release.bat
index d1ac4c4..474fe5d 100644
--- a/tests/2.7.3_release/2.7.3_release.bat
+++ b/tests/2.7.3_release/2.7.3_release.bat
@@ -30,26 +30,37 @@
set XERCES_ENDORSED_DIR_PATH=..\..\..\xalan-java\lib\endorsed;..\..\..\lib\endorsed
rem #Test 1 (Testing XalanJ integer truncation bug fix, with XalanJ XSLTC processor)
-if exist "test1.class" (
+if exist "int_trunc.class" (
rem delete the result XalanJ translet file, if that exists
- del test1.class
+ del int_trunc.class
)
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -XSLTC -IN int_trunc.xml -XSL int_trunc.xsl -SECURE -XX -XT 2>NUL
-if exist "test1.class" (
+if exist "int_trunc.class" (
echo Test failed. Please solve this, before checking in!
) else (
echo The xalanj integer truncation bug fix test passed!
)
-rem #Test 2 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ interpretive processor)
+rem #Test 2 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ interpretive processor)
+%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
+
+%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XERCES_ENDORSED_DIR_PATH% -classpath ..\..\java\build\testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_interpretive
+
+rem #Test 3 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ XSLTC processor)
+%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
+
+%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XERCES_ENDORSED_DIR_PATH% -classpath ..\..\java\build\testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_xsltc
+
+del jira_xalanj_2584.out
+
+rem #Test 4 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ interpretive processor)
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XERCES_ENDORSED_DIR_PATH% -classpath ..\..\java\build\testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_interpretive
-
-rem #Test 3 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ XSLTC processor)
+rem #Test 5 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ XSLTC processor)
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XALAN_BUILD_DIR_PATH%;%XERCES_ENDORSED_DIR_PATH% org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
%JAVA_HOME%\bin\java -Djava.endorsed.dirs=%XERCES_ENDORSED_DIR_PATH% -classpath ..\..\java\build\testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_xsltc
diff --git a/tests/2.7.3_release/2.7.3_release.sh b/tests/2.7.3_release/2.7.3_release.sh
index f250fb9..2dbfbe9 100644
--- a/tests/2.7.3_release/2.7.3_release.sh
+++ b/tests/2.7.3_release/2.7.3_release.sh
@@ -39,25 +39,37 @@
TEST_XSL_DIR=../../java/build:../../../java/build
#Test 1 (Testing XalanJ integer truncation bug fix, with XalanJ XSLTC processor)
-if [ -f "test1.class" ]; then
+if [ -f "int_trunc.class" ]; then
# delete the result XalanJ translet file, if that exists
- rm test1.class
+ rm int_trunc.class
fi
$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN int_trunc.xml -XSL int_trunc.xsl -SECURE -XX -XT 2>NUL
-if [ -f "test1.class" ]; then
+if [ -f "int_trunc.class" ]; then
echo Test failed. Please solve this, before checking in!
else
echo The xalanj integer truncation bug fix test passed!
fi
-#Test 2 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ interpretive processor)
+#Test 2 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ interpretive processor)
+$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
+
+$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_interpretive
+
+#Test 3 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ XSLTC processor)
+$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
+
+$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_xsltc
+
+rm jira_xalanj_2584.out
+
+#Test 4 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ interpretive processor)
$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_interpretive
-#Test 3 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ XSLTC processor)
+#Test 5 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ XSLTC processor)
$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_xsltc
diff --git a/tests/2.7.3_release/jira_xalanj_2584.xml b/tests/2.7.3_release/jira_xalanj_2584.xml
new file mode 100644
index 0000000..bf35cb1
--- /dev/null
+++ b/tests/2.7.3_release/jira_xalanj_2584.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root/>
\ No newline at end of file
diff --git a/tests/2.7.3_release/jira_xalanj_2584.xsl b/tests/2.7.3_release/jira_xalanj_2584.xsl
new file mode 100644
index 0000000..c24cc8d
--- /dev/null
+++ b/tests/2.7.3_release/jira_xalanj_2584.xsl
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:exsl="http://exslt.org"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date exsl"
+ version="1.0">
+
+ <!-- FileName : jira_xalanj_2584.xsl -->
+ <!-- Author : Mukul Gandhi -->
+ <!-- Purpose : Please see the jira issue XALANJ-2584, for more details
+ about this test. -->
+
+ <xsl:template match="/">
+ <xsl:element name="root">
+ <xsl:value-of select="date:date(root/@anAttribute)"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+
+</xsl:stylesheet>
+
+
+