polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [2/2] polygene-java git commit: :tools:generator always use JSON serialization
Date Mon, 05 Jun 2017 16:41:24 GMT
:tools:generator always use JSON serialization


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

Branch: refs/heads/develop
Commit: 833bc8e8afb89a1dd7472ac6427a8135a8614900
Parents: 275ea22
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon Jun 5 18:41:13 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon Jun 5 18:41:13 2017 +0200

----------------------------------------------------------------------
 tools/generator-polygene/app/index.js           | 13 -------
 .../SerializationModule/bootstrap.tmpl          | 10 +++---
 .../SerializationModule/module.js               |  2 +-
 .../InfrastructureLayer/bootstrap.tmpl          |  2 +-
 .../app/templates/buildtool/gradle-app.tmpl     |  2 +-
 .../templates/buildtool/gradle-bootstrap.tmpl   |  2 +-
 tools/generator-polygene/test/generator_test.js | 38 +++++++-------------
 7 files changed, 20 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/tools/generator-polygene/app/index.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/index.js b/tools/generator-polygene/app/index.js
index b933c27..80feb55 100644
--- a/tools/generator-polygene/app/index.js
+++ b/tools/generator-polygene/app/index.js
@@ -65,7 +65,6 @@ module.exports = generators.Base.extend(
                 polygene.indexing = polygene.indexing ? polygene.indexing : null;
                 polygene.entitystore = polygene.entitystore ? polygene.entitystore : null;
                 polygene.caching = polygene.caching ? polygene.caching : null;
-                polygene.serialization = polygene.serialization ? polygene.serialization
: null;
             }
         },
 
