1 16 17 package org.apache.avalon.util.env; 18 19 import junit.framework.TestCase; 20 21 22 28 public class EnvTest extends TestCase 29 { 30 public static void main(String [] args) 31 { 32 junit.textui.TestRunner.run(EnvTest.class); 33 } 34 35 36 39 protected void setUp() throws Exception 40 { 41 super.setUp(); 42 } 43 44 45 48 protected void tearDown() throws Exception 49 { 50 super.tearDown(); 51 } 52 53 54 58 public EnvTest(String arg0) 59 { 60 super(arg0); 61 } 62 63 64 final public void testEnvVariable() 65 throws Exception 66 { 67 if ( Env.isUnix() ) 68 { 69 assertNotNull( Env.getEnvVariable( "PATH" ) ) ; 70 } 71 72 if ( Env.isWindows() ) 73 { 74 assertNotNull( Env.getEnvVariable( "Path" ) ) ; 75 } 76 77 assertNull( Env.getEnvVariable( "PAT" ) ) ; 78 } 79 80 81 public void testEnv() 82 throws EnvAccessException 83 { 84 Env l_env = new Env() ; 85 assertNull( l_env.getProperty( "PAT" ) ) ; 86 87 if ( Env.isUnix() ) 88 { 89 assertNotNull( l_env.getProperty( "PATH" ) ) ; 90 } 91 92 if ( Env.isWindows() ) 93 { 94 assertNotNull( l_env.getProperty( "PROMPT" ) ) ; 95 } 96 } 97 } 98 | Popular Tags |