You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2024/02/24 18:36:31 UTC

(pinot) branch master updated: add Netty unit test (#12486)

This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new cd41d70e30 add Netty unit test (#12486)
cd41d70e30 is described below

commit cd41d70e30e96cd54e6f8f478c746acafe6da150
Author: sullis <gi...@seansullivan.com>
AuthorDate: Sat Feb 24 10:36:25 2024 -0800

    add Netty unit test (#12486)
---
 .../test/java/org/apache/pinot/core/NettyTest.java | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/pinot-core/src/test/java/org/apache/pinot/core/NettyTest.java b/pinot-core/src/test/java/org/apache/pinot/core/NettyTest.java
new file mode 100644
index 0000000000..61fb32398f
--- /dev/null
+++ b/pinot-core/src/test/java/org/apache/pinot/core/NettyTest.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.pinot.core;
+
+import io.netty.channel.epoll.Epoll;
+import io.netty.channel.kqueue.KQueue;
+import io.netty.handler.ssl.OpenSsl;
+import org.apache.pinot.core.util.OsCheck;
+import org.testng.SkipException;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+
+public class NettyTest {
+  private static void requiredOs(final OsCheck.OSType requiredOsType) {
+    if (OsCheck.getOperatingSystemType() != requiredOsType) {
+      throw new SkipException("skipping test: " + requiredOsType + " != " + OsCheck.getOperatingSystemType());
+    }
+  }
+
+  @Test
+  public void epollIsAvailableOnLinux() {
+    requiredOs(OsCheck.OSType.Linux);
+    Epoll.ensureAvailability();
+    assertTrue(Epoll.isAvailable());
+  }
+
+  @Test
+  public void kqueueIsAvailableOnMac() {
+    requiredOs(OsCheck.OSType.MacOS);
+    KQueue.ensureAvailability();
+    assertTrue(KQueue.isAvailable());
+  }
+
+  @Test
+  public void boringSslIsAvailable() {
+    OpenSsl.ensureAvailability();
+    assertTrue(OpenSsl.isAvailable());
+    assertEquals(OpenSsl.versionString(), "BoringSSL");
+  }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org