You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by mf...@apache.org on 2012/04/16 23:03:54 UTC
svn commit: r1326800 - in /rave/trunk/rave-portal-resources/src:
main/webapp/script/rave.js test/javascript/raveOpenSocialSpec.js
test/javascript/raveSpec.js
Author: mfranklin
Date: Mon Apr 16 21:03:53 2012
New Revision: 1326800
URL: http://svn.apache.org/viewvc?rev=1326800&view=rev
Log:
Fixed build
Modified:
rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
rave/trunk/rave-portal-resources/src/test/javascript/raveOpenSocialSpec.js
rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js
Modified: rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js?rev=1326800&r1=1326799&r2=1326800&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js Mon Apr 16 21:03:53 2012
@@ -777,6 +777,10 @@ var rave = rave || (function() {
return openAjaxHub;
}
+ function resetOpenAjaxHubInstance() {
+ openAjaxHub = null;
+ }
+
function initializeWidgets(widgetsByRegionIdMap) {
//We get the widget objects in a map keyed by region ID. The code below converts that map into a flat array
//of widgets with all the top widgets in each region first, then the seconds widgets in each region, then the
@@ -1128,6 +1132,11 @@ var rave = rave || (function() {
getManagedHub: getOpenAjaxHubInstance,
/**
+ * Resets the managed hub
+ */
+ resetManagedHub: resetOpenAjaxHubInstance,
+
+ /**
* Logs a message to a central logging facility (console by default)
*
* @param message the message to log
Modified: rave/trunk/rave-portal-resources/src/test/javascript/raveOpenSocialSpec.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/test/javascript/raveOpenSocialSpec.js?rev=1326800&r1=1326799&r2=1326800&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/test/javascript/raveOpenSocialSpec.js (original)
+++ rave/trunk/rave-portal-resources/src/test/javascript/raveOpenSocialSpec.js Mon Apr 16 21:03:53 2012
@@ -60,6 +60,22 @@ describe("Rave OpenSocial", function() {
}
}})();
+ OpenAjax = (function () {
+ var cArgs;
+ return{
+ hub:{
+ ManagedHub:function (args) {
+ cArgs = args;
+ return {
+
+ }
+ },
+ getArgs:function () {
+ return cArgs;
+ }
+ }
+ }
+ })();
});
Modified: rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js?rev=1326800&r1=1326799&r2=1326800&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js (original)
+++ rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js Mon Apr 16 21:03:53 2012
@@ -690,25 +690,27 @@ describe("Rave", function() {
describe("getManagedHub", function(){
beforeEach(function(){
- OpenAjax = (function(){
- var cArgs;
+ rave.resetManagedHub();
+ OpenAjax = (function () {
return{
- hub: {
- ManagedHub: function(args){
- cArgs=args;
+ hub:{
+ ManagedHub:function (args) {
+ var cArgs = args;
return {
-
+ getArgs:function () {
+ return cArgs;
+ }
}
- },
- getArgs: function() {return cArgs;}
+ }
}
}
})();
});
+
it("throws an error if there is no OpenAjax code on the page", function(){
delete OpenAjax;
- expect(rave.getManagedHub()).toThrow(new Error("No implementation of OpenAjax found. " +
+ expect(rave.getManagedHub).toThrow(new Error("No implementation of OpenAjax found. " +
"Please ensure that an implementation has been included in the page."));
});
@@ -720,7 +722,7 @@ describe("Rave", function() {
});
it("initializes the hub properly", function(){
- var args = OpenAjax.hub.getArgs();
+ var args = rave.getManagedHub().getArgs();
expect(args.onSubscribe).toBeDefined();
expect(args.onUnsubscribe).toBeDefined();
expect(args.onPublish).toBeDefined();