You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by be...@apache.org on 2022/12/07 13:39:29 UTC

[incubator-streampark] branch git-call updated: [Bug] git clone testcase add

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

benjobs pushed a commit to branch git-call
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/git-call by this push:
     new 65463de12 [Bug] git clone testcase add
65463de12 is described below

commit 65463de122077133f2fbf3c9c8cb2880e314028f
Author: benjobs <be...@apache.org>
AuthorDate: Wed Dec 7 21:35:58 2022 +0800

    [Bug] git clone testcase add
---
 .../streampark/console/core/enums/GitProtocol.java |  3 ++
 .../console/base/util/GitUtilsTest.java}           | 34 +++++++++++-----------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java
index 2eba459da..b59493978 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java
@@ -34,4 +34,7 @@ public enum GitProtocol {
         return Arrays.stream(values()).filter(x -> x.value == value).findFirst().orElse(null);
     }
 
+    public Integer getValue() {
+        return this.value;
+    }
 }
diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/GitUtilsTest.java
similarity index 56%
copy from streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java
copy to streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/GitUtilsTest.java
index 2eba459da..d525bec3a 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/enums/GitProtocol.java
+++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/base/util/GitUtilsTest.java
@@ -15,23 +15,23 @@
  * limitations under the License.
  */
 
-package org.apache.streampark.console.core.enums;
-
-import java.util.Arrays;
-
-public enum GitProtocol {
-
-    HTTPS(1),
-    SSH(2);
-
-    private final int value;
-
-    GitProtocol(int value) {
-        this.value = value;
-    }
-
-    public static GitProtocol of(Integer value) {
-        return Arrays.stream(values()).filter(x -> x.value == value).findFirst().orElse(null);
+package org.apache.streampark.console.base.util;
+
+import org.apache.streampark.console.core.entity.Project;
+import org.apache.streampark.console.core.enums.GitProtocol;
+import org.junit.jupiter.api.Test;
+
+public class GitUtilsTest {
+
+    @Test
+    public void testClone() throws Exception {
+        Project project = new Project();
+        project.setUrl("https://github.com/streamxhub/streampark-quickstart.git");
+        project.setGitProtocol(GitProtocol.HTTPS.getValue());
+        project.setBranches("dev");
+        project.setAppSource("/Users/benjobs/Desktop/test");
+        project.cleanCloned();
+        GitUtils.clone(project);
     }
 
 }