-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6b87d34
commit 27ecb3a
Showing
8 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
cli/src/test/java/com/devonfw/tools/ide/tool/cobigen/CobigenTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
cli/src/test/resources/ide-projects/cobigen/project/settings/ide.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/cobigen/repository/cobigen/cobigen/default/bin/cobigen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo "cobigen $*" |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/cobigen/repository/java/java/default/bin/java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo "java $*" |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/cobigen/repository/java/java/default/bin/java.cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
echo java %* |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/cobigen/repository/mvn/mvn/default/bin/mvn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo "mvn $*" |