forked from devonfw/IDEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devonfw#37: Tool commandlet for visual studio code (devonfw#538)
- Loading branch information
Showing
10 changed files
with
203 additions
and
10 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
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
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
45 changes: 45 additions & 0 deletions
45
cli/src/test/java/com/devonfw/tools/ide/tool/vscode/VscodeTest.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,45 @@ | ||
package com.devonfw.tools.ide.tool.vscode; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.devonfw.tools.ide.context.AbstractIdeContextTest; | ||
import com.devonfw.tools.ide.context.IdeTestContext; | ||
|
||
/** | ||
* Test of {@link Vscode} class. | ||
*/ | ||
public class VscodeTest extends AbstractIdeContextTest { | ||
|
||
private static final String PROJECT_VSCODE = "vscode"; | ||
|
||
|
||
@Test | ||
public void testVscodeInstall() { | ||
|
||
// arrange | ||
IdeTestContext context = newContext(PROJECT_VSCODE); | ||
Vscode vscodeCommandlet = new Vscode(context); | ||
|
||
// install | ||
vscodeCommandlet.install(); | ||
|
||
// assert | ||
checkInstallation(context); | ||
} | ||
|
||
private void checkInstallation(IdeTestContext context) { | ||
|
||
assertThat(context.getSoftwarePath().resolve("vscode/bin/code.cmd")).exists().hasContent("@echo test for windows"); | ||
assertThat(context.getSoftwarePath().resolve("vscode/bin/code")).exists().hasContent("#!/bin/bash\n" + "echo \"Test for linux and Mac\""); | ||
|
||
assertThat(context.getSoftwarePath().resolve("vscode/.ide.software.version")).exists().hasContent("1.92.1"); | ||
assertThat(context).logAtSuccess().hasMessage("Successfully installed vscode in version 1.92.1"); | ||
|
||
//check plugins folder | ||
assertThat(context.getIdeHome().resolve("plugins").resolve("vscode")).exists(); | ||
|
||
//check Recommendations | ||
assertThat(context.getWorkspacePath().resolve(".vscode").resolve("extensions.json")).exists() | ||
.hasContent("{\"recommendations\":[\"esbenp.prettier-vscode\",\"mockedPlugin2\"]}"); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
cli/src/test/resources/ide-projects/vscode/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 @@ | ||
VSCODE_VERSION=1.92.1 |
3 changes: 3 additions & 0 deletions
3
...est/resources/ide-projects/vscode/project/settings/vscode/plugins/mocedPlugin2.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 @@ | ||
plugin_id=mockedPlugin2 | ||
plugin_active=false | ||
tags=mocking |
3 changes: 3 additions & 0 deletions
3
...est/resources/ide-projects/vscode/project/settings/vscode/plugins/mockedPlugin.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 @@ | ||
plugin_id=mockedPlugin | ||
plugin_active=true | ||
tags=mocking |
5 changes: 5 additions & 0 deletions
5
cli/src/test/resources/ide-projects/vscode/project/workspaces/main/.vscode/extensions.json
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,5 @@ | ||
{ | ||
"recommendations": [ | ||
"esbenp.prettier-vscode" | ||
] | ||
} |
2 changes: 2 additions & 0 deletions
2
cli/src/test/resources/ide-projects/vscode/repository/vscode/vscode/default/bin/code
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 "Test for linux and Mac" |
1 change: 1 addition & 0 deletions
1
cli/src/test/resources/ide-projects/vscode/repository/vscode/vscode/default/bin/code.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 @@ | ||
@echo test for windows |