From 44d8e1f35254c10fa7adda4e06d557a9a5ab5973 Mon Sep 17 00:00:00 2001 From: Andy Berry Date: Thu, 19 Jun 2014 10:51:59 +0100 Subject: [PATCH] adding thirdparty library template ready when for #743 is fixed --- .../org/bladerunnerjs/spec/template/TemplateTests.java | 2 +- .../templates/thirdpartyassetlocation-template/@lib.js | 9 +++++++++ .../tests/test-unit/js-test-driver/jsTestDriver.conf | 8 ++++++++ .../tests/test-unit/js-test-driver/tests/@libTest.js | 8 ++++++++ .../thirdparty-lib.manifest | 4 ++++ 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/@lib.js create mode 100644 cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/jsTestDriver.conf create mode 100644 cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/tests/@libTest.js create mode 100644 cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/thirdparty-lib.manifest diff --git a/brjs-core/src/test/java/org/bladerunnerjs/spec/template/TemplateTests.java b/brjs-core/src/test/java/org/bladerunnerjs/spec/template/TemplateTests.java index 079a4ddd6..8268e9d47 100644 --- a/brjs-core/src/test/java/org/bladerunnerjs/spec/template/TemplateTests.java +++ b/brjs-core/src/test/java/org/bladerunnerjs/spec/template/TemplateTests.java @@ -136,7 +136,7 @@ public void brLibHasCorrectTemplate() throws Exception { .and(userLib).fileContentsContains("src/userlib/Userlib.js", "var Userlib = {}"); } - @Test + @Test //TODO: thrirdparty libraries should have an improved template - the template exists, but the command doesnt use it when creating thirdparty libraries public void thirdpartyLibHasCorrectTemplate() throws Exception { given(brjs).commandHasBeenRun("create-app", "app", "appns"); when(brjs).runCommand("create-library", "app", "thirdpartyLib", "-t", "thirdparty"); diff --git a/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/@lib.js b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/@lib.js new file mode 100644 index 000000000..bf3dc2a7b --- /dev/null +++ b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/@lib.js @@ -0,0 +1,9 @@ +"use strict"; + +var @lib = {} + +@lib.helloWorldUtil = function() { + return "Hello World!"; +} + +window.@lib = @lib; diff --git a/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/jsTestDriver.conf b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/jsTestDriver.conf new file mode 100644 index 000000000..2d250ab55 --- /dev/null +++ b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/jsTestDriver.conf @@ -0,0 +1,8 @@ +server: http://localhost:4224 +basepath: . + +load: + - bundles/js/js.bundle + +test: + - tests/**.js diff --git a/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/tests/@libTest.js b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/tests/@libTest.js new file mode 100644 index 000000000..91ed36f0a --- /dev/null +++ b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/tests/test-unit/js-test-driver/tests/@libTest.js @@ -0,0 +1,8 @@ +ExampleClassTest = TestCase("ExampleClassTest"); + +var @lib = require("@lib"); + +ExampleClassTest.prototype.testHelloWorldUtil = function() +{ + assertEquals( "Hello World!", @lib.helloWorldUtil() ); +}; diff --git a/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/thirdparty-lib.manifest b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/thirdparty-lib.manifest new file mode 100644 index 000000000..bd8a48ab5 --- /dev/null +++ b/cutlass-sdk/build-resources/includes/sdk/templates/thirdpartyassetlocation-template/thirdparty-lib.manifest @@ -0,0 +1,4 @@ +css: +depends: +exports: @lib +js: