com.ail.coretest
Class TestTypeXpath

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.ail.coretest.CoreUserTestCase
              extended by com.ail.coretest.TestTypeXpath
All Implemented Interfaces:
ConfigurationOwner, CoreUser, java.io.Serializable, junit.framework.Test

public class TestTypeXpath
extends CoreUserTestCase

Version:
$Revision: 1.9 $
See Also:
Serialized Form

Nested Class Summary
static class TestTypeXpath.TestFunctions
          Define a few simple functions for use from JXPath expressions
 
Constructor Summary
TestTypeXpath(java.lang.String name)
          Constructs a test case with the given name.
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testAttributeXpathGetAndSet()
          Test some attribute xpaths
 void testCollection()
           
 void testComplexXpathGetAndSet()
          Test some more complex gets and sets using Type's xpath methods.
 void testFunctions()
           
 void testSimpleXpathGetAndSet()
          Test some simple gets and sets using Type's xpath methods.
 void testXpathFunctionRegistration()
           
 
Methods inherited from class com.ail.coretest.CoreUserTestCase
getConfiguration, getConfigurationNamespace, getCore, getSecurityPrincipal, getVersionEffectiveDate, resetConfiguration, setConfiguration, setCore, setupSystemProperties, setVersionEffectiveDate
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestTypeXpath

public TestTypeXpath(java.lang.String name)
Constructs a test case with the given name.

Method Detail

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)

testSimpleXpathGetAndSet

public void testSimpleXpathGetAndSet()
                              throws java.lang.Exception
Test some simple gets and sets using Type's xpath methods. Type offers support for processing XPATH expressions against a Type's instance. This test performs some basic checks to ensure the support is working.
  1. Create an instance of Version (Author="J.R.Hartley", Version="2").
  2. Fail if the xpath "author" doesn't return "J.R.Hartley".
  3. Fail if the xpath "version" doesn't return "2".
  4. Fail if the xpath "version" specifying Integer as the return doesn't return Integer(2).
  5. Use xpathSet to set "version" to "45"
  6. Fail if the xpath "version" specifying Integer as the return doesn't return Integer(45).
  7. Fail if any exceptions are thrown

Throws:
java.lang.Exception

testComplexXpathGetAndSet

public void testComplexXpathGetAndSet()
                               throws java.lang.Exception
Test some more complex gets and sets using Type's xpath methods. Type offers support for processing XPATH expressions against a Type's instance. This test performs some basic checks to ensure the support is working.

Throws:
java.lang.Exception

testAttributeXpathGetAndSet

public void testAttributeXpathGetAndSet()
                                 throws java.lang.Exception
Test some attribute xpaths

Throws:
java.lang.Exception

testFunctions

public void testFunctions()

testXpathFunctionRegistration

public void testXpathFunctionRegistration()

testCollection

public void testCollection()