* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.util;
import static org.junit.Assert.assertTrue;
*/
@Test
public void test() {
- //setup, this will catch main's print statements for evaluation
+ // setup, this will catch main's print statements for evaluation
PrintStream oldOutputStream = System.out;
System.setOut(new PrintStream(testOut));
- /* ------ TEST OBFUSCATION ----*/
- JettyObfuscationConversionCommandLineUtil.main(new String[]{"-e", "hello world"});
+ /* ------ TEST OBFUSCATION ---- */
+ JettyObfuscationConversionCommandLineUtil.main(new String[] {"-e", "hello world"});
/*
* testOut was also catching any logging statements which interfered with result checking.
* This regex business was the workaround - it tries to find the expected value in
Matcher obfMatch = obfExpectPat.matcher(obfResult);
assertTrue(obfMatch.find());
- testOut.reset(); //clear out previous result
+ testOut.reset(); // clear out previous result
/* ------ TEST DEOBFUSCATION ----- */
- JettyObfuscationConversionCommandLineUtil.main(new String[]{"-d", obfExpected});
+ JettyObfuscationConversionCommandLineUtil.main(new String[] {"-d", obfExpected});
String deobfResult = testOut.toString();
String deobfExpected = "hello world";
Pattern deobfExpectPat = Pattern.compile(deobfExpected);
Matcher deobfMatch = deobfExpectPat.matcher(deobfResult);
assertTrue(deobfMatch.find());
- //clean up, resets to stdout
+ // clean up, resets to stdout
System.setOut(oldOutputStream);
}
-
/**
* Test.
*/
public void testUsage() {
System.setOut(new PrintStream(testOut));
- /* ------ TEST OBFUSCATION ----*/
- JettyObfuscationConversionCommandLineUtil.main(new String[]{"-f", "hello world"});
+ /* ------ TEST OBFUSCATION ---- */
+ JettyObfuscationConversionCommandLineUtil.main(new String[] {"-f", "hello world"});
/*
* testOut was also catching any logging statements which interfered with result checking.
* This regex business was the workaround - it tries to find the expected value in
*/
String obfResult = testOut.toString();
assertTrue(obfResult.startsWith("failed to parse input"));
-
- testOut.reset(); //clear out previous result
+ testOut.reset(); // clear out previous result
}