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 14:50:03 UTC

svn commit: r723323 - in /myfaces/core/branches/2_0_0/api: ./ src/main/javascript/ src/main/javascript/META-INF/ src/main/javascript/META-INF/resources/ src/test/javascript/ src/test/javascript/org/ src/test/javascript/org/apache/ src/test/javascript/o...

Author: werpu
Date: Thu Dec  4 05:50:02 2008
New Revision: 723323

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

Added:
    myfaces/core/branches/2_0_0/api/src/main/javascript/
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/
    myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/OpenAjax.js
    myfaces/core/branches/2_0_0/api/src/test/javascript/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/ScenarioTest.js
    myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/_TestScenario.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=723323&r1=723322&r2=723323&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/pom.xml (original)
+++ myfaces/core/branches/2_0_0/api/pom.xml Thu Dec  4 05:50:02 2008
@@ -1,48 +1,93 @@
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
+    <parent>
+        <groupId>org.apache.myfaces.core</groupId>
+        <artifactId>myfaces-core-project</artifactId>
+        <version>2.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
     <groupId>org.apache.myfaces.core</groupId>
-    <artifactId>myfaces-core-project</artifactId>
-    <version>2.0.0-SNAPSHOT</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.myfaces.core</groupId>
-  <artifactId>myfaces-api</artifactId>
-  <name>Apache Myfaces JSF Core-2.0 API</name>
-  <description>
+    <artifactId>myfaces-api</artifactId>
+    <name>Apache Myfaces JSF Core-2.0 API</name>
+    <description>
     The public API classes of the Apache MyFaces CORE JSF-2.0 project
-  </description>
-  <url>http://myfaces.apache.org/core20/myfaces-api</url>
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</developerConnection>
-    <url>http://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</url>
-  </scm>
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>2.2</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test-jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-source-plugin</artifactId>
-        <version>2.0.4</version>
-        <executions>
-          <execution>
-            <id>attach-source</id>
-            <goals>
-              <goal>jar</goal>
-            </goals>
-          </execution>
-         </executions>
-        </plugin>
-        <!-- 
+    </description>
+    <url>http://myfaces.apache.org/core20/myfaces-api</url>
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</developerConnection>
+        <url>http://svn.apache.org/repos/asf/myfaces/core/branches/2_0_0/api</url>
+    </scm>
+    <build>
+        <plugins>
+ 
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>2.2</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.0.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-source</id>
+                        <goals>
+                            <goal>jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+    
+            <!-- 
+                berlios jsunit under apache2 license
+                to cover javascript core routines which
+                do not have to rely on a browser
+                or can work on browser mockups!
+
+                for furhter on dom testing we probably have
+                to integrate html based tests
+                with a browser engine
+                but for the core apis this should be sufficient
+                
+            -->
+            <plugin>
+                <groupId>de.berlios.jsunit</groupId>
+                <artifactId>jsunit-maven2-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>test</id>
+                        <goals>
+                            <goal>jsunit-test</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <sourceDirectory>src/main/javascript/META-INF/resources</sourceDirectory>
+                    <sources>
+                        <source>../../../../test/javascript/org/apache/myfaces/test/_TestScenario.js</source>
+                    </sources>
+                    <testSourceDirectory>src/test/javascript/org/apache/myfaces/test</testSourceDirectory>
+                    <reportsDirectory>target/surefire-reports</reportsDirectory>
+                    <testSuites>
+                        <testSuite>
+                            <name>MyfacesTest</name>
+                            <type>TESTSUITES</type>
+                            <includes>
+                                <include>ScenarioTest.js</include>
+                            </includes>
+                        </testSuite>
+                    </testSuites>
+                </configuration>
+            </plugin>
+
+    <!--
       <plugin>
         <groupId>org.apache.myfaces.buildtools</groupId>
         <artifactId>myfaces-faces-plugin</artifactId>
@@ -71,91 +116,100 @@
         </dependencies>
       </plugin>
        -->
