1 package org.tanukisoftware.wrapper.test; 2 3 27 28 import org.tanukisoftware.wrapper.WrapperManager; 29 30 36 public class SystemProperty 37 { 38 private static int m_exitCode = 0; 39 40 43 public static void main( String [] args ) 44 { 45 testProperty( "VAR1", "abc" ); 46 testProperty( "VAR2", "\\" ); 47 testProperty( "VAR3", "\"" ); 48 testProperty( "VAR4", "abc" ); 49 testProperty( "VAR5", "\\" ); 50 testProperty( "VAR6", "\\\\" ); 51 testProperty( "VAR7", "\"" ); 52 53 System.out.println("Main complete."); 54 55 System.exit( m_exitCode ); 56 } 57 58 private static void testProperty( String name, String expectedValue ) 59 { 60 System.out.println( "Testing system property: " + name ); 61 System.out.println( " Expected:" + expectedValue ); 62 63 String value = System.getProperty( name ); 64 System.out.println( " Value :" + value ); 65 66 if ( expectedValue.equals( value ) ) 67 { 68 System.out.println( " OK" ); 69 } 70 else 71 { 72 System.out.println( " FAILED!!!" ); 73 m_exitCode = 1; 74 } 75 76 System.out.println(); 77 } 78 } 79 80 | Popular Tags |