1 64 65 package com.jcorporate.expresso.core.controller.tests; 66 67 import com.jcorporate.expresso.core.controller.SecureIfSetController; 68 import com.jcorporate.expresso.services.test.ExpressoTestCase; 69 70 73 public class TestSecureIfSetController extends ExpressoTestCase { 74 75 public TestSecureIfSetController(String _name) throws Exception { 76 super(_name); 77 } 78 79 82 protected void setUp() throws Exception { 83 super.setUp(); 84 } 85 86 89 protected void tearDown() throws Exception { 90 super.tearDown(); 91 } 92 93 96 public void testIsDBConnectionAvailable() { 97 SecureIfSetController sf = new TestSecureIfSetController.TestController(); 98 boolean result = sf.isDBConnectionAvailable("default"); 99 assertTrue("default connection should be available", result == true); 100 101 result = sf.isDBConnectionAvailable("abitkghaigkhksksm,,,,s"); 102 assertTrue("nonsense connection should NOT be available", result == false); 103 104 } 105 106 109 public static void main(String [] argv) { 110 String [] testCaseList = {TestSecureIfSetController.class.getName()}; 111 junit.textui.TestRunner.main(testCaseList); 112 } 113 114 class TestController extends SecureIfSetController { 115 TestController() { 116 super(); 117 } 118 119 } 120 } 121 | Popular Tags |