incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvazq...@apache.org
Subject svn commit: r756726 - in /incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc: ./ src/main/java/org/apache/sling/scripting/xproc/xpl/impl/ src/main/resources/SLING-INF/ src/test/java/org/apache/sling/scripting/xproc/xpl/ src/test/resou...
Date Fri, 20 Mar 2009 19:45:18 GMT
Author: jvazquez
Date: Fri Mar 20 19:45:17 2009
New Revision: 756726

URL: http://svn.apache.org/viewvc?rev=756726&view=rev
Log:
initial content deleted

Removed:
    incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/resources/SLING-INF/
Modified:
    incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/pom.xml
    incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java
    incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/java/org/apache/sling/scripting/xproc/xpl/XplBuilderTest.java
    incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/resources/xpl/html.xpl

Modified: incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/pom.xml?rev=756726&r1=756725&r2=756726&view=diff
==============================================================================
--- incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/pom.xml (original)
+++ incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/pom.xml Fri Mar 20
19:45:17 2009
@@ -24,11 +24,11 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>5-incubator-SNAPSHOT</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
     <artifactId>org.apache.sling.scripting.xproc</artifactId>
-    <version>2.0.3-incubator-SNAPSHOT</version>
+    <version>2.0.0-incubator-SNAPSHOT</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting W3C XML Processing Support</name>
@@ -59,7 +59,6 @@
                             org.apache.sling.scripting.xproc.*
                         </Private-Package>
                         <Embed-Dependency>cocoon-pipeline;inline=true</Embed-Dependency>
-                        <Sling-Initial-Content>SLING-INF/content;uninstall:=true</Sling-Initial-Content>
                         <ScriptEngine-Name>${pom.name}</ScriptEngine-Name>
                         <ScriptEngine-Version>${pom.version}</ScriptEngine-Version>
                     </instructions>
@@ -118,39 +117,4 @@
 		
     </dependencies>
     
-    <profiles>
-	
-		<profile>
-			<id>autoInstallBundle</id>
-			<activation>
-				<activeByDefault>false</activeByDefault>
-			</activation>
-			<build>
-				<plugins>
-					<plugin>
-						<groupId>org.apache.sling</groupId>
-						<artifactId>maven-sling-plugin</artifactId>
-						<version>2.0.2-incubator</version>
-						<executions>
-							<execution>
-								<id>install-bundle</id>
-								<goals>
-									<goal>install</goal>
-								</goals>
-							</execution>
-						</executions>
-						<configuration>
-							<slingUrl>
-								http://localhost:8888/system/console/install
-							</slingUrl>
-							<user>admin</user>
-							<password>admin</password>
-						</configuration>
-					</plugin>
-				</plugins>
-			</build>
-		</profile>
-		
-	</profiles>
-    
 </project>

