1 23 24 29 30 package com.sun.enterprise.config.serverbeans.validation.tests; 31 32 import junit.framework.*; 33 import junit.textui.TestRunner; 34 35 39 public class StaticTestTest extends TestCase { 40 41 public StaticTestTest(String name) throws Exception { 42 super(name); 43 } 44 45 52 public void testIsClassPathValid() { 53 String validPath = null; 54 String invalidPath = "badPath"; 55 String OS = System.getProperty("os.name"); 56 if(OS.startsWith("Win")) { 57 validPath = "C:/Sun/appserver8/jdk"; 58 } else { 59 validPath = "/export/appserver8/jdk"; 60 } 61 Assert.assertTrue(StaticTest.classPathCheck); 62 Assert.assertTrue(StaticTest.isClassPathValid(validPath)); 63 Assert.assertFalse(StaticTest.isClassPathValid(invalidPath)); 64 } 65 66 protected void setUp() { 67 } 68 69 protected void tearDown() { 70 } 71 72 public static junit.framework.Test suite() { 73 TestSuite suite = new TestSuite(StaticTestTest.class); 74 return suite; 75 } 76 77 public static void main(String args[]) throws Exception { 78 final TestRunner runner= new TestRunner(); 79 final TestResult result = runner.doRun(StaticTestTest.suite(), false); 80 System.exit(result.errorCount() + result.failureCount()); 81 } 82 83 } 84 | Popular Tags |