polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/3] polygene-java git commit: Fixing Restlet test app
Date Sat, 09 Dec 2017 05:50:59 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 8f8e8dc45 -> d7cee5055


Fixing Restlet test app


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

Branch: refs/heads/develop
Commit: 6339402b659f2ee8ce18c1e0c60235dcfcd33501
Parents: 8f8e8dc
Author: niclas <niclas@hedhman.org>
Authored: Fri Dec 8 13:52:21 2017 +0800
Committer: niclas <niclas@hedhman.org>
Committed: Fri Dec 8 13:52:21 2017 +0800

----------------------------------------------------------------------
 .../javaxjson/JavaxJsonAdapter.java             |  2 +-
 .../javaxjson/JavaxJsonAdapters.java            | 16 +++----
 .../javaxjson/JavaxJsonSerializer.java          |  4 +-
 .../javaxjson/CustomJsonAdapterTest.java        |  9 ++--
 libraries/restlet/dev-status.xml                |  2 +-
 .../polygene/library/restlet/OrdersModule.java  | 41 ------------------
 .../library/restlet/TestApplication.java        | 38 +++++++++++------
 .../assembly/RestApplicationAssembler.java      | 18 ++++----
 .../configuration/ConfigurationModule.java      |  1 +
 .../restlet/assembly/domain/CrudModule.java     |  1 +
 .../restlet/assembly/domain/DomainLayer.java    |  1 +
 .../restlet/assembly/domain/OrdersModule.java   | 44 ++++++++++++++++++++
 .../infrastructue/FileStorageModule.java        |  1 +
 .../assembly/infrastructue/IndexingModule.java  | 11 ++---
 .../infrastructue/InfrastructureLayer.java      |  3 +-
 15 files changed, 102 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapter.java
b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapter.java
index eaaa986..fe0a71e 100644
--- a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapter.java
+++ b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapter.java
@@ -42,7 +42,7 @@ public interface JavaxJsonAdapter<T>
      * @param serialize Serialization function for nested structure serialization
      * @return Serialized JSON representation
      */
