@@ -0,0 +1,1995 @@
+package co.vorobyev.exitsign;%0A%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.contrib.java.lang.system.ExpectedSystemExit;%0A%0A/** imports statically exit statuses */%0Aimport java.util.Arrays;%0A%0Aimport static co.vorobyev.exitsign.ExitStatus.*;%0A%0A/**%0A * Integration test as example demonstrating exit status usage.%0A *%0A * @since 0.1%0A *%0A * @author %3Ca href=%22http://vorobyev.co%22%3EAnton Vorobyev%3C/a%3E%0A *%0A */%0Apublic class ExitStatusIT %7B%0A%0A    @Rule%0A    public final ExpectedSystemExit exit = ExpectedSystemExit.none();%0A%0A    /** Utility constant imitating valid arguments */%0A    public static final String%5B%5D validArgs = %7B %22valid%22 %7D;%0A%0A    /** Utility constant imitating invalid arguments */%0A    public static final String%5B%5D invalidArgs = %7B %22invalid%22 %7D;%0A%0A    /**%0A     * This is example class that demonstrates 'main class' with using exit statuses.%0A     *%0A     */%0A    public static class App %7B%0A%0A        /**%0A         * Validates application arguments.%0A         *%0A         * @param args application arguments.%0A         * @return true if arguments is valid else false.%0A         */%0A        private static boolean isValid(String%5B%5D args) %7B%0A            if (Arrays.equals(args, validArgs))%0A                return true;%0A            else%0A                return false;%0A        %7D%0A%0A        /**%0A         * Executes app with propounded arguments.%0A         *%0A         * @param args app arguments.%0A         */%0A        public static void main(String... args) %7B%0A            int exitStatus;%0A%0A            if (isValid(args))%0A                exitStatus = SUCCESS;%0A            else%0A                exitStatus = FAILURE;%0A%0A            System.exit(exitStatus);%0A        %7D%0A%0A    %7D%0A%0A%0A    @Test%0A    public void appShouldExitSuccessfulyWhenValidArgs() throws Exception %7B%0A        exit.expectSystemExitWithStatus(SUCCESS);%0A        App.main(validArgs);%0A    %7D%0A%0A    @Test%0A    public void appShouldExitFailureWhenInvalidArgs() throws Exception %7B%0A        exit.expectSystemExitWithStatus(FAILURE);%0A        App.main(invalidArgs);%0A    %7D%0A%0A%7D%0A

Add integration test as examples for primitive type usage