cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [21/30] cayenne git commit: CAY-2377. Cleanup cayenne-client
Date Thu, 07 Dec 2017 10:09:50 GMT
CAY-2377. Cleanup cayenne-client


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/2849f5c8
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/2849f5c8
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/2849f5c8

Branch: refs/heads/master
Commit: 2849f5c8eef3046c40a234a709d2536981b4b97e
Parents: ad9d934
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Tue Nov 14 09:28:57 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Nov 15 10:27:48 2017 +0300

----------------------------------------------------------------------
 .../rop/client/ClientLocalRuntime.java          | 78 --------------------
 .../configuration/rop/client/ClientModule.java  | 26 -------
 .../configuration/rop/client/ClientRuntime.java | 49 ------------
 .../rop/client/ClientRuntimeBuilder.java        |  2 +-
 .../rop/client/ClientModuleTest.java            | 51 +------------
 .../rop/client/ClientRuntimeBuilderTest.java    | 59 ++++++++++++++-
 .../rop/client/ClientRuntimeTest.java           | 77 ++++---------------
 docs/doc/src/main/resources/UPGRADE.txt         |  5 ++
 .../apache/cayenne/tutorial/Http2Client.java    |  9 ++-
 .../tutorial/persistent/client/Main.java        |  4 +-
 10 files changed, 88 insertions(+), 272 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientLocalRuntime.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientLocalRuntime.java
