1 19 package org.enhydra.zeus.util; 20 21 import junit.framework.Test; 23 import junit.framework.TestCase; 24 import junit.framework.TestSuite; 25 26 33 public class SchemaUtilsTest extends TestCase { 34 35 42 public SchemaUtilsTest(String name) { 43 super(name); 44 } 45 46 55 public static Test suite(){ 56 return new TestSuite(SchemaUtilsTest.class); 57 } 58 59 64 public void testGetJavaType() { 65 String xmlType = "string"; 66 String javaType = "String"; 67 68 try { 69 assertEquals(javaType, SchemaUtils.getJavaType(xmlType)); 70 } catch (UnsupportedSchemaTypeException e) { 71 assertTrue(false); 72 } 73 } 74 75 81 public void testGetJavaTypeNegative() { 82 String xmlType = "someRandomType"; 83 boolean caught = false; 84 85 try { 86 String temp = SchemaUtils.getJavaType(xmlType); 87 } catch (UnsupportedSchemaTypeException e) { 88 caught = true; 89 } 90 assertTrue(caught); 91 } 92 } 93 | Popular Tags |