GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Tags · locationlabs/system-rules

Tags

system-rules-1.19.0

Toggle system-rules-1.19.0's commit message
Raw bytes of System.out and System.err are logged

SystemErrRule and SystemOutRule have a new method "getLogAsBytes" which
returns the raw bytes that have been written to System.err/System.out.
This method can be used for testing applications that write raw binary
data.

Fixes stefanbirkner#66.

Co-authored-by: Stefan Birkner <[email protected]>
  • Nov 14, 2018
  • f4782eb
  • zip
  • tar.gz

system-rules-1.18.0

Toggle system-rules-1.18.0's commit message
Variables can be set after creating the rule

Some environment variables have the same value for all tests. Someone
who reads the test can easily recognize this when the set and clear
methods for these variables are directly called within the statement
that creates the EnvironmentVariables rule.

    @rule
    public final EnvironmentVariables environmentVariables
        = new EnvironmentVariables()
            .set("name", "value")
            .clear("another variable");

This also fixes a bug where the environment variables are not reset when
the set and clear methods are called from within the static initializer
of the EnvironmentVariables rule. E.g.

    @rule
    public final EnvironmentVariables environmentVariables
        = new EnvironmentVariables() {{
            set("dummy variable", "dummy value"
        }};

Fixes stefanbirkner#49 and stefanbirkner#61.
  • May 18, 2018
  • 063b1c8
  • zip
  • tar.gz

system-rules-1.17.2

Toggle system-rules-1.17.2's commit message
Make TextFromStandardInputStream Java 5 compatible

System Rules supports Java 5, but String#getBytes(Charset) is not part
of the Java 5 API.
  • May 6, 2018
  • 4e2328b
  • zip
  • tar.gz

system-rules-1.17.1

Toggle system-rules-1.17.1's commit message
Fix ProvideSystemProperty's static factory methods

These methods have been able to throw a checked exception. Therefore
they couldn't be used to directly initialize the rule like in the
following code.

    @rule
    public final ProvideSystemProperty provideSystemProperty
        = fromResource("some.properties");

This is now fixed by wrapping the IOException with a RuntimeException.
  • Jan 23, 2018
  • 3184a6e
  • zip
  • tar.gz

system-rules-1.17.0

Toggle system-rules-1.17.0's commit message
Add EnvironmentVariables#clear(String...)

The code

    environmentVariables.clear("some variable");

has better semantics than

    environmentVariables.set("some variable", null);

Fixes stefanbirkner#53.
  • Nov 16, 2017
  • d55309f
  • zip
  • tar.gz

system-rules-1.16.1

Toggle system-rules-1.16.1's commit message
RestoreSystemProperties sets correct properties.

RestoreSystemProperties now replaces the system properties with a copy
of the original properties. This ensures that the properties behave like
the original properties. That was not the case before. E.g. the
`contains` method returned `false` for a property that has been
originally set but was not modified in the test.

Fixes stefanbirkner#43.
  • Sep 4, 2016
  • 1a76ea9
  • zip
  • tar.gz

system-rules-1.16.0

Toggle system-rules-1.16.0's commit message
Add rule for modifying environment variables.

By default environment variables cannot be set in Java code. You have
to modify internals in order to set them. This task is hidden by the
rule. In addition every change to environment variables is reverted
after the test.
  • Feb 8, 2016
  • e778307
  • zip
  • tar.gz

system-rules-1.15.1

Toggle system-rules-1.15.1's commit message
Improve emulation of System.in.

`System.in.read()` blocks until it faces the EOL character(s). This
cannot be easily emulated because that behaviour is implemented in
native code.

The first attempt was sending -1 after the end of each text or line.
This is an insufficient solution because -1 indicates the end of the
stream. It seems that the blocking behaviour is mainly needed for code
that uses Scanner (which uses `System.in.read(byte[], int, int)`
internally.) Hence the -1 hack was replaced by an enhanced
implementation of `read(byte[], int, int)` that returns the whole next
line.

Fixes stefanbirkner#35.
  • Dec 17, 2015
  • 65fac9d
  • zip
  • tar.gz

system-rules-1.15.0

Toggle system-rules-1.15.0's commit message
Don't use TeeOutputStream.

Implementing an own OutputStream makes the code simpler. Additionally it
avoids the dependency to commons-io. (Fixes stefanbirkner#32.)
  • Dec 3, 2015
  • 033fd51
  • zip
  • tar.gz

system-rules-1.14.0

Toggle system-rules-1.14.0's commit message
Add rules that disallow writes to console.

The rules `DisallowWriteToSystemErr` and `DisallowWriteToSystemOut` let
tests fail if they try to write to `System.err` or `System.out`. The
rules are a nice replacement for static code analysis because they cover
external libraries, too.
  • Nov 24, 2015
  • 30a3aaa
  • zip
  • tar.gz
PreviousNext
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.