From ea6f3e0d14d62ff21177bab522f33735bbe929ac Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 7 Aug 2009 06:12:02 +0000 Subject: [PATCH] testing git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@662 7e9141cc-0065-0410-87d8-b60c137991c4 --- .fakeJettyHome.sh | 47 +++++++++++++++++++ .../eclipse/jetty/http/HttpFieldsTest.java | 5 ++ 2 files changed, 52 insertions(+) create mode 100755 .fakeJettyHome.sh diff --git a/.fakeJettyHome.sh b/.fakeJettyHome.sh new file mode 100755 index 00000000000..4be7ee46ff1 --- /dev/null +++ b/.fakeJettyHome.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# This script creates a fake jetty home in the top level project of jetty. +# run this after the project has built. + +rm -fr contexts etc lib logs start.jar webapps +mkdir contexts etc lib logs webapps + +cd lib +find ../jetty-* -name target | egrep -v -e 'jetty-aggregate' -e 'jetty-start' | while read T +do + find $T -name '*.jar' -maxdepth 1 | egrep -v -e '-javadoc' -e '-sources' -e '-config' -e '-tests' | while read J + do + ln -s $J . + done +done +ln -s $HOME/.m2/repository/org/mortbay/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar servlet-api-2.5.jar +cd .. + +find jetty-start/target -maxdepth 1 -name '*.jar' | egrep -v -e '-javadoc' -e '-sources' -e '-config' -e '-tests' | while read J +do + ln -s $J start.jar +done + +cd etc +find ../jetty-* -name etc | egrep 'src/main/config/etc' | egrep -v -e 'jetty-aggregate' -e 'jetty-start' | while read E +do + find $E -maxdepth 1 -type f | while read F + do + ln -s $F . + done +done +cd .. + +cd contexts +find ../*-* -name contexts | egrep 'src/main/config/contexts' | while read C +do + ls $C | egrep -v .svn | while read F + do + ln -s $C/$F . + done +done +cd .. + +cd webapps +ln -s ../test-jetty-webapp/target/*.war test.war +cd .. diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java index 63b137811fd..7f4d26b73cd 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/HttpFieldsTest.java @@ -359,6 +359,11 @@ public class HttpFieldsTest extends TestCase fields.clear(); fields.addSetCookie("ev erything","va lue","do main","pa th",1,"co mment",true,true,2); assertEquals("\"ev erything\"=\"va lue\";Version=2;Comment=\"co mment\";Path=\"pa th\";Domain=\"do main\";Max-Age=1;Secure;HttpOnly",fields.getStringField("Set-Cookie")); + + fields.clear(); + fields.addSetCookie("json","{\"services\":[\"cwa\", \"aa\"]}",null,null,-1,null,false,false,-1); + assertEquals("json=\"{\\\"services\\\":[\\\"cwa\\\", \\\"aa\\\"]}\"",fields.getStringField("Set-Cookie")); + } private Set enum2set(Enumeration e)