Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 50663 invoked from network); 6 Jan 2005 09:00:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jan 2005 09:00:44 -0000 Received: (qmail 17049 invoked by uid 500); 6 Jan 2005 09:00:38 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 17016 invoked by uid 500); 6 Jan 2005 09:00:38 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 17000 invoked by uid 500); 6 Jan 2005 09:00:38 -0000 Received: (qmail 16996 invoked by uid 99); 6 Jan 2005 09:00:38 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 06 Jan 2005 01:00:38 -0800 Received: (qmail 50628 invoked by uid 1431); 6 Jan 2005 09:00:36 -0000 Date: 6 Jan 2005 09:00:36 -0000 Message-ID: <20050106090036.50627.qmail@minotaur.apache.org> From: dion@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl TestEmbedded.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N dion 2005/01/06 01:00:36 Modified: jelly/src/test/org/apache/commons/jelly/test/impl TestEmbedded.java Log: Handle systemId being null. PR: JELLY-189 Obtained from:Jeff Gregory Submitted by: Jeff Gregory Reviewed by: dIon Revision Changes Path 1.6 +26 -2 jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/TestEmbedded.java Index: TestEmbedded.java =================================================================== RCS file: /home/cvs/jakarta-commons/jelly/src/test/org/apache/commons/jelly/test/impl/TestEmbedded.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- TestEmbedded.java 9 Sep 2004 12:31:57 -0000 1.5 +++ TestEmbedded.java 6 Jan 2005 09:00:36 -0000 1.6 @@ -17,8 +17,13 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.StringReader; +import org.apache.commons.jelly.JellyContext; +import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jelly.impl.Embedded; +import org.xml.sax.InputSource; import junit.framework.Test; import junit.framework.TestCase; @@ -93,8 +98,27 @@ boolean status = embedded.execute(); //executed properly without script errors assertEquals(status, true); - //check that the output confirms the exepected + //check that the output confirms the expected assertEquals("jelly-test-case", new String(baos.toByteArray())); - + } + + /** + * Test simple 'raw' execution of a string. See JELLY-189. + */ + public void testRawExecuteAsString() throws Exception + { + String message = + "" + + " " + + "jelly-test-case" + + " "; + ByteArrayOutputStream output = new ByteArrayOutputStream(); + XMLOutput xmlOutput = XMLOutput.createXMLOutput(output); + InputSource script = new InputSource( new StringReader(message.toString()) ); + JellyContext context = new JellyContext(); + context.runScript( script, xmlOutput); + output.close(); + //check that the output confirms the expected + assertEquals("jelly-test-case", new String(output.toByteArray())); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org