Skip to content

Commit

Permalink
#331: fixed CobiGen installation (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-vcapgemini authored Jun 13, 2024
1 parent 6b87d34 commit 27ecb3a
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ protected String getTool() {
return "cobigen";
}

@Override
protected String getExtension() {

return ".tar.gz";
}

@Override
protected String getMavenGroupIdPath() {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.devonfw.tools.ide.tool.cobigen;

import com.devonfw.tools.ide.context.AbstractIdeContextTest;
import com.devonfw.tools.ide.context.IdeTestContext;
import com.devonfw.tools.ide.log.IdeLogLevel;
import org.junit.jupiter.api.Test;

/**
* Integration test of {@link Cobigen}.
*/
public class CobigenTest extends AbstractIdeContextTest {

private static final String COBIGEN = "cobigen";

private final IdeTestContext context = newContext(COBIGEN);

/**
* Tests if {@link Cobigen} can be installed properly.
*/
@Test
public void testCobigenInstall() {

// arrange
IdeTestContext context = newContext(COBIGEN);

Cobigen commandlet = new Cobigen(context);

// act
commandlet.install();

// assert
checkInstallation(context);
}

/**
* Tests if {@link Cobigen} can be run properly.
*/
@Test
public void testCobigenRun() {
// arrange

Cobigen commandlet = new Cobigen(this.context);

// act
commandlet.run();

// assert
assertLogMessage(this.context, IdeLogLevel.INFO, COBIGEN + " ");

checkInstallation(this.context);
}

private void checkInstallation(IdeTestContext context) {

// install - java
assertThat(context.getSoftwarePath().resolve("java/bin/java")).exists();
// install - mvn
assertThat(context.getSoftwarePath().resolve("mvn/bin/mvn")).exists();

// commandlet - cobigen
assertThat(context.getSoftwarePath().resolve("cobigen/.ide.software.version")).exists().hasContent("2021.12.006");
assertLogMessage(context, IdeLogLevel.SUCCESS, "Successfully installed cobigen in version 2021.12.006");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
JAVA_VERSION=17.0.10_7
MAVEN_VERSION=3.9.6
COBIGEN_VERSION=2021.12.006
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "cobigen $*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "java $*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
echo java %*
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "mvn $*"

0 comments on commit 27ecb3a

Please sign in to comment.