Modified: incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java?rev=756726&r1=756725&r2=756726&view=diff
==============================================================================
--- incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java
(original)
+++ incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/main/java/org/apache/sling/scripting/xproc/xpl/impl/AbstractXplElementImpl.java
Fri Mar 20 19:45:17 2009
@@ -130,9 +130,7 @@
 	@Override
 	public String toString() {
 		StringBuffer sbXplElement = new StringBuffer();
-//		if (getDepth() == 0)
-//			sbXplElement.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-//		addTabs(sbXplElement, getDepth());
+		addTabs(sbXplElement, getDepth());
 		sbXplElement.append("<");
 		sbXplElement.append("p:" + this.getQName().getLocalPart());
 		if (getDepth() == 0) {
@@ -148,11 +146,11 @@
 		}
 		sbXplElement.append(">");
 		for (XplElement child : this.getChildren()) {
-//			sbXplElement.append("\r\n");
+			sbXplElement.append("\r\n");
 			sbXplElement.append(child.toString());
 		}
-//		sbXplElement.append("\r\n");
-//		addTabs(sbXplElement, getDepth());
+		sbXplElement.append("\r\n");
+		addTabs(sbXplElement, getDepth());
 		sbXplElement.append("</");
 		sbXplElement.append("p:" + this.getQName().getLocalPart());
 		sbXplElement.append(">");

Modified: incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/java/org/apache/sling/scripting/xproc/xpl/XplBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/java/org/apache/sling/scripting/xproc/xpl/XplBuilderTest.java?rev=756726&r1=756725&r2=756726&view=diff
==============================================================================
--- incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/java/org/apache/sling/scripting/xproc/xpl/XplBuilderTest.java
(original)
+++ incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/java/org/apache/sling/scripting/xproc/xpl/XplBuilderTest.java
Fri Mar 20 19:45:17 2009
@@ -19,49 +19,50 @@
 package org.apache.sling.scripting.xproc.xpl;
 
 import java.io.BufferedReader;
-import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
 
 import org.apache.sling.scripting.xproc.xpl.api.Step;
 import org.custommonkey.xmlunit.XMLAssert;
+import org.custommonkey.xmlunit.XMLUnit;
 
 import junit.framework.TestCase;
 
 public class XplBuilderTest extends TestCase {
 	
+	@Override
+	protected void setUp() throws Exception {
+		super.setUp();
+		XMLUnit.setIgnoreComments(true);
+		XMLUnit.setIgnoreWhitespace(true);
+	}
+	
 	public void testBuild() throws Exception {		
 		String xplPath = "/xpl/html.xpl";		
 		XplBuilder builder = new XplBuilder();
 		Step pipeline = builder.build(getReaderFromPath(xplPath));
-		System.out.println(pipeline.toString());
-		String kk1 = "<p:pipeline xmlns:p=\"http://www.w3.org/ns/xproc\"><p:xslt><p:input
port=\"stylesheet\"><p:document href=\"/xpl-sample/xsl/test-content.xslt\"/></p:input></p:xslt></p:pipeline>";
-		String kk2 = "<p:pipeline xmlns:p=\"http://www.w3.org/ns/xproc\"><p:xslt><p:input
port=\"stylesheet\"><p:document href=\"/xpl-sample/xsl/test-content.xslt\"/></p:input></p:xslt></p:pipeline>";
-		XMLAssert.assertXMLEqual(getReaderFromString(kk1), getReaderFromString(kk2));
-//		XMLAssert.assertXMLEqual(getReaderFromPath(xplPath), getReaderFromString(pipeline.toString()));
+		String strControl = toString(getClass().getResourceAsStream(xplPath));
+		XMLAssert.assertXMLEqual(strControl, pipeline.toString());
 	}
 	
 	private Reader getReaderFromPath(String path) throws Exception {
 		InputStream is = getClass().getResourceAsStream(path);
-		Reader reader = new BufferedReader(new InputStreamReader(is, "utf-8"));
+		Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
 		return reader;
 	}
 	
-	private Reader getReaderFromString(String str) throws Exception {
-		return new BufferedReader(new StringReader(str));
-	}
+	private String toString(InputStream ins) throws Exception {
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        byte[] buf = new byte[1024];
+        int rd;
+        while ( (rd = ins.read(buf)) >= 0) {
+            bos.write(buf, 0, rd);
+        }
+        bos.close();
 
-	private String readerToString(Reader reader) throws Exception {
-		StringWriter sw = new StringWriter();
-		BufferedWriter bfw = new BufferedWriter(sw);
-		int c;
-		while ((c = reader.read()) != -1) {
-			bfw.write(c);
-		}
-		bfw.flush();
-		return sw.getBuffer().toString();
-	}
+        return new String(bos.toByteArray(), "UTF-8");
+    }
+	
 }

Modified: incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/resources/xpl/html.xpl
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/resources/xpl/html.xpl?rev=756726&r1=756725&r2=756726&view=diff
==============================================================================
--- incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/resources/xpl/html.xpl
(original)
+++ incubator/sling/whiteboard/jvazquez/org.apache.sling.scripting.xproc/src/test/resources/xpl/html.xpl
Fri Mar 20 19:45:17 2009
@@ -29,4 +29,4 @@
     </p:input>
   </p:xslt>
   
-</p:pipeline>
+</p:pipeline>
\ No newline at end of file



Mime
View raw message