-      <plugin>
-        <groupId>org.apache.myfaces.buildtools</groupId>
-        <artifactId>myfaces-builder-plugin</artifactId>
-        <version>1.0.2</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>build-metadata</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>makecomp</id>
-            <configuration>
-               <jsfVersion>12</jsfVersion>
-            </configuration>            
-            <goals>
-              <goal>make-components</goal>
-            </goals>
-          </execution>        
-        </executions>
-      </plugin>          
-    </plugins>
-  </build>
-  <profiles>
-    <profile>
+            <plugin>
+                <groupId>org.apache.myfaces.buildtools</groupId>
+                <artifactId>myfaces-builder-plugin</artifactId>
+                <version>1.0.2</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build-metadata</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>makecomp</id>
+                        <configuration>
+                            <jsfVersion>12</jsfVersion>
+                        </configuration>
+                        <goals>
+                            <goal>make-components</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+    
+
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
       <!--
         - Generate files that are good to have when doing a release to main
         - repositories, but which are not wanted when doing a quick 
         - "mvn install" before testing some code modifications.
         -->
-      <id>generate-assembly</id>
-      <build>
-        <plugins>
-          <plugin>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <version>2.4</version>
-            <executions>
-              <execution>
-                <id>attach-javadoc</id>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <profile>
+            <id>generate-assembly</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <version>2.4</version>
+                        <executions>
+                            <execution>
+                                <id>attach-javadoc</id>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+					  <!--
+				      JSUnit Testing setup
+				      to test the affected javascript
+				      sources in a proper way!
+				      -->
+				            
+                </plugins>
+            </build>
+        </profile>
+        <profile>
       <!-- This plugin verifies the binary compablity with the jsf api of the RI
            TODO: add this to the normal build if 2.1 (or higher) of clirr-maven-plugin is released
            In the meantime to use this plugin it must be installed manually from
            https://svn.codehaus.org/mojo/trunk/mojo/clirr-maven-plugin
            There is also a pending bug which patch must be applied before using this plugin:
            http://jira.codehaus.org/browse/MCLIRR-5 -->
-      <id>checkCompability</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>clirr-maven-plugin</artifactId>
-            <version>2.1.1</version>
-            <configuration>
-              <comparisonArtifacts>
-                <comparisonArtifact>
-                  <groupId>javax.faces</groupId>
-                  <artifactId>jsf-api</artifactId>
-                  <version>1.2_03</version>
-                </comparisonArtifact>
-              </comparisonArtifacts>
-            </configuration>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>check</goal>
-                </goals>
-                <phase>test</phase>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-  <dependencies>
+            <id>checkCompability</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>clirr-maven-plugin</artifactId>
+                        <version>2.1.1</version>
+                        <configuration>
+                            <comparisonArtifacts>
+                                <comparisonArtifact>
+                                    <groupId>javax.faces</groupId>
+                                    <artifactId>jsf-api</artifactId>
+                                    <version>1.2_03</version>
+                                </comparisonArtifact>
+                            </comparisonArtifacts>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>check</goal>
+                                </goals>
+                                <phase>test</phase>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <dependencies>
     <!-- 
       - The file with config metadata for generating component classes. The contents
       - of this jarfile are processed using the maven-faces-plugin.
@@ -166,155 +220,162 @@
        <version>2.0.0-SNAPSHOT</version>
        <scope>provided</scope>
     </dependency> -->
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>2.5</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet.jsp</groupId>
-      <artifactId>jsp-api</artifactId>
-      <version>2.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>jstl</groupId>
-      <artifactId>jstl</artifactId>
+
+        <dependency>
+            <groupId>de.berlios.jsunit</groupId>
+            <artifactId>jsunit-maven2-plugin</artifactId>
+            <version>1.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet.jsp</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>2.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>jstl</groupId>
+            <artifactId>jstl</artifactId>
       <!-- version defined in parent -->
