logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1365866 - in /logging/log4j/log4j2/trunk/flume-ng: pom.xml src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java
Date Thu, 26 Jul 2012 01:45:59 GMT
Author: rgoers
Date: Thu Jul 26 01:45:59 2012
New Revision: 1365866

URL: http://svn.apache.org/viewvc?rev=1365866&view=rev
Log:
Upgrade to Flume 1.2.0

Modified:
    logging/log4j/log4j2/trunk/flume-ng/pom.xml
    logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java

Modified: logging/log4j/log4j2/trunk/flume-ng/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/pom.xml?rev=1365866&r1=1365865&r2=1365866&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/pom.xml (original)
+++ logging/log4j/log4j2/trunk/flume-ng/pom.xml Thu Jul 26 01:45:59 2012
@@ -54,7 +54,7 @@
     <dependency>
       <groupId>org.apache.flume</groupId>
       <artifactId>flume-ng-core</artifactId>
-      <version>1.0.0-incubating</version>
+      <version>1.2.0</version>
       <exclusions>
         <exclusion>
           <groupId>org.slf4j</groupId>

Modified: logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java?rev=1365866&r1=1365865&r2=1365866&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java
(original)
+++ logging/log4j/log4j2/trunk/flume-ng/src/test/java/org/apache/logging/log4j/flume/appender/FlumeAvroAppenderTest.java
Thu Jul 26 01:45:59 2012
@@ -18,11 +18,14 @@ package org.apache.logging.log4j.flume.a
 
 import org.apache.flume.Channel;
 import org.apache.flume.ChannelException;
+import org.apache.flume.ChannelSelector;
 import org.apache.flume.Context;
 import org.apache.flume.Event;
 
 import org.apache.flume.Transaction;
+import org.apache.flume.channel.ChannelProcessor;
 import org.apache.flume.channel.MemoryChannel;
+import org.apache.flume.channel.ReplicatingChannelSelector;
 import org.apache.flume.conf.Configurables;
 import org.apache.flume.lifecycle.LifecycleController;
 import org.apache.flume.lifecycle.LifecycleState;
@@ -44,6 +47,8 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
 
@@ -80,31 +85,28 @@ public class FlumeAvroAppenderTest {
 
         Configurables.configure(channel, new Context());
 
-        eventSource.setChannel(channel);
-
         avroLogger = (Logger) LogManager.getLogger("avrologger");
         /*
         * Clear out all other appenders associated with this logger to ensure we're
         * only hitting the Avro appender.
         */
         removeAppenders(avroLogger);
-        boolean bound = false;
+        Context context = new Context();
+        testPort = String.valueOf(testServerPort);
+        context.put("port", testPort);
+        context.put("bind", "0.0.0.0");
+        Configurables.configure(eventSource, context);
 
-        for (int i = 0; i < 100 && !bound; i++) {
-            try {
-                Context context = new Context();
-                testPort = String.valueOf(testServerPort + i);
-                context.put("port", testPort);
-                context.put("bind", "0.0.0.0");
-
-                Configurables.configure(eventSource, context);
-
-                eventSource.start();
-                bound = true;
-            } catch (ChannelException e) {
+        List<Channel> channels = new ArrayList<Channel>();
+        channels.add(channel);
+
+        ChannelSelector cs = new ReplicatingChannelSelector();
+        cs.setChannels(channels);
+
+        eventSource.setChannelProcessor(new ChannelProcessor(cs));
+
+        eventSource.start();
 
-            }
-        }
     	  Assert.assertTrue("Reached start or error", LifecycleController.waitForOneOf(
             eventSource, LifecycleState.START_OR_ERROR));
         Assert.assertEquals("Server is started", LifecycleState.START, eventSource.getLifecycleState());



Mime
View raw message