|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2016 the original author or authors.
|
|
|
|
|
* Copyright 2012-2017 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -34,6 +34,27 @@ public class RunArgumentsTests {
|
|
|
|
|
assertThat(args.length).isEqualTo(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void parseNullArray() {
|
|
|
|
|
String[] args = new RunArguments((String[]) null).asArray();
|
|
|
|
|
assertThat(args).isNotNull();
|
|
|
|
|
assertThat(args.length).isEqualTo(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void parseArrayContainingNullValue() {
|
|
|
|
|
String[] args = new RunArguments(new String[]{"foo", null, "bar"}).asArray();
|
|
|
|
|
assertThat(args).isNotNull();
|
|
|
|
|
assertThat(args).containsOnly("foo", "bar");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void parseArrayContainingEmptyValue() {
|
|
|
|
|
String[] args = new RunArguments(new String[]{"foo", "", "bar"}).asArray();
|
|
|
|
|
assertThat(args).isNotNull();
|
|
|
|
|
assertThat(args).containsOnly("foo", "", "bar");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void parseEmpty() {
|
|
|
|
|
String[] args = parseArgs(" ");
|
|
|
|
|