-      <scope>provided</scope>
-      <exclusions>
-        <exclusion>
-          <artifactId>jsp-api</artifactId>
-          <groupId>javax.servlet</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>1.1.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.myfaces.buildtools</groupId>
-      <artifactId>myfaces-builder-annotations</artifactId> 
-      <version>1.0.2</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-beanutils</groupId>
-      <artifactId>commons-beanutils</artifactId>
-      <version>1.7.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.testng</groupId>
-      <artifactId>testng</artifactId>
-      <classifier>jdk15</classifier>
-      <version>5.1</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.shale</groupId>
-      <artifactId>shale-test</artifactId>
-      <version>1.0.4</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock-cglib</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.easymock</groupId>
-      <artifactId>easymock</artifactId>
-      <version>2.3</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.easymock</groupId>
-      <artifactId>easymockclassextension</artifactId>
-      <version>2.3</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <reporting>
-    <plugins>
-      <plugin>
-        <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.4</version>
-      </plugin>
-      <plugin>
-        <artifactId>maven-changelog-plugin</artifactId>
-        <version>2.1</version>
-        <reportSets>
-          <reportSet>
-            <id>dual-report</id>
-            <configuration>
-              <type>range</type>
-              <range>30</range>
-            </configuration>
-            <reports>
-              <report>changelog</report>
-              <report>file-activity</report>
-              <report>dev-activity</report>
-            </reports>
-          </reportSet>
-        </reportSets>
-      </plugin>
-      <plugin>
-        <artifactId>maven-jxr-plugin</artifactId>
-        <version>2.1</version>
-      </plugin>
-      <plugin>
-        <artifactId>maven-surefire-report-plugin</artifactId>
-        <version>2.4.3</version>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>taglist-maven-plugin</artifactId>
-        <version>2.1</version>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>cobertura-maven-plugin</artifactId>
-        <version>2.2</version>
-      </plugin>
+            <scope>provided</scope>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jsp-api</artifactId>
+                    <groupId>javax.servlet</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.myfaces.buildtools</groupId>
+            <artifactId>myfaces-builder-annotations</artifactId>
+            <version>1.0.2</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.7.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <classifier>jdk15</classifier>
+            <version>5.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shale</groupId>
+            <artifactId>shale-test</artifactId>
+            <version>1.0.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>jmock</groupId>
+            <artifactId>jmock</artifactId>
+            <version>1.2.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>jmock</groupId>
+            <artifactId>jmock-cglib</artifactId>
+            <version>1.2.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+            <version>2.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymockclassextension</artifactId>
+            <version>2.3</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <reporting>
+        <plugins>
+            <plugin>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <version>2.4</version>
+            </plugin>
+            <plugin>
+                <artifactId>maven-changelog-plugin</artifactId>
+                <version>2.1</version>
+                <reportSets>
+                    <reportSet>
+                        <id>dual-report</id>
+                        <configuration>
+                            <type>range</type>
+                            <range>30</range>
+                        </configuration>
+                        <reports>
+                            <report>changelog</report>
+                            <report>file-activity</report>
+                            <report>dev-activity</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jxr-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-report-plugin</artifactId>
+                <version>2.4.3</version>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>taglist-maven-plugin</artifactId>
+                <version>2.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>cobertura-maven-plugin</artifactId>
+                <version>2.2</version>
+            </plugin>
       <!-- override PMD settings to set targetJdk -->
-      <plugin>
-        <artifactId>maven-pmd-plugin</artifactId>
-        <version>2.4</version>
-        <configuration>
-          <rulesets>
-            <ruleset>/rulesets/basic.xml</ruleset>
-            <ruleset>/rulesets/unusedcode.xml</ruleset>
-          </rulesets>
-          <linkXref>true</linkXref>
-          <minimumTokens>100</minimumTokens>
-          <targetJdk>1.5</targetJdk>
-          <excludes>
+            <plugin>
+                <artifactId>maven-pmd-plugin</artifactId>
+                <version>2.4</version>
+                <configuration>
+                    <rulesets>
+                        <ruleset>/rulesets/basic.xml</ruleset>
+                        <ruleset>/rulesets/unusedcode.xml</ruleset>
+                    </rulesets>
+                    <linkXref>true</linkXref>
+                    <minimumTokens>100</minimumTokens>
+                    <targetJdk>1.5</targetJdk>
+                    <excludes>
             <!-- these class make the PMD plugin crash (NullPointerException). -->
