You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2008/12/04 16:12:46 UTC

svn commit: r723344 - in /myfaces/core/branches/2_0_0/api: ./ src/test/javascript/org/apache/myfaces/_utils/ src/test/javascript/org/apache/myfaces/ajax/ src/test/javascript/org/apache/myfaces/mockups/

Author: werpu
Date: Thu Dec  4 07:12:46 2008
New Revision: 723344

URL: http://svn.apache.org/viewvc?rev=723344&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2109

Added:
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/_JSF2UtilsTests.js
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/AjaxTests.js
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt   (with props)
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/BrowserMockups.js
Modified:
    myfaces/core/branches/2_0_0/api/pom.xml

Modified: myfaces/core/branches/2_0_0/api/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/pom.xml?rev=723344&r1=723343&r2=723344&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/pom.xml (original)
+++ myfaces/core/branches/2_0_0/api/pom.xml Thu Dec  4 07:12:46 2008
@@ -71,16 +71,26 @@
                 <configuration>
                     <sourceDirectory>src/main/javascript/META-INF/resources</sourceDirectory>
                     <sources>
+                        <source>../../../../test/javascript/org/apache/myfaces/mockups/BrowserMockups.js</source>
+                        <!--
+                        <source>javax/faces/_util/OpenAjax.js</source>
+                        -->
+                        <source>javax/faces/_util/_JSF2Utils.js</source>
+                        <source>javax/faces/ajax/Ajax.js</source>
                         <source>../../../../test/javascript/org/apache/myfaces/test/_TestScenario.js</source>
                     </sources>
-                    <testSourceDirectory>src/test/javascript/org/apache/myfaces/test</testSourceDirectory>
+                    <testSourceDirectory>src/test/javascript/org/apache/myfaces</testSourceDirectory>
                     <reportsDirectory>target/surefire-reports</reportsDirectory>
                     <testSuites>
                         <testSuite>
-                            <name>MyfacesTest</name>
+                            <name>javax.faces.Ajax</name>
                             <type>TESTSUITES</type>
                             <includes>
-                                <include>ScenarioTest.js</include>
+                                <include>test/ScenarioTest.js</include>
+                                <include>utils/_JSF2UtilsTests.js</include>
+                                
+                                <include>ajax/AjaxTests.js</include>
+                               
                             </includes>
                         </testSuite>
                     </testSuites>

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/_JSF2UtilsTests.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/_JSF2UtilsTests.js?rev=723344&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/_JSF2UtilsTests.js (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/_utils/_JSF2UtilsTests.js Thu Dec  4 07:12:46 2008
@@ -0,0 +1,43 @@
+/* 
+ *  Licensed 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.
+ *  under the License.
+ */
+
+
+
+function JSF2UtilsTest(name)
+{
+    TestCase.call( this, name );
+}
+
+
+function JSF2UtilsTest_testNameSpacing() {
+    this.assertTrue( "namespacing org exists" , 'undefined' != typeof org );
+    this.assertTrue( "namespacing org.apache exists" , 'undefined' != typeof org.apache );
+    this.assertTrue( "namespacing org.apache.myfaces exists" , 'undefined' != typeof org.apache.myfaces );
+    this.assertTrue( "namespacing org.apache.myfaces._JSF2Utils exists" , 'undefined' != typeof org.apache.myfaces._JSF2Utils );
+}
+
+
+SimpleTest.prototype = new TestCase();
+SimpleTest.glue();
+
+function JSF2UtilsTestTestSuite()
+{
+    TestSuite.call( this, "JSF2UtilsTestTest" );
+    this.addTestSuite( JSF2UtilsTest );
+}
+JSF2UtilsTestTestSuite.prototype = new TestSuite();
+JSF2UtilsTestTestSuite.prototype.suite = function (){ 
+    return new JSF2UtilsTestTestSuite();
+}
\ No newline at end of file

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/AjaxTests.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/AjaxTests.js?rev=723344&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/AjaxTests.js (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/AjaxTests.js Thu Dec  4 07:12:46 2008
@@ -0,0 +1,52 @@
+/* 
+ *  Licensed 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.
+ *  under the License.
+ */
+/**
+ * testing various aspects of the jsf2
+ * ajax api!
+ */
+
+
+function AjaxTest(name)
+{
+    TestCase.call( this, name );
+}
+
+
+function AjaxTest_testNameSpacing() {
+    this.assertTrue(true);
+    this.assertTrue( "namespacing javax exists" , 'undefined' != typeof javax );
+    this.assertTrue( "namespacing javax.faces.Ajax exists" , 'undefined' != typeof javax.faces );
+    this.assertTrue( "namespacing javax.faces.Ajax exists" , 'undefined' != typeof javax.faces.Ajax );
+}
+
+
+//TODO add additional assertions covering the entire scripting interfaces
+//all which has to be done is simply to check for an existing function
+//within the javax.faces.Ajax function array!
+
+
+
+AjaxTest.prototype = new TestCase();
+AjaxTest.glue();
+
+function AjaxAPITestTestSuite()
+{
+    TestSuite.call( this, "AjaxAPITestTest" );
+    this.addTestSuite( AjaxTest );
+}
+AjaxAPITestTestSuite.prototype = new TestSuite();
+AjaxAPITestTestSuite.prototype.suite = function (){
+    return new AjaxAPITestTestSuite();
+}
\ No newline at end of file

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt?rev=723344&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt Thu Dec  4 07:12:46 2008
@@ -0,0 +1,2 @@
+put jsunit tests which can test the ajax parts
+of the jsf 2.0 api in here

Propchange: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/ajax/readme.txt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/BrowserMockups.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/BrowserMockups.js?rev=723344&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/BrowserMockups.js (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/mockups/BrowserMockups.js Thu Dec  4 07:12:46 2008
@@ -0,0 +1,63 @@
+/* 
+ *  Licensed 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.
+ *  under the License.
+ */
+/**
+ * A test mockup to support
+ * please do not use this file in production
+ */
+
+if('undefined' == typeof ( window) || null == window) {
+    var window = new Object();
+}
+
+if('undefined' == typeof (window.document)  || null == window.document) {
+    window.document = new Object();
+}
+
+if('undefined' == typeof document  || null == document) {
+    var document = window.document;
+}
+
+if('undefined' == typeof org  || null == org) {
+    var org = new Object();
+    document.org = org;
+}
+
+if('undefined' == typeof javax  || null == javax) {
+    var javax = new Object();
+    document.javax = javax;
+}
+
+/**
+ * we have to emulate openajax as well since
+ * it ties the namespaces to the windows explicitely
+ * we tie them simply into an array
+ * and get the same behavior
+ */
+var OpenAjax = new Object();
+
+OpenAjax.hub = new Object();
+
+OpenAjax.hub.registerLibrary = function(prefix, nsURL, version, extra) {
+    var namespaces = prefix.split(".");
+
+    var root = document;
+    for(var cnt = 0; cnt < namespaces.length; cnt ++) {
+        var curVal = namespaces[cnt];
+        if('undefined' == root[curVal] || null == root[curVal]) {
+            root[curVal] = new Object();
+        }
+        root = root[curVal];
+    }
+}