From 19ec71546127d756345cd67bc0e469dba862c0af Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 29 May 2021 14:19:32 +0200 Subject: [PATCH] Revert "Add test for PGPainlessCLI main class" This reverts commit af6fe0aaf709b9dda290f3d72f618b736db5c762. --- .../org/pgpainless/sop/MainClassTest.java | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 pgpainless-sop/src/test/java/org/pgpainless/sop/MainClassTest.java diff --git a/pgpainless-sop/src/test/java/org/pgpainless/sop/MainClassTest.java b/pgpainless-sop/src/test/java/org/pgpainless/sop/MainClassTest.java deleted file mode 100644 index 9c86ee9e..00000000 --- a/pgpainless-sop/src/test/java/org/pgpainless/sop/MainClassTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2021 Paul Schaub. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.pgpainless.sop; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.ByteArrayOutputStream; -import java.io.OutputStream; -import java.io.PrintStream; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -public class MainClassTest { - - private static OutputStream originalSout; - - @BeforeAll - public static void saveOriginalSout() { - originalSout = System.out; - } - - @Test - public void testMainByVersionCommand() { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - System.setOut(new PrintStream(out)); - PGPainlessCLI.main(new String[] {"version"}); - String version = out.toString(); - assertTrue(version.startsWith("PGPainlessCLI")); - } - - @AfterAll - public static void restoreOriginalSout() { - System.setOut(new PrintStream(originalSout)); - } -}