cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/3] cayenne git commit: Java 8 - lambdas for Module anonymous inner classes
Date Sat, 23 Sep 2017 19:53:50 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 588c23744 -> 3fc094316


http://git-wip-us.apache.org/repos/asf/cayenne/blob/3fc09431/eventbridges/cayenne-jgroups/src/test/java/org/apache/cayenne/event/JavaGroupsBridgeProviderTest.java
----------------------------------------------------------------------
diff --git a/eventbridges/cayenne-jgroups/src/test/java/org/apache/cayenne/event/JavaGroupsBridgeProviderTest.java
b/eventbridges/cayenne-jgroups/src/test/java/org/apache/cayenne/event/JavaGroupsBridgeProviderTest.java
index 7f47201..00232d4 100644
--- a/eventbridges/cayenne-jgroups/src/test/java/org/apache/cayenne/event/JavaGroupsBridgeProviderTest.java
+++ b/eventbridges/cayenne-jgroups/src/test/java/org/apache/cayenne/event/JavaGroupsBridgeProviderTest.java
@@ -58,12 +58,10 @@ public class JavaGroupsBridgeProviderTest {
 
     @Test
     public void testUseProperties() throws Exception {
-        Module module = new Module() {
-            public void configure(Binder binder) {
-                JGroupsModule.contributeMulticastAddress(binder, MCAST_ADDRESS_TEST);
-                JGroupsModule.contributeMulticastPort(binder, Integer.parseInt(MCAST_PORT_TEST));
-                JGroupsModule.contributeConfigUrl(binder, CONFIG_URL_TEST);
-            }
+        Module module = binder -> {
+            JGroupsModule.contributeMulticastAddress(binder, MCAST_ADDRESS_TEST);
+            JGroupsModule.contributeMulticastPort(binder, Integer.parseInt(MCAST_PORT_TEST));
+            JGroupsModule.contributeConfigUrl(binder, CONFIG_URL_TEST);
         };
 
         Injector injector = DIBootstrap.createInjector(new DefaultBindings(), new JGroupsModule(),
module);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3fc09431/eventbridges/cayenne-jms/src/test/java/org/apache/cayenne/event/JMSBridgeProviderTest.java
----------------------------------------------------------------------
diff --git a/eventbridges/cayenne-jms/src/test/java/org/apache/cayenne/event/JMSBridgeProviderTest.java
b/eventbridges/cayenne-jms/src/test/java/org/apache/cayenne/event/JMSBridgeProviderTest.java
index a96e349..83404eb 100644
--- a/eventbridges/cayenne-jms/src/test/java/org/apache/cayenne/event/JMSBridgeProviderTest.java
+++ b/eventbridges/cayenne-jms/src/test/java/org/apache/cayenne/event/JMSBridgeProviderTest.java
@@ -55,13 +55,8 @@ public class JMSBridgeProviderTest {
     }
 
     @Test
-    public void testUseProperties() throws Exception {
-        Module module = new Module() {
-
-            public void configure(Binder binder) {
-                JMSModule.contributeTopicConnectionFactory(binder, TOPIC_CONNECTION_FACTORY_TEST);
-            }
-        };
+    public void testUseProperties() {
+        Module module = binder -> JMSModule.contributeTopicConnectionFactory(binder, TOPIC_CONNECTION_FACTORY_TEST);
 
         Injector injector = DIBootstrap.createInjector(new DefaultBindings(), new JMSModule(),
module);
         JMSBridge bridge = (JMSBridge) injector.getInstance(EventBridge.class);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3fc09431/eventbridges/cayenne-xmpp/src/test/java/org/apache/cayenne/event/XMPPBridgeProviderTest.java
----------------------------------------------------------------------
diff --git a/eventbridges/cayenne-xmpp/src/test/java/org/apache/cayenne/event/XMPPBridgeProviderTest.java
b/eventbridges/cayenne-xmpp/src/test/java/org/apache/cayenne/event/XMPPBridgeProviderTest.java
index 93b2c0f..f36d495 100644
--- a/eventbridges/cayenne-xmpp/src/test/java/org/apache/cayenne/event/XMPPBridgeProviderTest.java
+++ b/eventbridges/cayenne-xmpp/src/test/java/org/apache/cayenne/event/XMPPBridgeProviderTest.java
@@ -61,14 +61,12 @@ public class XMPPBridgeProviderTest {
 
     @Test
     public void testUseProperties() throws Exception {
-        Module module = new Module() {
-            public void configure(Binder binder) {
-                XMPPModule.contributeSecureConnection(binder, SECURE_CONNECTION_TEST);
-                XMPPModule.contributeHost(binder, HOST_TEST);
-                XMPPModule.contributePort(binder, PORT_TEST);
-                XMPPModule.contributeLogin(binder, LOGIN_TEST, PASSWORD_TEST);
-                XMPPModule.contributeChatService(binder, CHAT_SERVICE_TEST);
-            }
+        Module module = binder -> {
+            XMPPModule.contributeSecureConnection(binder, SECURE_CONNECTION_TEST);
+            XMPPModule.contributeHost(binder, HOST_TEST);
+            XMPPModule.contributePort(binder, PORT_TEST);
+            XMPPModule.contributeLogin(binder, LOGIN_TEST, PASSWORD_TEST);
+            XMPPModule.contributeChatService(binder, CHAT_SERVICE_TEST);
         };
 
         Injector injector = DIBootstrap.createInjector(new DefaultBindings(), new XMPPModule(),
module);


Mime
View raw message