Package and qualify standalone macOS designer with bundled runtime
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
package de.neitzel.fxdesigner.standalone;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class StandaloneOptionsTest {
|
||||
@Test
|
||||
void supportsProjectArgumentsAndOptionalDocument() {
|
||||
var options =
|
||||
StandaloneOptions.parse(
|
||||
List.of("--configuration", "project/config.json", "--settings", "local.json"));
|
||||
assertNull(options.document());
|
||||
assertTrue(options.configuration().isAbsolute());
|
||||
assertEquals(
|
||||
"sample",
|
||||
StandaloneOptions.parse(List.of("--launch", "host.properties", "sample"))
|
||||
.document()
|
||||
.toString());
|
||||
assertNotNull(StandaloneOptions.parse(List.of("host.properties", "View.fxml")).legacy());
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsAmbiguousAndIncompleteArguments() {
|
||||
for (var args :
|
||||
List.of(
|
||||
List.<String>of(),
|
||||
List.of("--bad"),
|
||||
List.of("--launch"),
|
||||
List.of("--launch", "a", "--context", "b"),
|
||||
List.of("--launch", "a", "--launch", "b"),
|
||||
List.of("--configuration", "a"),
|
||||
List.of("--launch", "a", "one", "two")))
|
||||
assertThrows(IllegalArgumentException.class, () -> StandaloneOptions.parse(args));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user