-    JsonValue serialize( JavaxJsonFactories jsonFactories, Object object, Function<Object,
JsonValue> serialize );
+    JsonValue serialize( JavaxJsonFactories jsonFactories, T object, Function<Object,
JsonValue> serialize );
 
     /**
      * Deserialize.

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapters.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapters.java
b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapters.java
index 75359f2..dccf388 100644
--- a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapters.java
+++ b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonAdapters.java
@@ -120,7 +120,7 @@ public interface JavaxJsonAdapters
         private static abstract class ToJsonStringAdapter<T> implements JavaxJsonAdapter<T>
         {
             @Override
-            public JsonValue serialize( JavaxJsonFactories jsonFactories, Object object,
+            public JsonValue serialize( JavaxJsonFactories jsonFactories, T object,
                                         Function<Object, JsonValue> serialize )
             {
                 return jsonFactories.toJsonString( object );
@@ -158,7 +158,7 @@ public interface JavaxJsonAdapters
             public Class<Boolean> type() { return Boolean.class; }
 
             @Override
-            public JsonValue serialize( JavaxJsonFactories jsonFactories, Object object,
+            public JsonValue serialize( JavaxJsonFactories jsonFactories, Boolean object,
                                         Function<Object, JsonValue> serialize )
             {
                 return type().cast( object ) ? JsonValue.TRUE : JsonValue.FALSE;
@@ -192,7 +192,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Integer object, Function<Object, JsonValue>
serialize )
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )
@@ -225,7 +225,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Long object, Function<Object, JsonValue> serialize
)
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )
@@ -258,7 +258,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Short object, Function<Object, JsonValue> serialize
)
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )
@@ -291,7 +291,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Byte object, Function<Object, JsonValue> serialize
)
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )
@@ -324,7 +324,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Float object, Function<Object, JsonValue> serialize
)
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )
@@ -357,7 +357,7 @@ public interface JavaxJsonAdapters
 
             @Override
             public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                        Object object, Function<Object, JsonValue>
serialize )
+                                        Double object, Function<Object, JsonValue>
serialize )
             {
                 return jsonFactories.builderFactory().createObjectBuilder()
                                     .add( "value", type().cast( object ) )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
index 065e28b..17286f8 100644
--- a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
+++ b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
@@ -114,7 +114,7 @@ public class JavaxJsonSerializer extends AbstractTextSerializer
     }
 
     @SuppressWarnings( "unchecked" )
-    private JsonValue doSerialize( Options options, Object object, boolean root )
+    private <T> JsonValue doSerialize( Options options, T object, boolean root )
     {
         if( object == null )
         {
@@ -126,7 +126,7 @@ public class JavaxJsonSerializer extends AbstractTextSerializer
         {
             return doSerialize( options, converter.toString( object ), false );
         }
-        JavaxJsonAdapter<?> adapter = adapters.adapterFor( objectClass );
+        JavaxJsonAdapter<T> adapter = adapters.adapterFor( (Class<T>) objectClass
);
         if( adapter != null )
         {
             return adapter.serialize( jsonFactories, object, obj -> doSerialize( options,
obj, false ) );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/CustomJsonAdapterTest.java
----------------------------------------------------------------------
diff --git a/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/CustomJsonAdapterTest.java
b/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/CustomJsonAdapterTest.java
index 85db21e..a4c9ae7 100644
--- a/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/CustomJsonAdapterTest.java
+++ b/extensions/serialization-javaxjson/src/test/java/org/apache/polygene/serialization/javaxjson/CustomJsonAdapterTest.java
@@ -86,7 +86,7 @@ public class CustomJsonAdapterTest extends AbstractPolygeneTest
 
         @Override
         public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                    Object object, Function<Object, JsonValue> serialize
)
+                                    CustomValue object, Function<Object, JsonValue>
serialize )
         {
             return jsonFactories.toJsonString( type().cast( object ).state );
         }
@@ -111,12 +111,11 @@ public class CustomJsonAdapterTest extends AbstractPolygeneTest
 
         @Override
         public JsonValue serialize( JavaxJsonFactories jsonFactories,
-                                    Object object, Function<Object, JsonValue> serialize
)
+                                    CustomStructure object, Function<Object, JsonValue>
serialize )
         {
-            CustomStructure customStructure = type().cast( object );
             return jsonFactories.builderFactory().createObjectBuilder()
-                                .add( "foo", customStructure.foo )
-                                .add( "bar", serialize.apply( customStructure.bar ) )
+                                .add( "foo", object.foo )
+                                .add( "bar", serialize.apply( object.bar ) )
                                 .build();
         }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/dev-status.xml
----------------------------------------------------------------------
diff --git a/libraries/restlet/dev-status.xml b/libraries/restlet/dev-status.xml
index 66babc6..97fd7ff 100644
--- a/libraries/restlet/dev-status.xml
+++ b/libraries/restlet/dev-status.xml
@@ -30,7 +30,7 @@
     <documentation>brief</documentation>
 
     <!-- none, some, good, complete -->
-    <unittests>none</unittests>
+    <unittests>some</unittests>
   </status>
   <licenses>
     <license>ALv2</license>

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/OrdersModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/OrdersModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/OrdersModule.java
deleted file mode 100644
index 3b8b42a..0000000
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/OrdersModule.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  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 org.apache.polygene.library.restlet;
-
-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.library.restlet.assembly.RestletCrudModuleAssembler;
-
-public class OrdersModule
-    implements ModuleAssembler
-{
-    @Override
-    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
-        throws AssemblyException
-    {
-        new RestletCrudModuleAssembler( Order.class ).assemble( module );
-        new RestletCrudModuleAssembler( Customer.class ).assemble( module );
-        new RestletCrudModuleAssembler( Product.class ).assemble( module );
-        return module;
-    }
-}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/TestApplication.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/TestApplication.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/TestApplication.java
index 3b8fb2b..51d56b4 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/TestApplication.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/TestApplication.java
@@ -20,7 +20,14 @@
 
 package org.apache.polygene.library.restlet;
 
+import java.util.stream.Stream;
+import org.apache.polygene.api.common.Visibility;
+import org.apache.polygene.api.composite.ModelDescriptor;
 import org.apache.polygene.api.structure.Application;
+import org.apache.polygene.api.structure.Layer;
+import org.apache.polygene.api.structure.ModuleDescriptor;
+import org.apache.polygene.api.structure.TypeLookup;
+import org.apache.polygene.bootstrap.LayerAssembly;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.library.restlet.assembly.RestApplicationAssembler;
 import org.apache.polygene.library.restlet.assembly.configuration.ConfigurationModule;
@@ -31,6 +38,8 @@ import org.apache.polygene.library.restlet.assembly.infrastructue.FileStorageMod
 import org.apache.polygene.library.restlet.assembly.infrastructue.InfrastructureLayer;
 import org.apache.polygene.library.restlet.assembly.resource.ResourceLayer;
 
+import static java.util.stream.Stream.concat;
+
 // START SNIPPET: app
 public class TestApplication
 {
@@ -40,27 +49,32 @@ public class TestApplication
 
     // END SNIPPET: app
 
-
     public static void main( String[] args )
         throws Exception
     {
         RestApplicationAssembler assembler = new RestApplicationAssembler( NAME, VERSION,
MODE,
-                                                                           ConnectivityLayer.class,
-                                                                           ResourceLayer.class,
-                                                                           DomainLayer.class,
+                                                                           ConfigurationLayer.class,
                                                                            InfrastructureLayer.class,
-                                                                           ConfigurationLayer.class
+                                                                           DomainLayer.class,
+                                                                           ResourceLayer.class,
+                                                                           ConnectivityLayer.class
         );
 
         assembler.initialize();
+        assembler.application()
+                 .layers()
+                 .peek( layer -> System.out.println( layer + "  uses " + layer.descriptor().usedLayers().toString()
) )
+                 .flatMap( Layer::modules )
+                 .peek( module -> System.out.println( "  " + module ) )
+                 .flatMap( module -> {
+                     TypeLookup lookup = module.typeLookup();
+                     ModuleDescriptor model = module.descriptor();
+                     return concat( concat( lookup.allServices().filter( service -> model.equals(
service.module() ) ),
+                                            lookup.allEntities().filter( service -> model.equals(
service.module() ) ) ),
+                                    lookup.allValues().filter( service -> model.equals(
service.module() ) ) );
+                 } )
+                 .forEach( composite -> System.out.println( "    " + composite + ", visibility:"
+ composite.visibility().name() ) );
 
-        ModuleAssembly configModule = assembler.layer( ConfigurationLayer.class ).module(
ConfigurationModule.NAME );
-        assembler.layer( InfrastructureLayer.class,
-                         new FileStorageModule( configModule ) );
-
-        assembler.layer( DomainLayer.class,
-                         new OrdersModule()
-        );
         assembler.start();
         assembler.addShutdownHook();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/RestApplicationAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/RestApplicationAssembler.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/RestApplicationAssembler.java
index c520e75..e0a46d8 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/RestApplicationAssembler.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/RestApplicationAssembler.java
@@ -47,24 +47,20 @@ public class RestApplicationAssembler extends LayeredApplicationAssembler
     @Override
     protected void assembleLayers( ApplicationAssembly assembly )
     {
+        LayerAssembly layerBelow = null;
         for( Class<? extends LayerAssembler> layer : layers )
         {
             LayerAssembly layerAssembly = createLayer( layer );
             assemblies.put( layer, layerAssembly );
+            if( layerBelow != null )
+            {
+                layerAssembly.uses( layerBelow );
+            }
+            layerBelow = layerAssembly;
         }
     }
 
-    public void setupUses( BinaryOperator<LayerAssembly> uses )
-    {
-        assemblies.values().stream().reduce( uses );
-    }
-
-    public void setupUses()
-    {
-        assemblies.values().stream().reduce( LayerAssembly::uses );
-    }
-
-    public LayerAssembly layer( Class<? extends LayerAssembler> layerClass, ModuleAssembler...
assemblers )
+    public LayerAssembly layer( Class<? extends LayerAssembler> layerClass )
     {
         return assemblies.get( layerClass );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/configuration/ConfigurationModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/configuration/ConfigurationModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/configuration/ConfigurationModule.java
index dd65cfa..48ce3a9 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/configuration/ConfigurationModule.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/configuration/ConfigurationModule.java
@@ -30,6 +30,7 @@ public class ConfigurationModule
     implements ModuleAssembler
 {
     public static final String NAME = "Configuration Module";
+
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/CrudModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/CrudModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/CrudModule.java
index 769390b..8e79c0a 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/CrudModule.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/CrudModule.java
@@ -32,6 +32,7 @@ public class CrudModule
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
     {
+        module.defaultServices();
         new CrudServiceAssembler().assemble( module );
         return module;
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
index 9fe73f3..19bf91d 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/DomainLayer.java
@@ -32,6 +32,7 @@ public class DomainLayer extends LayeredLayerAssembler
     public LayerAssembly assemble( LayerAssembly layer )
     {
         createModule( layer, CrudModule.class );
+        createModule( layer, OrdersModule.class );
         return layer;
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/OrdersModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/OrdersModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/OrdersModule.java
new file mode 100644
index 0000000..6bbd79f
--- /dev/null
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/domain/OrdersModule.java
@@ -0,0 +1,44 @@
+/*
+ *  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 org.apache.polygene.library.restlet.assembly.domain;
+
+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.library.restlet.Customer;
+import org.apache.polygene.library.restlet.Order;
+import org.apache.polygene.library.restlet.Product;
+import org.apache.polygene.library.restlet.assembly.RestletCrudModuleAssembler;
+
+public class OrdersModule
+    implements ModuleAssembler
+{
+    @Override
+    public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
+        throws AssemblyException
+    {
+        new RestletCrudModuleAssembler( Order.class ).assemble( module );
+        new RestletCrudModuleAssembler( Customer.class ).assemble( module );
+        new RestletCrudModuleAssembler( Product.class ).assemble( module );
+        return module;
+    }
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/FileStorageModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/FileStorageModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/FileStorageModule.java
index 4d410f7..a1ac266 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/FileStorageModule.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/FileStorageModule.java
@@ -41,6 +41,7 @@ public class FileStorageModule
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
     {
+        module.defaultServices().visibleIn( Visibility.layer );
         new FileEntityStoreAssembler()
             .visibleIn( Visibility.application  )
             .withConfig( configModule, Visibility.application )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/IndexingModule.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/IndexingModule.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/IndexingModule.java
index 9977b93..72997f1 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/IndexingModule.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/IndexingModule.java
@@ -41,14 +41,9 @@ public class IndexingModule
     @Override
     public ModuleAssembly assemble( LayerAssembly layer, ModuleAssembly module )
     {
-//        new FileConfigurationAssembler().assemble( module );
-//        new ESFilesystemIndexQueryAssembler()
-//            .visibleIn( Visibility.application )
-//            .withConfig( configModule, Visibility.application )
-//            .assemble( module );
-
-        configModule.entities( NativeConfiguration.class ).visibleIn( Visibility.application
);
-        new RdfNativeSesameStoreAssembler(Visibility.application, Visibility.module).assemble(
module );
+        new RdfNativeSesameStoreAssembler(Visibility.application, Visibility.module)
+            .withConfig( configModule, Visibility.application )
+            .assemble( module );
         return module;
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/6339402b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
----------------------------------------------------------------------
diff --git a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
index 7d98ff3..ac6375f 100644
--- a/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
+++ b/libraries/restlet/src/test/java/org/apache/polygene/library/restlet/assembly/infrastructue/InfrastructureLayer.java
@@ -39,7 +39,7 @@ public class InfrastructureLayer extends LayeredLayerAssembler
         return new InfrastructureLayer( config );
     }
 
-    public InfrastructureLayer( ModuleAssembly configModule )
+    private InfrastructureLayer( ModuleAssembly configModule )
     {
         this.configModule = configModule;
     }
@@ -47,6 +47,7 @@ public class InfrastructureLayer extends LayeredLayerAssembler
     @Override
     public LayerAssembly assemble( LayerAssembly layer )
     {
+        new FileStorageModule( configModule ).assemble( layer, layer.module( FileStorageModule.NAME
) );
         new IndexingModule( configModule ).assemble( layer, layer.module( IndexingModule.NAME
) );
         new SerializationModule().assemble( layer, layer.module( SerializationModule.NAME
) );
         return layer;


Mime
View raw message