Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/gradle/actions-4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sbouchet authored Sep 27, 2024
2 parents 2cfb5f8 + a71743b commit 2d8bbfd
Show file tree
Hide file tree
Showing 49 changed files with 25 additions and 13,005 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ bin/

lsp/
/.run/
/.intellijPlatform/
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
******************************************************************************/
package org.jboss.tools.intellij.openshift.utils.odo;

import com.intellij.util.io.ZipUtil;
import com.redhat.devtools.intellij.common.utils.ExecHelper;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutionException;
Expand All @@ -30,12 +35,13 @@

@RunWith(Parameterized.class)
public class OdoCliComponentTest extends OdoCliTest {
private static final String COMPONENT_PATH = "src/it/projects/go";
private static final String PROJECT_NAME = "go";
private static final String COMPONENT_PATH = "src/it/projects/";
private final ComponentFeature feature;
private String project;
private String component;
private String service;
private final String projectPath = new File(COMPONENT_PATH).getAbsolutePath();
private final String projectPath = new File(COMPONENT_PATH + PROJECT_NAME).getAbsolutePath();

public OdoCliComponentTest(ComponentFeature feature, String label) {
this.feature = feature;
Expand All @@ -49,6 +55,18 @@ public static Iterable<Object[]> data() {
});
}

@BeforeClass
public static void initTestProject() throws IOException {
Path destDir = new File(COMPONENT_PATH).toPath();
Path srcFile = new File(COMPONENT_PATH + PROJECT_NAME + ".zip").toPath();
ZipUtil.extract(srcFile, destDir, null);
}

@AfterClass
public static void deleteTestProject() throws IOException {
FileUtils.deleteDirectory(new File(COMPONENT_PATH));
}

@Before
public void initTestEnv() throws IOException {
project = PROJECT_PREFIX + random.nextInt();
Expand Down Expand Up @@ -127,13 +145,16 @@ public void checkCreateComponentAndLinkService() throws IOException, ExecutionEx
Binding binding = odo.link(projectPath, target);
assertNotNull(binding);
List<Binding> bindings = odo.listBindings(projectPath);
assertNotNull(bindings);
assertEquals(1, bindings.size());
//cleanup
// cleanup
odo.deleteBinding(projectPath, binding.getName());
bindings = odo.listBindings(projectPath);
assertNotNull(bindings);
assertEquals(0, bindings.size());
odo.deleteService(project, deployedService);
deployedServices = odo.getServices(project);
assertNotNull(deployedServices);
assertEquals(0, deployedServices.size());
}

Expand Down
Binary file added src/it/projects/go.zip
Binary file not shown.
3 changes: 0 additions & 3 deletions src/it/projects/go/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions src/it/projects/go/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions src/it/projects/go/go.mod

This file was deleted.

15 changes: 0 additions & 15 deletions src/it/projects/go/main.go

This file was deleted.

Binary file added src/it/projects/nodejs.zip
Binary file not shown.
107 changes: 0 additions & 107 deletions src/it/projects/nodejs/.gitignore

This file was deleted.

Loading

0 comments on commit 2d8bbfd

Please sign in to comment.