b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientLocalRuntime.java
deleted file mode 100644
index 3f089d1..0000000
--- a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientLocalRuntime.java
+++ /dev/null
@@ -1,78 +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.cayenne.configuration.rop.client;
-
-import org.apache.cayenne.DataChannel;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.di.Key;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.remote.ClientConnection;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import static java.util.Arrays.asList;
-
-/**
- * A {@link ClientRuntime} that provides an ROP stack based on a local
- * connection on top of a server stack.
- *
- * @since 3.1
- * @deprecated since 4.0, use {@link ClientRuntimeBuilder#local(Injector)}
- */
-@Deprecated
-public class ClientLocalRuntime extends ClientRuntime {
-
-    /**
-     * @since 4.0 moved to {@link ClientRuntime#CLIENT_SERVER_CHANNEL_KEY}
-     */
-    public static final String CLIENT_SERVER_CHANNEL_KEY = "client-server-channel";
-
-    private static Collection<Module> collectModules(
-            Injector serverInjector,
-            Module... extraModules) {
-
-        Collection<Module> modules = extraModules != null ? asList(extraModules) :
Collections.<Module>emptyList();
-        return collectModules(serverInjector, modules);
-    }
-
-    private static Collection<Module> collectModules(final Injector serverInjector,
Collection<Module> extraModules) {
-
-        Collection<Module> modules = new ArrayList<>(extraModules.size() + 1);
-        modules.add(binder -> {
-            binder.bind(Key.get(DataChannel.class, ClientRuntime.CLIENT_SERVER_CHANNEL_KEY)).toProviderInstance(
-                    new LocalClientServerChannelProvider(serverInjector));
-            binder.bind(ClientConnection.class).toProviderInstance(new LocalConnectionProvider());
-        });
-
-        modules.addAll(extraModules);
-        return modules;
-    }
-
-    public ClientLocalRuntime(Injector serverInjector, Map<String, String> properties,
Collection<Module> extraModules) {
-        super(properties, collectModules(serverInjector, extraModules));
-    }
-
-    public ClientLocalRuntime(Injector serverInjector, Map<String, String> properties,
Module... extraModules) {
-        super(properties, collectModules(serverInjector, extraModules));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
index 690ed2c..8e51fe7 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientModule.java
@@ -46,26 +46,6 @@ import org.apache.cayenne.rop.http.ClientHessianSerializationServiceProvider;
 public class ClientModule implements Module {
 
     /**
-     * @deprecated since 4.0 in favour of {@link ClientRuntimeBuilder}
-     * @see ClientRuntimeBuilder#properties(Map)
-     */
-    @Deprecated
-    protected Map<String, String> properties = null;
-
-    /**
-     * @deprecated since 4.0 in favour of {@link ClientRuntimeBuilder}
-     * @see ClientRuntimeBuilder#properties(Map)
-     */
-    @Deprecated
-    public ClientModule(Map<String, String> properties) {
-        if (properties == null) {
-            throw new NullPointerException("Null 'properties' map");
-        }
-
-        this.properties = properties;
-    }
-
-    /**
      * @since 4.0
      */
     public ClientModule() {
@@ -77,12 +57,6 @@ public class ClientModule implements Module {
         // Contribute always to create binding
         MapBuilder<String> propertiesBuilder = ServerModule.contributeProperties(binder);
 
-        // expose user-provided ROP properties as the main properties map
-        // binding here is left only for backward compatibility, should go away with the
deprecated code.
-        if(properties != null) {
-            propertiesBuilder.putAll(properties);
-        }
-
         binder.bind(ObjectContextFactory.class).to(CayenneContextFactory.class);
         binder.bind(ROPSerializationService.class).toProvider(ClientHessianSerializationServiceProvider.class);
         binder.bind(RemoteService.class).to(ProxyRemoteService.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntime.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntime.java
b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntime.java
index 2bd113f..dcfb070 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntime.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntime.java
@@ -52,55 +52,6 @@ public class ClientRuntime extends CayenneRuntime {
 		return new ClientRuntimeBuilder();
 	}
 
-	@Deprecated
-	private static Collection<Module> collectModules(Map<String, String> properties,
Module... extraModules) {
-
-		Collection<Module> modules = extraModules != null ? asList(extraModules) : Collections.<Module>emptyList();
-		return collectModules(properties, modules);
-	}
-
-	@Deprecated
-	private static Collection<Module> collectModules(Map<String, String> properties,
Collection<Module> extraModules) {
-		Collection<Module> modules = new ArrayList<>();
-		modules.add(new ClientModule(properties));
-
-		if(extraModules != null) {
-			modules.addAll(extraModules);
-		}
-
-		return modules;
-	}
-
-	/**
-	 * Creates a client runtime configuring it with a standard set of services
-	 * contained in {@link ClientModule}. CayenneClientModule is created based
-	 * on a set of properties that contain things like connection information,
-	 * etc. Recognized property keys are defined in {@link ClientModule}. An
-	 * optional array of extra modules may contain service overrides and/or user
-	 * services.
-	 *
-	 * @deprecated since 4.0, use {@link ClientRuntime#builder()} instead.
-	 */
-	@Deprecated
-	public ClientRuntime(Map<String, String> properties, Collection<Module> extraModules)
{
-		this(collectModules(properties, extraModules));
-	}
-
-	/**
-	 * Creates a client runtime configuring it with a standard set of services
-	 * contained in {@link ClientModule}. CayenneClientModule is created based
-	 * on a set of properties that contain things like connection information,
-	 * etc. Recognized property keys are defined in {@link ClientModule}. An
-	 * optional collection of extra modules may contain service overrides and/or
-	 * user services.
-	 *
-	 * @deprecated since 4.0, use {@link ClientRuntime#builder()} instead.
-	 */
-	@Deprecated
-	public ClientRuntime(Map<String, String> properties, Module... extraModules) {
-		this(collectModules(properties, extraModules));
-	}
-
 	/**
 	 * @since 4.0
 	 */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilder.java
b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilder.java
index def7070..ca826b1 100644
--- a/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilder.java
+++ b/cayenne-client/src/main/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilder.java
@@ -53,7 +53,7 @@ public class ClientRuntimeBuilder {
     Injector serverInjector;
     private Map<String, String> properties;
 
-    ClientRuntimeBuilder() {
+     ClientRuntimeBuilder() {
         modules = new ArrayList<>();
         autoLoadModules = true;
         local = false;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java
b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java
index 04ceafe..983d906 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientModuleTest.java
@@ -19,7 +19,6 @@
 package org.apache.cayenne.configuration.rop.client;
 
 import org.apache.cayenne.DataChannel;
-import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.configuration.ObjectContextFactory;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.DIBootstrap;
@@ -28,42 +27,21 @@ import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.remote.ClientChannel;
 import org.apache.cayenne.remote.ClientConnection;
 import org.apache.cayenne.remote.MockClientConnection;
-import org.apache.cayenne.rop.HttpClientConnection;
 import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 @SuppressWarnings("deprecation")
 public class ClientModuleTest {
 
     @Test
-    public void testClientConnection() {
-
-        Map<String, String> properties = new HashMap<>();
-        properties.put(ClientConstants.ROP_SERVICE_URL_PROPERTY, "http://localhost/YuM");
-        ClientModule module = new ClientModule(properties);
-
-        Injector injector = DIBootstrap.createInjector(module);
-
-        ClientConnection connection = injector.getInstance(ClientConnection.class);
-        assertNotNull(connection);
-        assertTrue(connection instanceof HttpClientConnection);
-
-        assertSame("Connection must be a singleton", connection, injector
-                .getInstance(ClientConnection.class));
-    }
-
-    @Test
     public void testObjectContextFactory() {
 
         Map<String, String> properties = new HashMap<>();
-        ClientModule module = new ClientModule(properties) {
+        ClientModule module = new ClientModule() {
 
             @Override
             public void configure(Binder binder) {
@@ -86,7 +64,7 @@ public class ClientModuleTest {
     public void testDataChannel() {
 
         Map<String, String> properties = new HashMap<>();
-        ClientModule module = new ClientModule(properties) {
+        ClientModule module = new ClientModule() {
 
             @Override
             public void configure(Binder binder) {
@@ -110,27 +88,4 @@ public class ClientModuleTest {
         assertTrue(clientChannel.getEventManager() instanceof DefaultEventManager);
         assertFalse(clientChannel.isChannelEventsEnabled());
     }
-
-    @Test
-    public void testDataChannel_NoChannelEvents() {
-
-        Map<String, String> properties = new HashMap<>();
-        properties.put(ClientConstants.ROP_CHANNEL_EVENTS_PROPERTY, "true");
-        ClientModule module = new ClientModule(properties) {
-
-            @Override
-            public void configure(Binder binder) {
-                super.configure(binder);
-
-                // use a noop connection to prevent startup errors...
-                binder.bind(ClientConnection.class).to(MockClientConnection.class);
-            }
-        };
-
-        Injector injector = DIBootstrap.createInjector(module);
-
-        DataChannel channel = injector.getInstance(DataChannel.class);
-        ClientChannel clientChannel = (ClientChannel) channel;
-        assertTrue(clientChannel.isChannelEventsEnabled());
-    }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java
b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java
index c324ead..3213c40 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeBuilderTest.java
@@ -21,11 +21,17 @@ package org.apache.cayenne.configuration.rop.client;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.configuration.Constants;
-import org.apache.cayenne.di.Key;
-import org.apache.cayenne.di.Module;
+import org.apache.cayenne.configuration.server.ServerModule;
+import org.apache.cayenne.di.*;
+import org.apache.cayenne.remote.ClientChannel;
+import org.apache.cayenne.remote.ClientConnection;
+import org.apache.cayenne.remote.MockClientConnection;
+import org.apache.cayenne.rop.HttpClientConnection;
 import org.junit.After;
 import org.junit.Test;
 
@@ -98,4 +104,53 @@ public class ClientRuntimeBuilderTest {
         assertEquals(properties, injectedProperties);
     }
 
+    @Test
+    public void testClientConnection() {
+
+        Map<String, String> properties1 = new HashMap<>();
+        properties1.put(ClientConstants.ROP_SERVICE_URL_PROPERTY, "http://localhost/YuM");
+        ClientModule module = new ClientModule(){
+
+            @Override
+            public void configure(Binder binder) {
+                super.configure(binder);
+                ServerModule.contributeProperties(binder).putAll(properties1);
+            }
+        };
+
+
+        Injector injector = DIBootstrap.createInjector(module);
+
+        ClientConnection connection = injector.getInstance(ClientConnection.class);
+        assertNotNull(connection);
+        assertTrue(connection instanceof HttpClientConnection);
+
+        assertSame("Connection must be a singleton", connection, injector
+                .getInstance(ClientConnection.class));
+    }
+
+    @Test
+    public void testDataChannel_NoChannelEvents() {
+
+        Map<String, String> properties1 = new HashMap<>();
+        properties1.put(ClientConstants.ROP_CHANNEL_EVENTS_PROPERTY, "true");
+        ClientModule module = new ClientModule() {
+
+            @Override
+            public void configure(Binder binder) {
+                super.configure(binder);
+
+                // use a noop connection to prevent startup errors...
+                binder.bind(ClientConnection.class).to(MockClientConnection.class);
+
+                ServerModule.contributeProperties(binder).putAll(properties1);
+            }
+        };
+
+        Injector injector = DIBootstrap.createInjector(module);
+
+        DataChannel channel = injector.getInstance(DataChannel.class);
+        ClientChannel clientChannel = (ClientChannel) channel;
+        assertTrue(clientChannel.isChannelEventsEnabled());
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java
----------------------------------------------------------------------
diff --git a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java
b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java
index d33f6c8..0559875 100644
--- a/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java
+++ b/cayenne-client/src/test/java/org/apache/cayenne/configuration/rop/client/ClientRuntimeTest.java
@@ -30,78 +30,19 @@ import org.apache.cayenne.remote.ClientConnection;
 import org.apache.cayenne.remote.MockClientConnection;
 import org.junit.Test;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
 
 @SuppressWarnings("deprecation")
 public class ClientRuntimeTest {
 
     @Test
-	public void testDefaultConstructor() {
-		ClientRuntime runtime = new ClientRuntime(Collections.<String, String> emptyMap());
-
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(1, modules.size());
-		Object[] marray = modules.toArray();
-
-		assertTrue(marray[0] instanceof ClientModule);
-	}
-
-    @Test
-	public void testConstructor_Modules() {
-
-		final boolean[] configured = new boolean[2];
-
-		Module m1 = binder -> configured[0] = true;
-
-		Module m2 = binder -> configured[1] = true;
-
-		Map<String, String> properties = new HashMap<>();
-
-		ClientRuntime runtime = new ClientRuntime(properties, m1, m2);
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(3, modules.size());
-
-		assertTrue(configured[0]);
-		assertTrue(configured[1]);
-	}
-
-    @Test
-	public void testConstructor_ModulesCollection() {
-
-		final boolean[] configured = new boolean[2];
-
-		Collection<Module> modules = new ArrayList<Module>();
-
-		modules.add(binder -> configured[0] = true);
-
-		modules.add(binder -> configured[1] = true);
-
-		Map<String, String> properties = new HashMap<>();
-
-		ClientRuntime runtime = new ClientRuntime(properties, modules);
-		Collection<Module> cmodules = runtime.getModules();
-		assertEquals(3, cmodules.size());
-
-		assertTrue(configured[0]);
-		assertTrue(configured[1]);
-	}
-
-    @Test
 	public void testGetObjectContext() {
 
 		Map<String, String> properties = new HashMap<>();
-		ClientModule extraModule = new ClientModule(properties) {
+		ClientModule extraModule = new ClientModule() {
 
 			@Override
 			public void configure(Binder binder) {
@@ -112,7 +53,10 @@ public class ClientRuntimeTest {
 			}
 		};
 
-		ClientRuntime runtime = new ClientRuntime(properties, extraModule);
+		ClientRuntime runtime = ClientRuntime.builder()
+								.properties(properties)
+								.addModule(extraModule)
+								.build();
 
 		ObjectContext context = runtime.newContext();
 		assertNotNull(context);
@@ -134,7 +78,10 @@ public class ClientRuntimeTest {
             binder.bind(ClientConnection.class).to(MockClientConnection.class);
 
 
-		ClientRuntime runtime = new ClientRuntime(properties, extraModule);
+		ClientRuntime runtime = ClientRuntime.builder()
+								.properties(properties)
+								.addModule(extraModule)
+								.build();
 
 		DataChannel channel = runtime.getChannel();
 		assertNotNull(channel);
@@ -145,7 +92,9 @@ public class ClientRuntimeTest {
 	public void testShutdown() throws Exception {
 
 		Map<String, String> properties = new HashMap<>();
-		ClientRuntime runtime = new ClientRuntime(properties);
+		ClientRuntime runtime = ClientRuntime.builder()
+								.properties(properties)
+								.build();
 
 		// make sure objects to be shut down are resolved
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/docs/doc/src/main/resources/UPGRADE.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/UPGRADE.txt b/docs/doc/src/main/resources/UPGRADE.txt
index 23ce6cd..4c80f33 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -268,6 +268,11 @@ UPGRADING TO 4.1.M2
       - removed setDataMap from org.apache.cayenne.AbstractQuery and from org.apache.cayenne.query.EJBQLQuery;
       - removed ServerRuntime(String configurationLocation, Module... extraModules), ServerRuntime(String[]
configurationLocations, Module... extraModules) and
       Collection<Module> collectModules(final String[] configurationLocations, Module...
extraModules) from org.apache.cayenne.configuration.server.ServerRuntime;
+      - removed org.apache.cayenne.configuration.rop.client.;
+      - removed ClientRuntime(Map<String, String> properties, Collection<Module>
extraModules), ClientRuntime(Map<String, String> properties, Module... extraModules),
+      Collection<Module> collectModules(Map<String, String> properties, Module...
extraModules), Collection<Module> collectModules(Map<String, String> properties,
Collection<Module> extraModules)
+      from org.apache.cayenne.configuration.rop.client.ClientRuntime;
+      - removed ClientModule(Map<String, String> properties) in org.apache.cayenne.configuration.rop.client.ClientModule;
 
 
 UPGRADING TO 4.1.M1

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/tutorials/tutorial-rop-client-http2/src/main/java/org/apache/cayenne/tutorial/Http2Client.java
----------------------------------------------------------------------
diff --git a/tutorials/tutorial-rop-client-http2/src/main/java/org/apache/cayenne/tutorial/Http2Client.java
b/tutorials/tutorial-rop-client-http2/src/main/java/org/apache/cayenne/tutorial/Http2Client.java
index bb97846..fdf9e03 100644
--- a/tutorials/tutorial-rop-client-http2/src/main/java/org/apache/cayenne/tutorial/Http2Client.java
+++ b/tutorials/tutorial-rop-client-http2/src/main/java/org/apache/cayenne/tutorial/Http2Client.java
@@ -33,6 +33,7 @@ import org.apache.cayenne.tutorial.persistent.client.Gallery;
 import org.apache.cayenne.tutorial.persistent.client.Painting;
 
 import javax.net.ssl.HttpsURLConnection;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -65,9 +66,11 @@ public class Http2Client {
         properties.put(ClientConstants.ROP_SERVICE_PASSWORD_PROPERTY, "secret");
         properties.put(ClientConstants.ROP_SERVICE_REALM_PROPERTY, "Cayenne Realm");
 
-        ClientRuntime runtime = new ClientRuntime(properties,
-                new ClientJettyHttp2Module(),
-                new ProtostuffModule());
+        ClientRuntime runtime = ClientRuntime.builder()
+                            .properties(properties)
+                            .addModule(new ClientJettyHttp2Module())
+                            .addModule(new ProtostuffModule())
+                            .build();
 
         ObjectContext context = runtime.newContext();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/2849f5c8/tutorials/tutorial-rop-client/src/main/java/org/apache/cayenne/tutorial/persistent/client/Main.java
----------------------------------------------------------------------
diff --git a/tutorials/tutorial-rop-client/src/main/java/org/apache/cayenne/tutorial/persistent/client/Main.java
b/tutorials/tutorial-rop-client/src/main/java/org/apache/cayenne/tutorial/persistent/client/Main.java
index b86852b..e2434ce 100644
--- a/tutorials/tutorial-rop-client/src/main/java/org/apache/cayenne/tutorial/persistent/client/Main.java
+++ b/tutorials/tutorial-rop-client/src/main/java/org/apache/cayenne/tutorial/persistent/client/Main.java
@@ -36,7 +36,9 @@ public class Main {
         properties.put(ClientConstants.ROP_SERVICE_USERNAME_PROPERTY, "cayenne-user");
         properties.put(ClientConstants.ROP_SERVICE_PASSWORD_PROPERTY, "secret");
 
-        ClientRuntime runtime = new ClientRuntime(properties);
+        ClientRuntime runtime = ClientRuntime.builder()
+                                .properties(properties)
+                                .build();
 
         ObjectContext context = runtime.newContext();
 


Mime
View raw message