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/07/27 02:10:33 UTC

[GitHub] [inlong] liangyepianzhou opened a new pull request, #5227: [INLONG-5192][dataproxy] Add test for tube sink

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

   ### Prepare a Pull Request
   - Fixes https://github.com/apache/inlong/issues/5192
   
   ### Motivation
   
   Add test for tube sink.
   
   ### Modifications
   
   Add test for tube sink.
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [x] This change added 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] healchow commented on a diff in pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() throws Exception {
+
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() throws Exception {

Review Comment:
   ditto.



-- 
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 #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() throws Exception {

Review Comment:
   The exception was not necessary throws here.



-- 
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] dockerzhang merged pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5227:
URL: https://github.com/apache/inlong/pull/5227


-- 
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 #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() throws Exception {
+

Review Comment:
   This blank line was not necessary too.



##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() throws Exception {
+
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() throws Exception {
+

Review Comment:
   This blank line was not necessary too.



-- 
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] dockerzhang commented on pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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

   @liangyepianzhou please format the `TestPulsarSink` at the same time according to the comments, thanks.


-- 
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] dockerzhang commented on pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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

   Yes, the new file `TestTubeSink.java` you have fixed, I mean you can fix `TestPulsarSink` according to the comments given by [healchow](https://github.com/healchow) at the same time, that means we do not need another PR to fix formats issues in `TestPulsarSink`.


-- 
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] baomingyu commented on a diff in pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() {
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() {

Review Comment:
   What does this unit test measure?



-- 
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 #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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

   > @liangyepianzhou please format the `TestPulsarSink` at the same time according to the comments, thanks.
   
   I have already fixed the comments given by [healchow](https://github.com/healchow).
   What comments do you mean?


-- 
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 #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() throws Exception {
+
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() throws Exception {

Review Comment:
   The exception was not necessary throws here.



-- 
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 #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() {
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() {

Review Comment:
   To test use TubeSink to process messages, just like TestPulsarSink.



-- 
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] baomingyu commented on a diff in pull request #5227: [INLONG-5192][DataProxy] Add unit test for TubeMQ sink

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


##########
inlong-dataproxy/dataproxy-source/src/test/java/org/apache/inlong/dataproxy/sink/TestTubeSink.java:
##########
@@ -0,0 +1,57 @@
+/*
+ * 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;
+
+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.junit.Before;
+import org.junit.Test;
+
+public class TestTubeSink {
+
+    private MemoryChannel channel;
+
+    @Before
+    public void setUp() {
+        TubeSink sink = new TubeSink();
+        channel = new MemoryChannel();
+        Context context = new Context();
+        context.put("type", "org.apache.inlong.dataproxy.sink.TubeSink");
+        sink.setChannel(channel);
+
+        this.channel.configure(context);
+    }
+
+    @Test
+    public void testProcess() {

Review Comment:
   What is the goal of this unit 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