Author: erinnp
Date: Tue Jun 25 21:18:35 2013
New Revision: 1496640

URL: http://svn.apache.org/r1496640
Log:
Setup Jasmine to run with requirejs

Modified:
    rave/branches/require/rave-portal-resources/pom.xml
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/app.js
    
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/main.js
    
rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js
    rave/branches/require/rave-portal/pom.xml

Modified: rave/branches/require/rave-portal-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/pom.xml?rev=1496640&r1=1496639&r2=1496640&view=diff
==============================================================================
--- rave/branches/require/rave-portal-resources/pom.xml (original)
+++ rave/branches/require/rave-portal-resources/pom.xml Tue Jun 25 21:18:35 2013
@@ -113,28 +113,37 @@
                             <goal>bdd</goal>
                             <goal>test</goal>
                         </goals>
-                        <configuration>
-                            <preloadSources>
-                                
<source>${project.basedir}/src/test/dependencies/underscore.js</source>
-                            </preloadSources>
-                            
<jsSrcDir>${project.basedir}/src/main/webapp/static/script/core</jsSrcDir>
-                            <debug>true</debug>
-                            <sourceIncludes>
-                                <include>rave_widget_manager.js</include>
-                                <include>rave_api.js</include>
-                                <include>rave_widget.js</include>
-                                <include>rave_opensocial.js</include>
-                                <include>rave_wookie.js</include>
-                            </sourceIncludes>
-                            <sourceExcludes>
-                                <!-- rave_ajax can be excluded since it is 
just a wrapper for jquery.ajax -->
-                                <include>rave_ajax.js</include>
-                                <!-- exclude the combined js file from our 
tests, created by the wro4j plugin  -->
-                                <exclude>*.min.js</exclude>
-                            </sourceExcludes>
-                        </configuration>
+                        <!--<configuration>-->
+                            <!--<preloadSources>-->
+                                
<!--<source>${project.basedir}/src/test/dependencies/underscore.js</source>-->
+                            <!--</preloadSources>-->
+                            
<!--<jsSrcDir>${project.basedir}/src/main/webapp/static/script/core</jsSrcDir>-->
+                            <!--<debug>true</debug>-->
+                            <!--<sourceIncludes>-->
+                                
<!--<include>rave_widget_manager.js</include>-->
+                                <!--<include>rave_api.js</include>-->
+                                <!--<include>rave_widget.js</include>-->
+                                <!--<include>rave_opensocial.js</include>-->
+                                <!--<include>rave_wookie.js</include>-->
+                            <!--</sourceIncludes>-->
+                            <!--<sourceExcludes>-->
+                                <!--&lt;!&ndash; rave_ajax can be excluded 
since it is just a wrapper for jquery.ajax &ndash;&gt;-->
+                                <!--<include>rave_ajax.js</include>-->
+                                <!--&lt;!&ndash; exclude the combined js file 
from our tests, created by the wro4j plugin  &ndash;&gt;-->
+                                <!--<exclude>*.min.js</exclude>-->
+                            <!--</sourceExcludes>-->
+                        <!--</configuration>-->
                     </execution>
                 </executions>
+                <configuration>
+                    <specRunnerTemplate>REQUIRE_JS</specRunnerTemplate>
+                    
<jsSrcDir>${project.basedir}/src/main/webapp/static/script/core</jsSrcDir>
+                    
<jsTestSrcDir>${project.basedir}/src/test/javascript</jsTestSrcDir>
+                    
<customRunnerConfiguration>${project.basedir}/src/test/customJasmineConfig.txt</customRunnerConfiguration>
+                    <preloadSources>
+                        
<source>${project.basedir}/src/test/dependencies/require.js</source>
+                    </preloadSources>
+                </configuration>
             </plugin>
             <!--
                wro4j maven plugin is used for optimization (concatenation, 
minification, etc) of our static resources

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/app.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/app.js?rev=1496640&r1=1496639&r2=1496640&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/app.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/app.js
 Tue Jun 25 21:18:35 2013