-            <exclude>org/apache/myfaces/el/convert/PropertyResolverToELResolver.java</exclude>
-            <exclude>org/apache/myfaces/el/PropertyResolverImpl.java</exclude>
-          </excludes>
-        </configuration>
-        <reportSets>
-          <reportSet>
-            <reports>
-              <report>pmd</report>
-              <report>cpd</report>
-            </reports>
-          </reportSet>
-        </reportSets>
-      </plugin>
-    </plugins>
-  </reporting>
+                        <exclude>org/apache/myfaces/el/convert/PropertyResolverToELResolver.java</exclude>
+                        <exclude>org/apache/myfaces/el/PropertyResolverImpl.java</exclude>
+                    </excludes>
+                </configuration>
+                <reportSets>
+                    <reportSet>
+                        <reports>
+                            <report>pmd</report>
+                            <report>cpd</report>
+                        </reports>
+                    </reportSet>
+                </reportSets>
+            </plugin>
+        </plugins>
+    </reporting>
 
 </project>

Added: myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/OpenAjax.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/OpenAjax.js?rev=723323&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/OpenAjax.js (added)
+++ myfaces/core/branches/2_0_0/api/src/main/javascript/META-INF/resources/OpenAjax.js Thu Dec  4 05:50:02 2008
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * OpenAjax.js
+ *
+ * Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
+ * Specification is under development at:
+ *
+ *   http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
+ *
+ * Copyright 2006-2008 OpenAjax Alliance
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
+// prevent re-definition of the OpenAjax object
+if(!window["OpenAjax"]){
+    OpenAjax = new function(){
+        var t = true;
+        var f = false;
+        var g = window;
+        var libs;
+        var ooh = "org.openajax.hub.";
+
+        var h = {};
+        this.hub = h;
+        h.implementer = "http://openajax.org";
+        h.implVersion = "1.0";
+        h.specVersion = "1.0";
+        h.implExtraData = {};
+        var libs = {};
+        h.libraries = libs;
+
+        h.registerLibrary = function(prefix, nsURL, version, extra){
+            libs[prefix] = {
+                prefix: prefix,
+                namespaceURI: nsURL,
+                version: version,
+                extraData: extra
+            };
+            this.publish(ooh+"registerLibrary", libs[prefix]);
+        }
+        h.unregisterLibrary = function(prefix){
+            this.publish(ooh+"unregisterLibrary", libs[prefix]);
+            delete libs[prefix];
+        }
+
+        h._subscriptions = {
+            c:{},
+            s:[]
+        };
+        h._cleanup = [];
+        h._subIndex = 0;
+        h._pubDepth = 0;
+
+        h.subscribe = function(name, callback, scope, subscriberData, filter)
+        {
+            if(!scope){
+                scope = window;
+            }
+            var handle = name + "." + this._subIndex;
+            var sub = {
+                scope: scope,
+                cb: callback,
+                fcb: filter,
+                data: subscriberData,
+                sid: this._subIndex++,
+                hdl: handle
+            };
+            var path = name.split(".");
+            this._subscribe(this._subscriptions, path, 0, sub);
+            return handle;
+        }
+
+        h.publish = function(name, message)
+        {
+            var path = name.split(".");
+            this._pubDepth++;
+            this._publish(this._subscriptions, path, 0, name, message);
+            this._pubDepth--;
+            if((this._cleanup.length > 0) && (this._pubDepth == 0)) {
+                for(var i = 0; i < this._cleanup.length; i++)
+                    this.unsubscribe(this._cleanup[i].hdl);
+                delete(this._cleanup);
+                this._cleanup = [];
+            }
+        }
+
+        h.unsubscribe = function(sub)
+        {
+            var path = sub.split(".");
+            var sid = path.pop();
+            this._unsubscribe(this._subscriptions, path, 0, sid);
+        }
+
+        h._subscribe = function(tree, path, index, sub)
+        {
+            var token = path[index];
+            if(index == path.length)
+                tree.s.push(sub);
+            else {
+                if(typeof tree.c == "undefined")
+                    tree.c = {};
+                if(typeof tree.c[token] == "undefined") {
+                    tree.c[token] = {
+                        c: {},
+                        s: []
+                    };
+                    this._subscribe(tree.c[token], path, index + 1, sub);
+                }
+                else
+                    this._subscribe( tree.c[token], path, index + 1, sub);
+            }
+        }
+
+        h._publish = function(tree, path, index, name, msg) {
+            if(typeof tree != "undefined") {
+                var node;
+                if(index == path.length) {
+                    node = tree;
+                } else {
+                    this._publish(tree.c[path[index]], path, index + 1, name, msg);
+                    this._publish(tree.c["*"], path, index + 1, name, msg);
+                    node = tree.c["**"];
+                }
+                if(typeof node != "undefined") {
+                    var callbacks = node.s;
+                    var max = callbacks.length;
+                    for(var i = 0; i < max; i++) {
+                        if(callbacks[i].cb) {
+                            var sc = callbacks[i].scope;
+                            var cb = callbacks[i].cb;
+                            var fcb = callbacks[i].fcb;
+                            var d = callbacks[i].data;
+                            if(typeof cb == "string"){
+                                // get a function object
+                                cb = sc[cb];
+                            }
+                            if(typeof fcb == "string"){
+                                // get a function object
+                                fcb = sc[fcb];
+                            }
+                            if((!fcb) ||
+                                (fcb.call(sc, name, msg, d))) {
+                                cb.call(sc, name, msg, d);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        h._unsubscribe = function(tree, path, index, sid) {
+            if(typeof tree != "undefined") {
+                if(index < path.length) {
+                    var childNode = tree.c[path[index]];
+                    this._unsubscribe(childNode, path, index + 1, sid);
+                    if(childNode.s.length == 0) {
+                        for(var x in childNode.c)
+                            return;
+                        delete tree.c[path[index]];
+                    }
+                    return;
+                }
+                else {
+                    var callbacks = tree.s;
+                    var max = callbacks.length;
+                    for(var i = 0; i < max; i++)
+                        if(sid == callbacks[i].sid) {
+                            if(this._pubDepth > 0) {
+                                callbacks[i].cb = null;
+                                this._cleanup.push(callbacks[i]);
+                            }
+                            else
+                                callbacks.splice(i, 1);
+                            return;
+                        }
+                }
+            }
+        }
+        // The following function is provided for automatic testing purposes.
+        // It is not expected to be deployed in run-time OpenAjax Hub implementations.
+        h.reinit = function()
+        {
+            for (var lib in OpenAjax.hub.libraries) {
+                delete OpenAjax.hub.libraries[lib];
+            }
+            OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "1.0", {});
+
+            delete OpenAjax._subscriptions;
+            OpenAjax._subscriptions = {
+                c:{},
+                s:[]
+            };
+            delete OpenAjax._cleanup;
+            OpenAjax._cleanup = [];
+            OpenAjax._subIndex = 0;
+            OpenAjax._pubDepth = 0;
+        }
+    };
+    // Register the OpenAjax Hub itself as a library.
+    OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "1.0", {});
+
+}

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/ScenarioTest.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/ScenarioTest.js?rev=723323&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/ScenarioTest.js (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/ScenarioTest.js Thu Dec  4 05:50:02 2008
@@ -0,0 +1,41 @@
+/* 
+ *  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.
+ */
+
+/**
+ * JSUnit Test for our testing scenario to be able
+ * to test the test integration
+ */
+
+function SimpleTest(name)
+{
+    TestCase.call( this, name );
+}
+
+
+function SimpleTest_testTestScenario() {
+    this.assertTrue( "This test should succeed" , helloWorld() == "hello world" );
+}
+
+SimpleTest.prototype = new TestCase();
+SimpleTest.glue();
+
+
+function SimpleTestTestSuite()
+{
+    TestSuite.call( this, "SimpleTestTest" );
+    this.addTestSuite( SimpleTest );
+}
+SimpleTestTestSuite.prototype = new TestSuite();
+SimpleTestTestSuite.prototype.suite = function (){ return new SimpleTestTestSuite(); }
\ No newline at end of file

Added: myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/_TestScenario.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/_TestScenario.js?rev=723323&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/_TestScenario.js (added)
+++ myfaces/core/branches/2_0_0/api/src/test/javascript/org/apache/myfaces/test/_TestScenario.js Thu Dec  4 05:50:02 2008
@@ -0,0 +1,21 @@
+/*
+ * Test for the integrtion of our tests
+ *
+ * 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.
+ *
+ ******************************************************************************/
+
+/**
+ * a simple test function to wrap our testcases
+ * around
+ */
+
+function helloWorld() {
+    return "hello world";
+}