Stdin/Stdout Helper for JUnit

Helper for testing stdin/stdout interactions

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

pt.ulusofona.deisi
ArtifactId

ArtifactId

stdin-stdout-junit-helper
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Stdin/Stdout Helper for JUnit
Helper for testing stdin/stdout interactions
Project URL

Project URL

https://github.com/drop-project-edu/stdin-stdout-junit-helper
Project Organization

Project Organization

Pedro Alves
Source Code Management

Source Code Management

https://github.com/drop-project-edu/stdin-stdout-junit-helper

Download stdin-stdout-junit-helper

How to add to project

<!-- https://jarcasting.com/artifacts/pt.ulusofona.deisi/stdin-stdout-junit-helper/ -->
<dependency>
    <groupId>pt.ulusofona.deisi</groupId>
    <artifactId>stdin-stdout-junit-helper</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/pt.ulusofona.deisi/stdin-stdout-junit-helper/
implementation 'pt.ulusofona.deisi:stdin-stdout-junit-helper:0.1.0'
// https://jarcasting.com/artifacts/pt.ulusofona.deisi/stdin-stdout-junit-helper/
implementation ("pt.ulusofona.deisi:stdin-stdout-junit-helper:0.1.0")
'pt.ulusofona.deisi:stdin-stdout-junit-helper:jar:0.1.0'
<dependency org="pt.ulusofona.deisi" name="stdin-stdout-junit-helper" rev="0.1.0">
  <artifact name="stdin-stdout-junit-helper" type="jar" />
</dependency>
@Grapes(
@Grab(group='pt.ulusofona.deisi', module='stdin-stdout-junit-helper', version='0.1.0')
)
libraryDependencies += "pt.ulusofona.deisi" % "stdin-stdout-junit-helper" % "0.1.0"
[pt.ulusofona.deisi/stdin-stdout-junit-helper "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.commons : commons-collections4 jar 4.4

provided (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Stdin/Stdout Helper for JUnit

Useful for testing java/kotlin programs interaction with the command line.

How to install

Include the following dependency on your pom file:

<dependency>
    <groupId>pt.ulusofona.deisi</groupId>
    <artifactId>stdin-stdout-junit-helper</artifactId>
    <version>0.1.0</version>
</dependency>

How to use

class TestStdinStdout {

    @Test
    public void testAskName() {
        StdinStdoutHelper helper = new StdinStdoutHelper()
                .expectOutput("Enter your name")
                .simulateInput("Pedro")
                .expectOutput("Your name is Pedro");

        helper.start();
        main(null);
        helper.stop();
    }
}
pt.ulusofona.deisi

Versions

Version
0.1.0