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

jincheng pushed a commit to branch release-1.8
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.8 by this push:
     new ef9d0c2  [FLINK-12001][formats] fix the external jar path config error 
for AvroExternalJarProgramITCase.
ef9d0c2 is described below

commit ef9d0c2344108bf1d817c6d7364f0fb7322ad0fc
Author: sunjincheng121 <[email protected]>
AuthorDate: Mon Mar 25 20:23:24 2019 +0800

    [FLINK-12001][formats] fix the external jar path config error for 
AvroExternalJarProgramITCase.
    
    This closes #8047
---
 .../flink/formats/avro/AvroExternalJarProgramITCase.java   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/AvroExternalJarProgramITCase.java
 
b/flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/AvroExternalJarProgramITCase.java
index 2f959b3..0ad5d32 100644
--- 
a/flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/AvroExternalJarProgramITCase.java
+++ 
b/flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/AvroExternalJarProgramITCase.java
@@ -18,6 +18,7 @@
 
 package org.apache.flink.formats.avro;
 
+import org.apache.flink.client.program.JobWithJars;
 import org.apache.flink.client.program.PackagedProgram;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.formats.avro.testjar.AvroExternalJarProgram;
@@ -31,6 +32,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Collections;
 
 /**
@@ -63,15 +65,23 @@ public class AvroExternalJarProgramITCase extends 
TestLogger {
 
        @Test
        public void testExternalProgram() throws Exception {
+
+               String jarFile = JAR_FILE;
+               try {
+                       JobWithJars.checkJarFile(new 
File(jarFile).getAbsoluteFile().toURI().toURL());
+               } catch (IOException e) {
+                       jarFile = "target/".concat(jarFile);
+               }
+
                TestEnvironment.setAsContext(
                        MINI_CLUSTER,
                        PARALLELISM,
-                       Collections.singleton(new Path(JAR_FILE)),
+                       Collections.singleton(new Path(jarFile)),
                        Collections.emptyList());
 
                String testData = 
getClass().getResource(TEST_DATA_FILE).toString();
 
-               PackagedProgram program = new PackagedProgram(new 
File(JAR_FILE), new String[]{testData});
+               PackagedProgram program = new PackagedProgram(new 
File(jarFile), new String[]{testData});
 
                program.invokeInteractiveModeForExecution();
        }

Reply via email to