Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#331: fixed CobiGen installation #332

Merged
merged 9 commits into from
Jun 13, 2024
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
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 $*"
Loading