-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Exception in DownloadCommand if version not found
- Loading branch information
1 parent
5657a4b
commit 6246cba
Showing
9 changed files
with
47 additions
and
11 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
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
19 changes: 19 additions & 0 deletions
19
...cher/src/test/java/me/earth/headlessmc/launcher/command/download/DownloadCommandTest.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,19 @@ | ||
package me.earth.headlessmc.launcher.command.download; | ||
|
||
import me.earth.headlessmc.api.command.CommandException; | ||
import me.earth.headlessmc.launcher.Launcher; | ||
import me.earth.headlessmc.launcher.LauncherMock; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
public class DownloadCommandTest { | ||
@Test | ||
public void testDownloadCommand() { | ||
Launcher launcher = LauncherMock.INSTANCE; | ||
DummyVersionInfoCache cache = new DummyVersionInfoCache(); | ||
DownloadCommand downloadCommand = new DownloadCommand(launcher, cache); | ||
assertThrows(CommandException.class, () -> downloadCommand.download("0")); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...er/src/test/java/me/earth/headlessmc/launcher/command/download/DummyVersionInfoCache.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,12 @@ | ||
package me.earth.headlessmc.launcher.command.download; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class DummyVersionInfoCache extends VersionInfoCache { | ||
@Override | ||
public List<VersionInfo> cache(boolean force) { | ||
return new ArrayList<>(); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env sh | ||
java -jar headlessmc-launcher-wrapper-2.5.0.jar --command $@ | ||
java -jar headlessmc-launcher-wrapper-2.5.1.jar --command $@ |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@echo off | ||
"%JAVA_HOME%\bin\java" -jar headlessmc-launcher-wrapper-2.5.0.jar --command %* | ||
"%JAVA_HOME%\bin\java" -jar headlessmc-launcher-wrapper-2.5.1.jar --command %* |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/bash | ||
# when running in docker on windows bash seems to be at /bin/bash TODO: can we make this one script? | ||
java -jar headlessmc-launcher-wrapper-2.5.0.jar --command $@ | ||
java -jar headlessmc-launcher-wrapper-2.5.1.jar --command $@ |