Repository: brooklyn-ui Updated Branches: refs/heads/master 7bd22baad -> 6ed340f86
Rollback version of jasmin-maven-plugin to 1.3.1.6 Due to 2.X requiring maven 3.1.0 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/874e310b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/874e310b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/874e310b Branch: refs/heads/master Commit: 874e310b8b711d1b753f97939bcc53093396f536 Parents: 7bd22ba Author: Mark McKenna <m4rkmcke...@gmail.com> Authored: Fri Mar 4 10:00:28 2016 +0000 Committer: Mark McKenna <m4rkmcke...@gmail.com> Committed: Fri Mar 4 10:00:28 2016 +0000 ---------------------------------------------------------------------- pom.xml | 12 +----- .../javascript/specs/model/application-spec.js | 39 +++++++++++++++----- .../specs/view/application-explorer-spec.js | 20 ++++++---- 3 files changed, 43 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/874e310b/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 53c88e3..d91bb2b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ ${project.build.directory}/${project.build.finalName} </project.build.webapp> <nodejs.path>${project.basedir}/target/nodejs/node</nodejs.path> - <jasmine-maven-plugin.version>2.1</jasmine-maven-plugin.version> + <jasmine-maven-plugin.version>1.3.1.6</jasmine-maven-plugin.version> <phantomjs.version>2.1.1</phantomjs.version> <maven-dependency-plugin.version>2.8</maven-dependency-plugin.version> <nodejs-maven-plugin.version>1.0.3</nodejs-maven-plugin.version> @@ -113,16 +113,6 @@ </execution> </executions> <configuration> - <!--Version of phantomjs needs to be specified for linux--> - <phantomjs> - <version>${phantomjs.version}</version> - <checkSystemPath>true</checkSystemPath> - <enforceVersion>true</enforceVersion> - <source>REPOSITORY</source> - <baseUrl/> - <outputDirectory>target/phantomjs</outputDirectory> - </phantomjs> - <!--Uses the require.js test spec--> <specRunnerTemplate>REQUIRE_JS</specRunnerTemplate> <preloadSources> http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/874e310b/src/test/javascript/specs/model/application-spec.js ---------------------------------------------------------------------- diff --git a/src/test/javascript/specs/model/application-spec.js b/src/test/javascript/specs/model/application-spec.js index dce9b06..17f2fac 100644 --- a/src/test/javascript/specs/model/application-spec.js +++ b/src/test/javascript/specs/model/application-spec.js @@ -15,19 +15,19 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ define([ "model/application", "model/entity" ], function (Application, Entity) { - $.ajaxSetup({ async:false }); + $.ajaxSetup({async: false}); describe('model/application Application model', function () { var application = new Application.Model(); application.url = 'fixtures/application.json'; - application.fetch({async:false}); + application.fetch({async: false}); it('loads all model properties defined in fixtures/application.json', function () { expect(application.get("status")).toEqual('STARTING'); @@ -56,10 +56,10 @@ define([ beforeEach(function () { spec = new Application.Spec; location = "/locations/2"; - entity = new Entity.Model({name:'test'}); + entity = new Entity.Model({name: 'test'}); spec.url = 'fixtures/application-spec.json'; - spec.fetch({async:false}); + spec.fetch({async: false}); }); it('loads the properties from fixtures/application-spec.json', function () { @@ -77,7 +77,12 @@ define([ }); it("triggers 'change' when we add a location", function () { - spyOn(spec, "trigger").and.callThrough(); + if (jasmine.version) {// If version > 2.0 + spyOn(spec, "trigger").and.callThrough(); + } else { + spyOn(spec, "trigger").andCallThrough(); + } + spec.addLocation(location); expect(spec.trigger).toHaveBeenCalled(); expect(spec.get("locations").length).toEqual(2); @@ -85,7 +90,12 @@ define([ it("triggers 'change' when we remove a location", function () { spec.addLocation(location); - spyOn(spec, "trigger").and.callThrough(); + if (jasmine.version) {// If version > 2.0 + spyOn(spec, "trigger").and.callThrough(); + } else { + spyOn(spec, "trigger").andCallThrough(); + } + spec.removeLocation('/invalid/location'); expect(spec.trigger).not.toHaveBeenCalled(); @@ -103,7 +113,11 @@ define([ }); it("triggers 'change' when you add an entity", function () { - spyOn(spec, "trigger").and.callThrough(); + if (jasmine.version) {// If version > 2.0 + spyOn(spec, "trigger").and.callThrough(); + } else { + spyOn(spec, "trigger").andCallThrough(); + } spec.removeEntityByName(entity.get("name")); expect(spec.trigger).not.toHaveBeenCalled(); spec.addEntity(entity); @@ -112,14 +126,19 @@ define([ it("triggers 'change' when you remove an entity", function () { spec.addEntity(entity); - spyOn(spec, "trigger").and.callThrough(); + if (jasmine.version) {// If version > 2.0 + spyOn(spec, "trigger").and.callThrough(); + } else { + spyOn(spec, "trigger").andCallThrough(); + } + spec.removeEntityByName(entity.get("name")); expect(spec.trigger).toHaveBeenCalled(); }); it('allows you to add the same entity twice', function () { var spec = new Application.Spec, - entity = new Entity.Model({ name:'test-entity'}); + entity = new Entity.Model({name: 'test-entity'}); spec.addEntity(entity); spec.addEntity(entity); expect(spec.get("entities").length).toEqual(2); http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/874e310b/src/test/javascript/specs/view/application-explorer-spec.js ---------------------------------------------------------------------- diff --git a/src/test/javascript/specs/view/application-explorer-spec.js b/src/test/javascript/specs/view/application-explorer-spec.js index 935d2dc..fb81446 100644 --- a/src/test/javascript/specs/view/application-explorer-spec.js +++ b/src/test/javascript/specs/view/application-explorer-spec.js @@ -15,7 +15,7 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ /** * Tests for application tree - view explorer. */ @@ -30,7 +30,7 @@ define([ var apps = new AppTree.Collection, view apps.url = 'fixtures/application-tree.json' - apps.fetch({async:false}) + apps.fetch({async: false}) var entityFetch, applicationFetch, defer; @@ -41,11 +41,12 @@ define([ entityFetch = EntitySummary.Model.prototype.fetch; applicationFetch = Application.Model.prototype.fetch; defer = _.defer; - _.defer = EntitySummary.Model.prototype.fetch = Application.Model.prototype.fetch = function() {}; - view = new ApplicationExplorerView({ collection:apps }).render() + _.defer = EntitySummary.Model.prototype.fetch = Application.Model.prototype.fetch = function () { + }; + view = new ApplicationExplorerView({collection: apps}).render() }) - afterEach(function() { + afterEach(function () { EntitySummary.Model.prototype.fetch = entityFetch; Application.Model.prototype.fetch = applicationFetch; _.defer = defer; @@ -68,12 +69,17 @@ define([ }) it("triggers collection fetch on application refresh", function (done) { - spyOn(apps, "fetch").and.callThrough(); + if (jasmine.version) { // If version > 2.0 + spyOn(apps, "fetch").and.callThrough(); + } else { + spyOn(apps, "fetch").andCallThrough(); + } + view.$(".application-tree-refresh").trigger("click"); setTimeout(function () { expect(view.collection.fetch).toHaveBeenCalled(); done(); - },100); + }, 100); }); }) })