Author: vmassol
Date: 2008-01-11 10:50:22 +0100 (Fri, 11 Jan 2008)
New Revision: 6761

Added:
   xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/
   xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/pom.xml
   xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/
   xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/AllTests.java
   
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/PDFTest.java
Modified:
   xwiki-platform/core/trunk/xwiki-core/pom.xml
   xwiki-products/xwiki-enterprise/trunk/distribution-test/pom.xml
Log:
XWIKI-2002: PDF export not working anymore (Avalon dependency missing)

Fixed + Added a functional test to ensure PDF exports work at all times.


Modified: xwiki-platform/core/trunk/xwiki-core/pom.xml
===================================================================
--- xwiki-platform/core/trunk/xwiki-core/pom.xml        2008-01-11 08:47:24 UTC 
(rev 6760)
+++ xwiki-platform/core/trunk/xwiki-core/pom.xml        2008-01-11 09:50:22 UTC 
(rev 6761)
@@ -209,13 +209,6 @@
       <scope>runtime</scope>
     </dependency>
 
-    <!-- We need to create a JIRA issue on the Maven project to upload this 
artifact -->
-    <dependency>
-      <groupId>fop</groupId>
-      <artifactId>fop</artifactId>
-      <version>0.93</version>
-    </dependency>
-
     <!-- JTidy hasn't been released for ages (since 2001). A snapshot version 
exists at
          http://jtidy.sourceforge.net/snapshots/ but Maven requires 
non-snapshots in order to
          allow a release (this is for reproducibility). Thus we've had to 
upload JTidy into
@@ -490,6 +483,11 @@
       <artifactId>joda-time</artifactId>
       <version>1.4</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.xmlgraphics</groupId>
+      <artifactId>fop</artifactId>
+      <version>0.93</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>


Property changes on: 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests
___________________________________________________________________
Name: svn:ignore
   + target
*.ipr
*.iml
*.iws


Added: 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/pom.xml
===================================================================
--- xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/pom.xml  
                        (rev 0)
+++ xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/pom.xml  
2008-01-11 09:50:22 UTC (rev 6761)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.xpn.xwiki.products</groupId>
+    <artifactId>xwiki-enterprise-test</artifactId>
+    <version>1.3-SNAPSHOT</version>
+  </parent>
+  <artifactId>xwiki-enterprise-test-misc</artifactId>
+  <name>XWiki Products - Enterprise - Misc. Functional Tests</name>
+  <packaging>pom</packaging>
+  <description>XWiki Products - Enterprise - Misc. Functional 
Tests</description>
+  <dependencies>
+    <dependency>
+      <groupId>pdfbox</groupId>
+      <artifactId>pdfbox</artifactId>
+      <version>0.7.3</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <!-- Step 1: Compile the JUnit Tests and copy test resources files -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+      </plugin>
+      <!-- Step 2: Create jar containing integration tests which will be 
installed -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+      </plugin>
+      <!-- Step 3: Unpack the application -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>dependency-maven-plugin</artifactId>
+      </plugin>
+      <!-- Step 4: Start XWiki, Execute the tests and Stop XWiki -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration> 
+          <!-- Display report on screen when all tests are completed -->  
+          <useFile>false</useFile>
+          <reportFormat>plain</reportFormat>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/AllTests.java
===================================================================
--- 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/AllTests.java
                                (rev 0)
+++ 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/AllTests.java
        2008-01-11 09:50:22 UTC (rev 6761)
@@ -0,0 +1,67 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package com.xpn.xwiki.it.xmlrpc;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import com.xpn.xwiki.test.XWikiTestSetup;
+
+/**
+ * A class listing all the Functional tests to execute. We need such a class 
(rather than
+ * letting the JUnit Runner discover the different TestCases classes by 
itself) because we want to
+ * start/stop XWiki before and after the tests start (but only once).
+ * 
+ * @version $Id: $
+ */
+public class AllTests extends TestCase
+{
+    private static final String PATTERN = ".*" + System.getProperty("pattern", 
"");
+
+    public static Test suite() throws Exception
+    {
+        TestSuite suite = new TestSuite();
+
+        // TODO: I don't like listing tests here as it means we can add a new 
TestCase class and
+        // forget to add it here and the tests won't be run but we'll not know 
about it and we'll
+        // think the tests are all running fine. I haven't found a simple 
solution to this yet
+        // (there are complex solutions like searching for all tests by 
parsing the source tree).
+        // I think there are TestSuite that do this out there but I haven't 
looked for them yet.
+
+        addTestCase(suite, PDFTest.class);
+
+        return new XWikiTestSetup(suite);
+    }
+
+    private static void addTestCase(TestSuite suite, Class testClass) throws 
Exception
+    {
+        if (testClass.getName().matches(PATTERN)) {
+            suite.addTest(new TestSuite(testClass));
+        }
+    }
+
+    private static void addTest(TestSuite suite, Test test, Class testClass) 
throws Exception
+    {
+        if (testClass.getName().matches(PATTERN)) {
+            suite.addTest(test);
+        }
+    }
+}

Added: 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/PDFTest.java
===================================================================
--- 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/PDFTest.java
                         (rev 0)
+++ 
xwiki-products/xwiki-enterprise/trunk/distribution-test/misc-tests/src/test/it/com/xpn/xwiki/it/xmlrpc/PDFTest.java
 2008-01-11 09:50:22 UTC (rev 6761)
@@ -0,0 +1,31 @@
+package com.xpn.xwiki.it.xmlrpc;
+
+import junit.framework.TestCase;
+
+import java.net.URL;
+import java.net.HttpURLConnection;
+import java.io.InputStream;
+
+import org.pdfbox.pdmodel.PDDocument;
+import org.pdfbox.util.PDFTextStripper;
+
+public class PDFTest extends TestCase
+{
+    /**
+     * Verify that the PDF export feature works on a single simple page by 
downloading the PDF and parsing it using
+     * PDFBox.
+     */
+    public void testExportSingleSimplePageAsPDF() throws Exception
+    {
+        URL url = new 
URL("http://localhost:8080/xwiki/bin/export/Main/WebHome?format=pdf";);
+        HttpURLConnection connection = (HttpURLConnection) 
url.openConnection();
+        InputStream is = connection.getInputStream();
+        PDDocument pdd = PDDocument.load(is);
+        PDFTextStripper stripper = new PDFTextStripper();
+        String text = stripper.getText(pdd);
+        pdd.close();
+        is.close();
+
+        assertTrue("Invalid content", text.contains("Welcome to your wiki"));
+    }
+}

Modified: xwiki-products/xwiki-enterprise/trunk/distribution-test/pom.xml
===================================================================
--- xwiki-products/xwiki-enterprise/trunk/distribution-test/pom.xml     
2008-01-11 08:47:24 UTC (rev 6760)
+++ xwiki-products/xwiki-enterprise/trunk/distribution-test/pom.xml     
2008-01-11 09:50:22 UTC (rev 6761)
@@ -217,6 +217,7 @@
     </profile>
   </profiles>
   <modules>
+    <module>misc-tests</module>
     <module>xmlrpc-tests</module>
     <module>selenium-tests</module>
   </modules>

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to