arina-ielchiieva commented on a change in pull request #1898: DRILL-7443: 
Enable PCAP Plugin to Reassemble TCP Streams
URL: https://github.com/apache/drill/pull/1898#discussion_r349042959
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestSessionizePCAP.java
 ##########
 @@ -0,0 +1,106 @@
+/*
+ * 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.drill.exec.store.pcap;
+
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterTest;
+import org.joda.time.Period;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import java.time.format.DateTimeFormatter;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestSessionizePCAP extends ClusterTest{
+
+  private static final DateTimeFormatter formatter = 
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS");
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
+
+    PcapFormatConfig sampleConfig = new PcapFormatConfig();
+    sampleConfig.sessionizeTCPStreams = true;
+
+    cluster.defineFormat("cp", "pcap", sampleConfig);
+    dirTestWatcher.copyResourceToRoot(Paths.get("store/pcap/"));
+  }
+
+  @Test
+  public void testSessionizedStarQuery() throws Exception {
+    String sql = "SELECT * FROM cp.`/store/pcap/attack-trace.pcap` LIMIT 1";
 
 Review comment:
   Limit 1 does not guarantee which line will be output use where clause to 
extract exactly expected line.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to