This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag 
org.apache.sling.scripting.sightly.testing-content-1.0.6
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing-content.git

commit 3a42b216928e4f4ba799b9af90d0a5cb2ff251a3
Author: Radu Cotescu <[email protected]>
AuthorDate: Mon Aug 24 22:57:39 2015 +0000

    SLING-4964 - Deprecate the asynchronous JavaScript API provided by the 
Sightly JS Use Provider
    
    * proxy objects are used to load the async namespaces on first usage for a 
Use script
    * created a new JS performance test for purely synchronous code
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/testing-content@1697513
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../SLING-INF/apps/sightlyperf/loop/loop.jsp       |  2 +-
 .../test/{sly-js.html => sly-js-async.html}        |  2 +-
 .../apps/sightlyperf/test/sly-js-sync.html         | 25 ++++++++++++++++
 .../sightlyperf/test/{test.js => test-async.js}    |  3 ++
 .../SLING-INF/apps/sightlyperf/test/test-sync.js   | 35 ++++++++++++++++++++++
 5 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/SLING-INF/apps/sightlyperf/loop/loop.jsp 
b/src/main/resources/SLING-INF/apps/sightlyperf/loop/loop.jsp
index de960bf..0624a61 100644
--- a/src/main/resources/SLING-INF/apps/sightlyperf/loop/loop.jsp
+++ b/src/main/resources/SLING-INF/apps/sightlyperf/loop/loop.jsp
@@ -21,5 +21,5 @@
 <p>selector: ${param.selector} [<strong>jsp</strong>, jsp-el, sly-java, 
sly-js]</p>
 <p>count: ${param.count} [1 - 20, <strong>20</strong>]</p>
 <c:forEach begin="1" end="${empty param.count || param.count < 1 || 
param.count > 20 ? 20 : param.count}">
-    <sling:include path="/sightlyperf/test" replaceSelectors="${param.selector 
== 'sly-java' || param.selector == 'sly-js' || param.selector == 'jsp-el'  ? 
param.selector : 'jsp'}" />
+    <sling:include path="/sightlyperf/test" replaceSelectors="${param.selector 
!= null ? param.selector : 'jsp'}" />
 </c:forEach>
\ No newline at end of file
diff --git a/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js.html 
b/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-async.html
similarity index 95%
rename from src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js.html
rename to src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-async.html
index e13115f..c218668 100644
--- a/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js.html
+++ b/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-async.html
@@ -16,7 +16,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<div data-sly-use.test="test.js" data-sly-unwrap>
+<div data-sly-use.test="test-async.js" data-sly-unwrap>
     ${test.tag != null ? test.startTag : '' @ context = "unsafe"}
     ${test.text @ context = "text"}
     ${test.tag != null ? test.endTag : '' @ context = "unsafe"}
diff --git 
a/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-sync.html 
b/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-sync.html
new file mode 100644
index 0000000..b70b3dc
--- /dev/null
+++ b/src/main/resources/SLING-INF/apps/sightlyperf/test/sly-js-sync.html
@@ -0,0 +1,25 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<div data-sly-use.test="test-sync.js" data-sly-unwrap>
+    ${test.tag != null ? test.startTag : '' @ context = "unsafe"}
+    ${test.text @ context = "text"}
+    ${test.tag != null ? test.endTag : '' @ context = "unsafe"}
+    <div data-sly-include="mode.jsp" data-sly-unwrap=""></div>
+    <ul data-sly-test="${test.includeChildren}" 
data-sly-list.child="${test.children}">
+        <li data-sly-resource="${child.path}"></li>
+    </ul>
+</div>
diff --git a/src/main/resources/SLING-INF/apps/sightlyperf/test/test.js 
b/src/main/resources/SLING-INF/apps/sightlyperf/test/test-async.js
similarity index 95%
rename from src/main/resources/SLING-INF/apps/sightlyperf/test/test.js
rename to src/main/resources/SLING-INF/apps/sightlyperf/test/test-async.js
index d7217cc..67d3a6e 100644
--- a/src/main/resources/SLING-INF/apps/sightlyperf/test/test.js
+++ b/src/main/resources/SLING-INF/apps/sightlyperf/test/test-async.js
@@ -16,7 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  
******************************************************************************/
+/*global use, properties, resource, sightly*/
 use(function () {
+    'use strict';
+
     var test = {};
 
     test.text = properties.get('text') ||  resource.getPath();
diff --git a/src/main/resources/SLING-INF/apps/sightlyperf/test/test-sync.js 
b/src/main/resources/SLING-INF/apps/sightlyperf/test/test-sync.js
new file mode 100644
index 0000000..c26c025
--- /dev/null
+++ b/src/main/resources/SLING-INF/apps/sightlyperf/test/test-sync.js
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ 
******************************************************************************/
+/*global use, properties, resource*/
+use(function () {
+    'use strict';
+
+    var test = {};
+
+    test.text = properties.get('text') ||  resource.getPath();
+    test.tag = properties.get('tag') || null;
+    if (test.tag != null) {
+        test.startTag = '<' + test.tag + '>';
+        test.endTag = '</' + test.tag + '>';
+    }
+    test.includeChildren = properties.get('includeChildren') || false;
+    if (test.includeChildren) {
+        test.children = resource.getChildren();
+    }
+
+    return test;
+});
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to