You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2008/01/18 16:30:31 UTC
svn commit: r613189 -
/incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java
Author: bdelacretaz
Date: Fri Jan 18 07:30:29 2008
New Revision: 613189
URL: http://svn.apache.org/viewvc?rev=613189&view=rev
Log:
SLING-149 - merge usling into Sling - PostServletCreateTest passes more tests, work in progress
Modified:
incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java
Modified: incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java?rev=613189&r1=613188&r2=613189&view=diff
==============================================================================
--- incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java (original)
+++ incubator/sling/trunk/usling/usling-webapp/src/test/java/org/apache/sling/usling/webapp/integrationtest/ujax/PostServletCreateTest.java Fri Jan 18 07:30:29 2008
@@ -74,9 +74,11 @@
final Map <String, String> props = new HashMap <String, String> ();
props.put("a","123");
props.put("b","456");
+ props.put("c","some words");
final String createdNodeUrl = testClient.createNode(postUrl + "/UJAX_create", props);
final String content = getContent(createdNodeUrl + ".json", CONTENT_TYPE_JSON);
assertJavascript("123456", content, "out.println(data.a + data.b)");
+ assertJavascript("some words", content, "out.println(data.c)");
}
/** Use the default "save prefix" on some parameters, and check that only those
@@ -96,13 +98,27 @@
/** Use a custom "save prefix" on some parameters, and check that only those
* who have the prefix are saved.
*/
- public void TODO_FAILS_testCustomSavePrefix() throws IOException {
+ public void testCustomSavePrefix() throws IOException {
+ final Map <String, String> props = new HashMap <String, String> ();
+ props.put("STUFF_a","123");
+ props.put("STUFF_b","456");
+ props.put("c","not saved");
+ props.put("ujax:saveParamPrefix","STUFF_");
+ final String createdNodeUrl = testClient.createNode(postUrl + "/UJAX_create", props,null,false);
+ final String content = getContent(createdNodeUrl + ".json", CONTENT_TYPE_JSON);
+ assertJavascript("123456", content, "out.println(data.a + data.b)");
+ assertJavascript("undefined", content, "out.println(typeof data.c)");
+ }
+
+ public void TODO_FAILS_testCustomSavePrefixPlusPlus() throws IOException {
+ // for some reason, ++ as a custom save prefix fails
+ // might indicate a weirdness in parameters processing
final Map <String, String> props = new HashMap <String, String> ();
props.put("++a","123");
props.put("++b","456");
props.put("c","not saved");
props.put("ujax:saveParamPrefix","++");
- final String createdNodeUrl = testClient.createNode(postUrl + "/UJAX_create", props);
+ final String createdNodeUrl = testClient.createNode(postUrl + "/UJAX_create", props,null,false);
final String content = getContent(createdNodeUrl + ".json", CONTENT_TYPE_JSON);
assertJavascript("123456", content, "out.println(data.a + data.b)");
assertJavascript("undefined", content, "out.println(typeof data.c)");