You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/02 03:40:24 UTC

[GitHub] [inlong] liangyepianzhou opened a new pull request, #5322: [INLONG-5321][DataProxy]Add zone Test

liangyepianzhou opened a new pull request, #5322:
URL: https://github.com/apache/inlong/pull/5322

   ### Prepare a Pull Request
   - Fixes https://github.com/apache/inlong/issues/5321
   
   ### Motivation
   
   Now, the PulsarZoneSink, the KafkaZoneSink, and the TubeZoneSink have no test to verify. So we add a test to verify them.
   
   ### Modifications
   
   Add test to verify zone test.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] liangyepianzhou closed pull request #5322: [INLONG-5321][DataProxy] Add zone test for MQ sinks

Posted by GitBox <gi...@apache.org>.
liangyepianzhou closed pull request #5322: [INLONG-5321][DataProxy] Add zone test for MQ sinks
URL: https://github.com/apache/inlong/pull/5322


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] liangyepianzhou commented on a diff in pull request #5322: [INLONG-5321][DataProxy] Add zone test for MQ sinks

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on code in PR #5322:
URL: https://github.com/apache/inlong/pull/5322#discussion_r935181435


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/zone/TesZoneSink.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * 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.inlong.dataproxy.sink.zone;
+
+import com.google.common.base.Charsets;
+import org.apache.flume.Context;
+import org.apache.flume.Event;
+import org.apache.flume.Transaction;
+import org.apache.flume.channel.MemoryChannel;
+import org.apache.flume.event.EventBuilder;
+import org.apache.inlong.dataproxy.sink.kafkazone.KafkaZoneSink;
+import org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSink;
+import org.apache.inlong.dataproxy.sink.tubezone.TubeZoneSink;
+import org.junit.Test;
+
+public class TesZoneSink {
+
+    @Test
+    public void testPulsarZoneSinkProcess() {
+        PulsarZoneSink sink = new PulsarZoneSink();
+        MemoryChannel channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSinkk");
+        sink.setChannel(channel);
+
+        channel.configure(context);
+        Event event = EventBuilder.withBody("test event 1", Charsets.UTF_8);
+
+        Transaction transaction = channel.getTransaction();
+        transaction.begin();
+        for (int i = 0; i < 10; i++) {
+            channel.put(event);
+        }
+        transaction.commit();
+        transaction.close();
+    }
+
+    @Test
+    public void testTubeZoneSinkProcess() {
+

Review Comment:
    Thanks for the reminder.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] liangyepianzhou commented on pull request #5322: [INLONG-5321][DataProxy] Add zone test for MQ sinks

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on PR #5322:
URL: https://github.com/apache/inlong/pull/5322#issuecomment-1203543532

   @healchow  @dockerzhang  All tests have passed, please help review this PR, THX.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #5322: [INLONG-5321][DataProxy]Add zone Test

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5322:
URL: https://github.com/apache/inlong/pull/5322#discussion_r935149003


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/zone/TesZoneSink.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * 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.inlong.dataproxy.sink.zone;
+
+import com.google.common.base.Charsets;
+import org.apache.flume.Context;
+import org.apache.flume.Event;
+import org.apache.flume.Transaction;
+import org.apache.flume.channel.MemoryChannel;
+import org.apache.flume.event.EventBuilder;
+import org.apache.inlong.dataproxy.sink.kafkazone.KafkaZoneSink;
+import org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSink;
+import org.apache.inlong.dataproxy.sink.tubezone.TubeZoneSink;
+import org.junit.Test;
+
+public class TesZoneSink {

Review Comment:
   Is the `Tes` typo?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #5322: [INLONG-5321][DataProxy]Add zone Test

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5322:
URL: https://github.com/apache/inlong/pull/5322#discussion_r935149266


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/zone/TesZoneSink.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * 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.inlong.dataproxy.sink.zone;
+
+import com.google.common.base.Charsets;
+import org.apache.flume.Context;
+import org.apache.flume.Event;
+import org.apache.flume.Transaction;
+import org.apache.flume.channel.MemoryChannel;
+import org.apache.flume.event.EventBuilder;
+import org.apache.inlong.dataproxy.sink.kafkazone.KafkaZoneSink;
+import org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSink;
+import org.apache.inlong.dataproxy.sink.tubezone.TubeZoneSink;
+import org.junit.Test;
+
+public class TesZoneSink {
+
+    @Test
+    public void testPulsarZoneSinkProcess() {
+        PulsarZoneSink sink = new PulsarZoneSink();
+        MemoryChannel channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSinkk");
+        sink.setChannel(channel);
+
+        channel.configure(context);
+        Event event = EventBuilder.withBody("test event 1", Charsets.UTF_8);
+
+        Transaction transaction = channel.getTransaction();
+        transaction.begin();
+        for (int i = 0; i < 10; i++) {
+            channel.put(event);
+        }
+        transaction.commit();
+        transaction.close();
+    }
+
+    @Test
+    public void testTubeZoneSinkProcess() {
+

Review Comment:
   Unnecessary blank lines.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] liangyepianzhou commented on pull request #5322: [INLONG-5321][DataProxy]Add zone Test

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on PR #5322:
URL: https://github.com/apache/inlong/pull/5322#issuecomment-1201986233

   @dockerzhang Could you please help review this PR when you have time? THX.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] liangyepianzhou commented on a diff in pull request #5322: [INLONG-5321][DataProxy] Add zone test for MQ sinks

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on code in PR #5322:
URL: https://github.com/apache/inlong/pull/5322#discussion_r935181183


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/zone/TesZoneSink.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * 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.inlong.dataproxy.sink.zone;
+
+import com.google.common.base.Charsets;
+import org.apache.flume.Context;
+import org.apache.flume.Event;
+import org.apache.flume.Transaction;
+import org.apache.flume.channel.MemoryChannel;
+import org.apache.flume.event.EventBuilder;
+import org.apache.inlong.dataproxy.sink.kafkazone.KafkaZoneSink;
+import org.apache.inlong.dataproxy.sink.pulsarzone.PulsarZoneSink;
+import org.apache.inlong.dataproxy.sink.tubezone.TubeZoneSink;
+import org.junit.Test;
+
+public class TesZoneSink {

Review Comment:
   Yeah, I didn't notice. Thanks for the reminder.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org