1 package org.nanocontainer.script; 2 3 import junit.framework.*; 4 5 9 public class UnsupportedScriptTypeExceptionTestCase extends TestCase { 10 private UnsupportedScriptTypeException unsupportedScriptTypeException = null; 11 12 private final String [] supportedParams = new String []{".groovy",".py",".xml"}; 13 14 protected void setUp() throws Exception { 15 super.setUp(); 16 unsupportedScriptTypeException = new UnsupportedScriptTypeException("test.txt", supportedParams); 17 } 18 19 protected void tearDown() throws Exception { 20 unsupportedScriptTypeException = null; 21 super.tearDown(); 22 } 23 24 public void testGetMessage() { 25 String actualReturn = unsupportedScriptTypeException.getMessage(); 26 assertNotNull(actualReturn); 27 assertTrue(actualReturn.indexOf(".groovy") > -1); 28 assertTrue(actualReturn.indexOf(".py") > -1) ; 29 assertTrue(actualReturn.indexOf(".xml") > -1); 30 assertTrue(actualReturn.indexOf("test.txt") > -1); 31 } 32 33 public void testGetRequestedExtension() { 34 String expectedReturn = "test.txt"; 35 String actualReturn = unsupportedScriptTypeException.getRequestedExtension(); 36 assertEquals("return value", expectedReturn, actualReturn); 37 } 38 39 public void testGetSystemSupportedExtensions() { 40 String [] expectedReturn = supportedParams; 41 String [] actualReturn = unsupportedScriptTypeException.getSystemSupportedExtensions(); 42 assertEquals("return value", expectedReturn, actualReturn); 43 } 44 45 46 } 47 | Popular Tags |