@@ -62,8 +62,34 @@ requirejs.config({
         jqueryTouchPouch:{
             deps:['jquery']
         },
-        underscore: {
-            exports: '_'
+        bootstrap:{
+            deps:['jquery']
+        },
+        jqueryTouchPouch:{
+            deps:['jquery']
+        },
+        jqueryTouchPouch:{
+            deps:['jquery']
+        },
+        bootstrap:{
+            deps:['jquery']
         }
-    }
-});
\ No newline at end of file
+    },
+    "paths":{
+        "core": "./core",
+        "portal": "./portal",
+        "event_bindings": "./portal",
+        "jquery": "//ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.min",
+        "underscore": 
"//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min",
+        
"handlebars":"//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.2/handlebars.min",
+        
"backbone":"//cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.10/backbone-min",
+        
"osapi":"/gadgets/js/container:pubsub-2:open-views.js?c=1&container=default&debug=1",
+        "jqueryUi":"//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min",
+        
"jqueryValidate":"//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min",
+        
"jqueryHashChange":'//cdnjs.cloudflare.com/ajax/libs/jquery-hashchange/v1.3/jquery.ba-hashchange.min',
+        "jqueryTouchPouch": 
'//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min',
+        "bootstrap": 
'//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min'
+}
+})
+
+requirejs(["core/main"]);

Modified: 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/main.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/main.js?rev=1496640&r1=1496639&r2=1496640&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/main.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/main/webapp/static/script/core/main.js
 Tue Jun 25 21:18:35 2013
@@ -17,20 +17,5 @@
  * under the License.
  */
 
-define(['underscore', 'core/rave_widget_manager', 'core/rave_api', 
'core/rave_widget', 'core/rave_log',
-    'core/rave_event_manager', 'core/rave_view_manager', 
'core/rave_state_manager'],
-    function (_, widgetManager, api, RegionWidget, log, eventManager, 
viewManager, stateManager) {
-
-        var rave = {};
-
-        rave.api = api;
-        rave.RegionWidget = RegionWidget;
-        rave.log = log;
-        _.extend(rave, eventManager);
-        _.extend(rave, viewManager);
-        _.extend(rave, widgetManager);
-        _.extend(rave, stateManager);
-
-        return rave;
-    }
-)
+             console.log("in main");
+})

Modified: 
rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js?rev=1496640&r1=1496639&r2=1496640&view=diff
==============================================================================
--- 
rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js
 (original)
+++ 
rave/branches/require/rave-portal-resources/src/test/javascript/rave_api_spec.js
 Tue Jun 25 21:18:35 2013
@@ -15,18 +15,20 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *//*
-
+ *
+ */
+define([], function() {
+    describe("example.hello", function() {
+        it("simple test", function() {
+            expect(1).toBe(1);
+        });
+    });
+});
+/*
 
 describe('Rave API', function () {
-
     var testScope;
 
-    */
-/*
-    Start stubs
-     *//*
-
     //TODO: there are several bad dependencies in rave_api on portal 
functionality - stub the calls until I can fix
     rave.getClientMessage = function () {
     };
@@ -48,11 +50,6 @@ describe('Rave API', function () {
             }
         }
     }
-    */
-/*
-     End stubs
-     *//*
-
 
     beforeEach(function () {
         rave.ajax = function (args) {
@@ -637,4 +634,5 @@ describe('Rave API', function () {
             });
         });
     });
-});*/
+});
+*/

Modified: rave/branches/require/rave-portal/pom.xml
URL: 
http://svn.apache.org/viewvc/rave/branches/require/rave-portal/pom.xml?rev=1496640&r1=1496639&r2=1496640&view=diff
==============================================================================
--- rave/branches/require/rave-portal/pom.xml (original)
+++ rave/branches/require/rave-portal/pom.xml Tue Jun 25 21:18:35 2013
@@ -189,7 +189,7 @@
                             
cargo.datasource.password=${shindig.dataSource.password}
                           </cargo.datasource.datasource.shindigDB>
                             <cargo.jvmargs>
-                                <![CDATA[-Dh2.bindAddress="localhost" -Xdebug 
-XX:MaxPermSize=256m 
-Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend}
 -noverify ${javaagent} ${cargo.args}]]>
+                                
<![CDATA[-Dhttp.proxyHost="gatekeeper.mitre.org" -Dhttp.proxyPort=80 
-Dhttp.nonProxyHosts="*.mitre.org|127.0.0.1|localhost" 
-Dh2.bindAddress="localhost" -Xdebug -XX:MaxPermSize=256m 
-Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend}
 -noverify ${javaagent} ${cargo.args}]]>
                             </cargo.jvmargs>
                             
<cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
                         </properties>


Reply via email to