polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject polygene-java git commit: :tools:generator Add empty test to generated rest-api application
Date Sun, 21 May 2017 15:29:22 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 779cffbc6 -> 84a794d29


:tools:generator Add empty test to generated rest-api application

See tools/generator-polygene/app/templates/RestAPIApplication/bootstrap-test.tmpl

The generator tests now run ./gradlew check instead of ./gradlew classes on generated projects


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/84a794d2
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/84a794d2
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/84a794d2

Branch: refs/heads/develop
Commit: 84a794d29669aa939ac951bcc42e452d427dde99
Parents: 779cffb
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun May 21 17:29:02 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun May 21 17:29:02 2017 +0200

----------------------------------------------------------------------
 .../app/templates/RestAPIApplication/app.js     |  4 +++
 .../RestAPIApplication/bootstrap-test.tmpl      | 30 ++++++++++++++++++++
 .../app/templates/buildtool/gradle-app.tmpl     |  1 +
 tools/generator-polygene/test/generator_test.js |  2 +-
 4 files changed, 36 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/84a794d2/tools/generator-polygene/app/templates/RestAPIApplication/app.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/RestAPIApplication/app.js b/tools/generator-polygene/app/templates/RestAPIApplication/app.js
index 80380c7..1ad28d8 100644
--- a/tools/generator-polygene/app/templates/RestAPIApplication/app.js
+++ b/tools/generator-polygene/app/templates/RestAPIApplication/app.js
@@ -27,6 +27,10 @@ module.exports = {
         p.copyTemplate(p.ctx,
             'RestAPIApplication/web.xml.tmpl',
             'app/src/main/webapp/WEB-INF/web.xml');
+
+        p.copyTemplate(p.ctx,
+            'RestAPIApplication/bootstrap-test.tmpl',
+            'app/src/test/java/'+p.javaPackageDir+'/BootstrapTest.java');
     }
 };
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/84a794d2/tools/generator-polygene/app/templates/RestAPIApplication/bootstrap-test.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/RestAPIApplication/bootstrap-test.tmpl
b/tools/generator-polygene/app/templates/RestAPIApplication/bootstrap-test.tmpl
new file mode 100644
index 0000000..19ccf9d
--- /dev/null
+++ b/tools/generator-polygene/app/templates/RestAPIApplication/bootstrap-test.tmpl
@@ -0,0 +1,30 @@
+<%#
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ *
+ *
+-%>
+package <%= polygene.packageName %>.bootstrap;
+
+import org.junit.Test;
+
+public class BootstrapTest
+{
+    @Test
+    public void applicationBootstrapSucceeds() {
+        // TODO Assemble, activate, passivate application to make sure it starts properly
+    }
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/84a794d2/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
index 623ee78..50f99c3 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
@@ -39,4 +39,5 @@ dependencies {
   runtime "org.apache.polygene.core:org.apache.polygene.core.runtime:$polygeneVersion"
   runtime "org.restlet.jee:org.restlet.ext.servlet:2.3.4"
 
+  testImplementation "org.apache.polygene.core:org.apache.polygene.core.testsupport:$polygeneVersion"
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/84a794d2/tools/generator-polygene/test/generator_test.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/test/generator_test.js b/tools/generator-polygene/test/generator_test.js
index 6589ef4..0702979 100644
--- a/tools/generator-polygene/test/generator_test.js
+++ b/tools/generator-polygene/test/generator_test.js
@@ -169,5 +169,5 @@ function test(appType, entityStore, indexing, serialization, caching,
metrics, f
 
 function buildAndVerify(dir) {
     assert.file(['gradlew', 'settings.gradle', 'build.gradle']);
-    assert(shell.exec(path.join(dir, 'gradlew') + ' classes --init-script ../../stagedMavenRepoInitScript.gradle').code
== 0);
+    assert(shell.exec(path.join(dir, 'gradlew') + ' check --init-script ../../stagedMavenRepoInitScript.gradle').code
== 0);
 }


Mime
View raw message