@@ -162,17 +161,6 @@ module.exports = generators.Base.extend(
                         },
                         {
                             type: 'list',
-                            name: 'serialization',
-                            choices: [
-                                'JavaxJson',
-                                'JavaxXml',
-                                'MessagePack'
-                            ],
-                            message: 'Which serialization system do you want to use?',
-                            default: polygene.serialization ? polygene.serialization : "JavaxJson"
-                        },
-                        {
-                            type: 'list',
                             name: 'metrics',
                             choices: [
                                 'None',
@@ -206,7 +194,6 @@ module.exports = generators.Base.extend(
                         this.log('Entity Stores:', answers.entitystore);
                         this.log('Indexing:', answers.indexing);
                         this.log('Caching:', answers.caching);
-                        this.log('Serialization:', answers.serialization);
                         this.log('Features:', answers.features);
                         answers.dbpool = answers.dbpool === undefined ? "DBCP" : answers.dbpool;
                         polygene = answers;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/bootstrap.tmpl
b/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/bootstrap.tmpl
index 7ff8b96..c60530c 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/bootstrap.tmpl
@@ -20,22 +20,20 @@
 package <%= polygene.packageName %>.bootstrap.infrastructure;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.bootstrap.layered.ModuleAssembler;
-import org.apache.polygene.serialization.<%- polygene.serialization.toLowerCase() %>.assembly.<%-
polygene.serialization %>SerializationAssembler;
+import org.apache.polygene.serialization.javaxjson.assembly.JavaxJsonSerializationAssembler;
 
-public class <%- polygene.serialization %>SerializationModule
+public class SerializationModule
     implements ModuleAssembler
 {
-    public static final String NAME = "<%- polygene.serialization %> Serialization
Module";
+    public static final String NAME = "Serialization Module";
 
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
-        throws AssemblyException
     {
-        new <%- polygene.serialization %>SerializationAssembler()
+        new JavaxJsonSerializationAssembler()
             .visibleIn( Visibility.application )
             .assemble( module );
         return module;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/module.js
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/module.js
b/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/module.js
index 6afd62e..c6f82ef 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/module.js
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/SerializationModule/module.js
@@ -21,6 +21,6 @@ module.exports = {
     write: function (p) {
         p.copyTemplate(p.ctx,
             'InfrastructureLayer/SerializationModule/bootstrap.tmpl',
-            'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/infrastructure/'
+ p.serialization + 'SerializationModule.java');
+            'bootstrap/src/main/java/' + p.javaPackageDir + '/bootstrap/infrastructure/SerializationModule.java');
     }
 };

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl b/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
index 74bec0b..85efa4f 100644
--- a/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/InfrastructureLayer/bootstrap.tmpl
@@ -41,7 +41,7 @@ public class InfrastructureLayer extends LayeredLayerAssembler
         throws AssemblyException
     {
         createModule( layer, FileConfigurationModule.class );
-        createModule( layer, <%= polygene.serialization %>SerializationModule.class
);
+        createModule( layer, SerializationModule.class );
         createModule( layer, <%= polygene.metrics %>MetricsModule.class );
 <% if( polygene.caching !== "None" ) {
 %>        createModule( layer, <%= polygene.caching %>CachingModule.class, configModule
);

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/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 14b3510..ad707f2 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-app.tmpl
@@ -55,7 +55,7 @@ if( hasFeature( 'security' ) ) {
 
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.entitystore-<%=
polygene.entitystoremodule.toLowerCase() %>:$polygeneVersion"
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.indexing-<%=
polygene.indexing.toLowerCase() %>:$polygeneVersion"
-  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-<%=
polygene.serialization.toLowerCase() %>:$polygeneVersion"
+  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-javaxjson:$polygeneVersion"
 <%
 if( polygene.caching !== "None" ) {
 %>  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.cache-<%=
polygene.caching.toLowerCase() %>:$polygeneVersion"

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
index a8d499c..051cc29 100644
--- a/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/buildtool/gradle-bootstrap.tmpl
@@ -45,7 +45,7 @@ if( polygene.entitystore.indexOf('SQL') >= 0 || polygene.indexing ===
'SQL' ) {
 %>
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.entitystore-<%=
polygene.entitystoremodule.toLowerCase() %>:$polygeneVersion"
   implementation "org.apache.polygene.extensions:org.apache.polygene.extension.indexing-<%=
polygene.indexing.toLowerCase() %>:$polygeneVersion"
-  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-<%=
polygene.serialization.toLowerCase() %>:$polygeneVersion"
+  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.serialization-javaxjson:$polygeneVersion"
 <%
 if( polygene.caching !== "None" ) {
 %>  implementation "org.apache.polygene.extensions:org.apache.polygene.extension.cache-<%=
polygene.caching.toLowerCase() %>:$polygeneVersion"

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/833bc8e8/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 a5c2874..b151e98 100644
--- a/tools/generator-polygene/test/generator_test.js
+++ b/tools/generator-polygene/test/generator_test.js
@@ -64,12 +64,6 @@ var cachings = [
     'EhCache'
 ];
 
-var serializations = [
-    'JavaxJson',
-    'JavaxXml',
-    'MessagePack'
-];
-
 var metricses = [
     'None',
     'Codahale'
@@ -87,44 +81,38 @@ var featuresset = [
 ];
 
 appTypes.forEach(function (appType) {
-    test(appType, "Memory", "Rdf", "JavaxJson", "Memcache", "Codahale", "[]");
+    test(appType, "Memory", "Rdf", "Memcache", "Codahale", "[]");
 });
 
 entityStores.forEach(function (entityStore) {
-    test("Rest API", entityStore, "Rdf", "JavaxJson", "Memcache", "Codahale", "[]");
+    test("Rest API", entityStore, "Rdf", "Memcache", "Codahale", "[]");
 });
 
 indexings.forEach(function (indexing) {
-    test("Rest API", "Memory", indexing, "JavaxJson", "Memcache", "Codahale", "[]");
-});
-
-serializations.forEach(function (serialization) {
-    test("Rest API", "Memory", "Rdf", serialization, "Memcache", "Codahale", "[]");
+    test("Rest API", "Memory", indexing, "Memcache", "Codahale", "[]");
 });
 
 cachings.forEach(function (caching) {
-    test("Rest API", "Memory", "Rdf", "JavaxJson", caching, "Codahale", "[]");
+    test("Rest API", "Memory", "Rdf", caching, "Codahale", "[]");
 });
 
 metricses.forEach(function (metrics) {
-    test("Rest API", "Memory", "Rdf", "JavaxJson", "Memcache", metrics, "[]");
+    test("Rest API", "Memory", "Rdf", "Memcache", metrics, "[]");
 });
 
 featuresset.forEach(function (feature) {
-    test("Rest API", "Memory", "Rdf", "JavaxJson", "Memcache", "Codahale", feature);
+    test("Rest API", "Memory", "Rdf", "Memcache", "Codahale", feature);
 });
 
 // All Tests !!!!
-if(process.env.TEST_ALL == 'yes') {
+if(process.env.TEST_ALL === 'yes') {
     appTypes.forEach(function (appType) {
         entityStores.forEach(function (entitystore) {
             indexings.forEach(function (indexing) {
-                serializations.forEach(function (serialization) {
-                    cachings.forEach(function (caching) {
-                        metricses.forEach(function (metrics) {
-                            featuresset.forEach(function (features) {
-                                test(appType, entitystore, indexing, serialization, caching,
metrics, features)
-                            });
+                cachings.forEach(function (caching) {
+                    metricses.forEach(function (metrics) {
+                        featuresset.forEach(function (features) {
+                            test(appType, entitystore, indexing, caching, metrics, features)
                         });
                     });
                 });
@@ -133,12 +121,11 @@ if(process.env.TEST_ALL == 'yes') {
     });
 }
 
-function test(appType, entityStore, indexing, serialization, caching, metrics, features)
{
+function test(appType, entityStore, indexing, caching, metrics, features) {
     describe('polygene-generator', function () {
         var testName = appType + ' with '
             + entityStore + ' EntityStore - '
             + indexing + ' Indexing - '
-            + serialization + ' Serialization - '
             + caching + ' Caching - '
             + metrics + ' Metrics';
         if(features && features.length > 0) {
@@ -155,7 +142,6 @@ function test(appType, entityStore, indexing, serialization, caching,
metrics, f
                         packageName: 'org.apache.polygene.generator.test',
                         applicationtype: appType,
                         entitystore: entityStore,
-                        serialization: serialization,
                         indexing: indexing,
                         caching: caching,
                         metrics: metrics,


Mime
View raw message