Skip to content

Commit c211ff7

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents fddb039 + 3d4fca8 commit c211ff7

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Interface | Purpose
4242
[Arg\<T>](#argt) | Allows to fetch the application arguments | [StringOf](#stringof--textof), [NumberOf](#numberof), [PathOf](), [FileOf](), [EnvOf](#envof), [PropOf](#propof), [Alt](#alt), [Unchecked](), [etc](src/main/java/io/github/dgroup/term4j/arg/) |
4343
[Std](#std) | Wrap the raw manipulation with `std out` | [StdOf](#stdof), [Inmem](), [etc](src/main/java/io/github/dgroup/term4j/std)
4444
[Highlighted](#highlighted) | The colored extension of [Text](https://goo.gl/2ZYC83) for `std out` | [Green](src/main/java/io/github/dgroup/term4j/highlighted/Green.java), [Red](src/main/java/io/github/dgroup/term4j/highlighted/Red.java), [Yellow](src/main/java/io/github/dgroup/term4j/highlighted/Yellow.java), [etc](src/main/java/io/github/dgroup/term4j/highlighted)
45-
[Runtime](#runtimeof) | Wrap the raw manipulation with JVM runtime | [RuntimeOf](src/main/java/io/github/dgroup/term4j/runtime/RuntimeOf.java), [FakeRuntime](src/main/java/io/github/dgroup/term4j/runtime/FakeRuntime.java), [AppException](src/main/java/io/github/dgroup/term4j/AppException.java), [etc](src/main/java/io/github/dgroup/term4j/runtime)
45+
[Runtime](#runtimeof) | Wrap the raw manipulation with JVM runtime | [RuntimeOf](src/main/java/io/github/dgroup/term4j/runtime/RuntimeOf.java), [FakeRuntime](src/main/java/io/github/dgroup/term4j/runtime/FakeRuntime.java), [AppException](src/main/java/io/github/dgroup/term4j/runtime/AppException.java), [etc](src/main/java/io/github/dgroup/term4j/runtime)
4646

4747
All examples below are using the following frameworks/libs:
4848
- [Hamcrest](https://github.com/hamcrest/JavaHamcrest) - Library of matchers, which can be combined in to create flexible expressions of intent in tests.

src/main/java/io/github/dgroup/term4j/arg/Fake.java renamed to src/main/java/io/github/dgroup/term4j/arg/FakeArg.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param <X> Type of item.
3434
* @since 0.1.0
3535
*/
36-
public final class Fake<X> implements Arg<X> {
36+
public final class FakeArg<X> implements Arg<X> {
3737

3838
/**
3939
* The label of the command-line argument.
@@ -58,7 +58,7 @@ public final class Fake<X> implements Arg<X> {
5858
* @param lbl The label of the command-line argument.
5959
* @param val The value of the command-line argument.
6060
*/
61-
public Fake(final String lbl, final X val) {
61+
public FakeArg(final String lbl, final X val) {
6262
this(lbl, () -> val);
6363
}
6464

@@ -67,7 +67,7 @@ public Fake(final String lbl, final X val) {
6767
* @param lbl The label of the command-line argument.
6868
* @param val The value of the command-line argument.
6969
*/
70-
public Fake(final String lbl, final Scalar<X> val) {
70+
public FakeArg(final String lbl, final Scalar<X> val) {
7171
this(lbl, val, true);
7272
}
7373

@@ -77,7 +77,7 @@ public Fake(final String lbl, final Scalar<X> val) {
7777
* @param val The value of the command-line argument.
7878
* @param spcfd The presence of the argument's value.
7979
*/
80-
public Fake(final String lbl, final X val, final boolean spcfd) {
80+
public FakeArg(final String lbl, final X val, final boolean spcfd) {
8181
this(lbl, () -> val, spcfd);
8282
}
8383

@@ -87,7 +87,7 @@ public Fake(final String lbl, final X val, final boolean spcfd) {
8787
* @param val The value of the command-line argument.
8888
* @param spcfd The presence of the argument's value.
8989
*/
90-
public Fake(final String lbl, final Scalar<X> val, final boolean spcfd) {
90+
public FakeArg(final String lbl, final Scalar<X> val, final boolean spcfd) {
9191
this.lbl = lbl;
9292
this.val = val;
9393
this.specified = spcfd;

src/main/java/io/github/dgroup/term4j/AppException.java renamed to src/main/java/io/github/dgroup/term4j/runtime/AppException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
2222
* OR OTHER DEALINGS IN THE SOFTWARE.
2323
*/
24-
package io.github.dgroup.term4j;
24+
package io.github.dgroup.term4j.runtime;
2525

2626
import org.cactoos.Text;
2727
import org.cactoos.iterable.IterableOf;

src/main/java/io/github/dgroup/term4j/runtime/Fake.java renamed to src/main/java/io/github/dgroup/term4j/runtime/FakeRuntime.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
* Fake implementation of {@link Runtime} for unit-testing purposes.
3030
*
3131
* @since 0.1.0
32-
* @todo #/DEV Rename fakes considering type
3332
*/
34-
public final class Fake implements Runtime {
33+
public final class FakeRuntime implements Runtime {
3534

3635
/**
3736
* Application exit code.

src/test/java/io/github/dgroup/term4j/arg/AltTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void value() {
4343
new Assertion<>(
4444
"The alternative value ('5') was taken in case of exception",
4545
() -> new Alt<>(
46-
new Fake<>(
46+
new FakeArg<>(
4747
"--threads",
4848
() -> {
4949
throw new ArgNotFoundException("--threads");

src/test/java/io/github/dgroup/term4j/arg/UncheckedTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void matches() {
4949
new Assertion<>(
5050
"argument must match",
5151
() -> new Unchecked<>(
52-
new Fake<>("-f", "test.yml")
52+
new FakeArg<>("-f", "test.yml")
5353
),
5454
new ArgIs<>("-f", "test.yml")
5555
).affirm();
@@ -62,7 +62,7 @@ public void noValue() {
6262
);
6363
this.cause.expect(UncheckedArgNotFoundException.class);
6464
new Unchecked<>(
65-
new Fake<>(
65+
new FakeArg<>(
6666
"-f",
6767
() -> {
6868
throw new ArgNotFoundException("-f");

src/test/java/io/github/dgroup/term4j/arg/hamcrest/ArgHasTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
package io.github.dgroup.term4j.arg.hamcrest;
2626

27-
import io.github.dgroup.term4j.arg.Fake;
27+
import io.github.dgroup.term4j.arg.FakeArg;
2828
import org.hamcrest.MatcherAssert;
2929
import org.junit.Test;
3030

@@ -42,7 +42,7 @@ public final class ArgHasTest {
4242
@Test
4343
public void matches() {
4444
MatcherAssert.assertThat(
45-
new Fake<>("-f", "test.yml"),
45+
new FakeArg<>("-f", "test.yml"),
4646
new ArgHas<>("test.yml")
4747
);
4848
}

src/test/java/io/github/dgroup/term4j/arg/hamcrest/ArgHaveTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
package io.github.dgroup.term4j.arg.hamcrest;
2626

27-
import io.github.dgroup.term4j.arg.Fake;
27+
import io.github.dgroup.term4j.arg.FakeArg;
2828
import org.cactoos.iterable.IterableOf;
2929
import org.hamcrest.MatcherAssert;
3030
import org.junit.Rule;
@@ -53,7 +53,7 @@ public final class ArgHaveTest {
5353
public void matches() {
5454
new Assertion<>(
5555
"argument has proper multiple values",
56-
() -> new Fake<>("--admin", new IterableOf<>("Tom", "Alex")),
56+
() -> new FakeArg<>("--admin", new IterableOf<>("Tom", "Alex")),
5757
new ArgHave<>("Tom", "Alex")
5858
);
5959
}
@@ -67,7 +67,7 @@ public void mismatch() {
6767
this.cause.expectMessage("Expected: <Mike>");
6868
this.cause.expectMessage(" but: <Tom, Alex>");
6969
MatcherAssert.assertThat(
70-
new Fake<>("--admin", new IterableOf<>("Tom", "Alex")),
70+
new FakeArg<>("--admin", new IterableOf<>("Tom", "Alex")),
7171
new ArgHave<>("Mike")
7272
);
7373
}

src/test/java/io/github/dgroup/term4j/arg/hamcrest/ArgIsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
package io.github.dgroup.term4j.arg.hamcrest;
2626

27-
import io.github.dgroup.term4j.arg.Fake;
27+
import io.github.dgroup.term4j.arg.FakeArg;
2828
import org.hamcrest.MatcherAssert;
2929
import org.junit.Rule;
3030
import org.junit.Test;
@@ -58,7 +58,7 @@ public void mismatch() {
5858
" but: label was \"-t\", value was <5>, presence was <true>"
5959
);
6060
MatcherAssert.assertThat(
61-
new Fake<>("-t", 5, true),
61+
new FakeArg<>("-t", 5, true),
6262
new ArgIs<>("-t", 8)
6363
);
6464
}

0 commit comments

Comments
 (0)