com.counterclaim.openefm.model.lxml
Class BaseLxmlTestCase

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended bycom.counterclaim.openefm.BaseTestCase
              extended bycom.counterclaim.openefm.model.lxml.BaseLxmlTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
LegalEnvelope117LxmlTestCase

public abstract class BaseLxmlTestCase
extends BaseTestCase

This tests the XPath queries for different kinds of InternalLxmlFiling objects. It calls the query methods in InternalLxmlFilingImpl, checking first for non-null responses, then compares each one with the instance member counterpart defined (but not initialized) in this class. Thus, subclasses just need in the constructor to set the 'lxmlFilePath'--which should be a build-dir-relative path to a particular lxml sample file--and to provide expected values for those xpath queries in the '*Expected' and the '*Input' members.

The '*Expected' members which are Objects are checked to ensure they are instances of the class returned by the corresponding query method. The ones which are native ints are for queries which return a list: all we are checking for in those cases is the sizes of the lists returned. The '*Input' members are the inputs to the query methods in InternalLxmlFilingImpl. (Since only one 'docIdInput' is declared, that one ID must serve for all relevant queries.)

The static 'NON_NULL' constant can be assigned to an expected value if the test should only check for not null. This is handy when the expected value is too lengthy or volatile to be hard-coded.

 

Field Summary
(package private)  java.lang.Object actorAddressCityExpected
           
(package private)  java.lang.Object actorAddressCountryExpected
           
(package private)  java.lang.Object actorAddressCountyExpected
           
(package private)  int actorAddressLinesExpected
           
(package private)  java.lang.Object actorAddressStateExpected
           
(package private)  java.lang.Object actorAddressZipExpected
           
(package private)  java.lang.Object actorEmailExpected
           
(package private)  java.lang.Object actorFirstNameExpected
           
(package private)  java.lang.Object actorFullNameExpected
           
(package private)  java.lang.String actorIdInput
           
(package private)  int actorIdsExpected
           
(package private)  int actorIdsWithRoleExpected
           
(package private)  java.lang.Object actorLastNameExpected
           
(package private)  java.lang.Object actorMiddleNameExpected
           
(package private)  java.lang.Object actorPhoneExpected
           
(package private)  java.lang.Object actorRoleNameExpected
           
(package private)  int actorRoleWithIdsExpected
           
(package private)  java.lang.Object actorTitleExpected
           
(package private)  java.lang.Object caseCategoryExpected
           
(package private)  java.lang.Object caseTitleExpected
           
(package private)  java.lang.Object caseYearExpected
           
(package private)  java.lang.Object courtLocationQualifierExpected
           
(package private)  java.lang.Object courtNameExpected
           
(package private)  java.lang.Object courtTypeExpected
           
(package private)  java.lang.Object creationExpected
           
(package private)  java.lang.Object creditAddressCityExpected
           
(package private)  java.lang.Object creditAddressCountryExpected
           
(package private)  java.lang.Object creditAddressCountyExpected
           
(package private)  int creditAddressLinesExpected
           
(package private)  java.lang.Object creditAddressStateExpected
           
(package private)  java.lang.Object creditAddressZipExpected
           
(package private)  java.lang.Object creditExpDateExpected
           
(package private)  java.lang.Object creditNumberExpected
           
(package private)  java.lang.Object creditOwnerExpected
           
(package private)  java.lang.String docIdInput
           
(package private)  int documentActorReferencesExpected
           
(package private)  int documentAttachmentIdsExpected
           
(package private)  java.lang.Object documentContentEncodingExpected
           
(package private)  java.lang.Object documentContentExpected
           
(package private)  java.lang.Object documentContentHrefExpected
           
(package private)  java.lang.Object documentContentIdExpected
           
(package private)  java.lang.Object documentContentMimeTypeExpected
           
(package private)  java.lang.Object documentContentSizeExpected
           
(package private)  java.lang.Object documentSubmittedExpected
           
(package private)  java.lang.Object documentTitleExpected
           
(package private)  java.lang.Object documentTypeExpected
           
(package private)  java.lang.Object filedByActorIdExpected
           
(package private)  java.lang.String filingActorRefInput
           
(package private)  java.lang.Object filingFeeExpected
           
(package private)  java.lang.Object filingFeeTypeExpected
           
(package private)  java.lang.String filingInformationIdInput
           
(package private)  int filingInformationIdsExpected
           
(package private)  java.lang.Object filingPartyEmailExpected
           
(package private)  int fromFullNamesExpected
           
(package private)  int fromURIsExpected
           
(package private)  java.lang.Object fullCaseNumberExpected
           
(package private)  java.lang.Object isNewCaseExpected
           
(package private)  java.lang.Object leadDocumentIdExpected
           
(package private)  java.lang.String lxmlFilePath
           
(package private)  int memosExpected
           
(package private)  java.lang.Object messageIdentificationExpected
           
(package private) static java.lang.Object NON_NULL
           
(package private)  java.lang.String roleInput
           
(package private)  int toFullNamesExpected
           
(package private)  int toURIsExpected
           
 
Fields inherited from class com.counterclaim.openefm.BaseTestCase
SAMPLE_LXML_PATH, SERVER_CONFIG_PATH
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
BaseLxmlTestCase(java.lang.String name)
          Construct a TestCase with the given name.
 
Method Summary
(package private)  void compare(int expectedSize, java.util.List actualList)
          Check a List object returned from a query method to make sure it is not null and has the expected number of elements.
(package private)  void compare(java.lang.Object expected, java.lang.Object actual)
          Compare the return value from a query method with the expected result, using the 'Object.equals()' method.
 void testQueries()
          Test the XPath query methods.
 
Methods inherited from class com.counterclaim.openefm.BaseTestCase
assertFalse, assertFalse, assertNegative, assertNegative, assertPositive, assertPositive, assertZero, assertZero, getController, getFilingContext, getId, getInternalLxmlFiling, getInternalLxmlFiling, getModel, getOzoneLxmlFiling, getOzoneObjectManager, getOzoneUser, getSampleInternalLxmlFiling, getSampleLxmlFiling, restartServer, setUp, startServer, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NON_NULL

static final java.lang.Object NON_NULL

lxmlFilePath

java.lang.String lxmlFilePath

filingInformationIdInput

java.lang.String filingInformationIdInput

docIdInput

java.lang.String docIdInput

roleInput

java.lang.String roleInput

actorIdInput

java.lang.String actorIdInput

filingActorRefInput

java.lang.String filingActorRefInput

messageIdentificationExpected

java.lang.Object messageIdentificationExpected

creationExpected

java.lang.Object creationExpected

courtLocationQualifierExpected

java.lang.Object courtLocationQualifierExpected

leadDocumentIdExpected

java.lang.Object leadDocumentIdExpected

documentActorReferencesExpected

int documentActorReferencesExpected

documentSubmittedExpected

java.lang.Object documentSubmittedExpected

documentTitleExpected

java.lang.Object documentTitleExpected

documentTypeExpected

java.lang.Object documentTypeExpected

documentContentExpected

java.lang.Object documentContentExpected

documentContentIdExpected

java.lang.Object documentContentIdExpected

documentContentSizeExpected

java.lang.Object documentContentSizeExpected

documentContentMimeTypeExpected

java.lang.Object documentContentMimeTypeExpected

documentContentEncodingExpected

java.lang.Object documentContentEncodingExpected

documentContentHrefExpected

java.lang.Object documentContentHrefExpected

documentAttachmentIdsExpected

int documentAttachmentIdsExpected

toFullNamesExpected

int toFullNamesExpected

toURIsExpected

int toURIsExpected

fromFullNamesExpected

int fromFullNamesExpected

fromURIsExpected

int fromURIsExpected

memosExpected

int memosExpected

actorIdsExpected

int actorIdsExpected

actorIdsWithRoleExpected

int actorIdsWithRoleExpected

actorFullNameExpected

java.lang.Object actorFullNameExpected

actorFirstNameExpected

java.lang.Object actorFirstNameExpected

actorMiddleNameExpected

java.lang.Object actorMiddleNameExpected

actorLastNameExpected

java.lang.Object actorLastNameExpected

actorRoleNameExpected

java.lang.Object actorRoleNameExpected

actorRoleWithIdsExpected

int actorRoleWithIdsExpected

actorTitleExpected

java.lang.Object actorTitleExpected

actorEmailExpected

java.lang.Object actorEmailExpected

actorPhoneExpected

java.lang.Object actorPhoneExpected

actorAddressLinesExpected

int actorAddressLinesExpected

actorAddressCityExpected

java.lang.Object actorAddressCityExpected

actorAddressCountyExpected

java.lang.Object actorAddressCountyExpected

actorAddressStateExpected

java.lang.Object actorAddressStateExpected

actorAddressZipExpected

java.lang.Object actorAddressZipExpected

actorAddressCountryExpected

java.lang.Object actorAddressCountryExpected

filingInformationIdsExpected

int filingInformationIdsExpected

filingFeeExpected

java.lang.Object filingFeeExpected

filingFeeTypeExpected

java.lang.Object filingFeeTypeExpected

creditNumberExpected

java.lang.Object creditNumberExpected

creditExpDateExpected

java.lang.Object creditExpDateExpected

creditOwnerExpected

java.lang.Object creditOwnerExpected

creditAddressLinesExpected

int creditAddressLinesExpected

creditAddressCityExpected

java.lang.Object creditAddressCityExpected

creditAddressCountyExpected

java.lang.Object creditAddressCountyExpected

creditAddressStateExpected

java.lang.Object creditAddressStateExpected

creditAddressZipExpected

java.lang.Object creditAddressZipExpected

creditAddressCountryExpected

java.lang.Object creditAddressCountryExpected

courtTypeExpected

java.lang.Object courtTypeExpected

courtNameExpected

java.lang.Object courtNameExpected

isNewCaseExpected

java.lang.Object isNewCaseExpected

fullCaseNumberExpected

java.lang.Object fullCaseNumberExpected

caseTitleExpected

java.lang.Object caseTitleExpected

caseCategoryExpected

java.lang.Object caseCategoryExpected

caseYearExpected

java.lang.Object caseYearExpected

filedByActorIdExpected

java.lang.Object filedByActorIdExpected

filingPartyEmailExpected

java.lang.Object filingPartyEmailExpected
Constructor Detail

BaseLxmlTestCase

public BaseLxmlTestCase(java.lang.String name)
Construct a TestCase with the given name.

Parameters:
name - a name for this test case
Method Detail

compare

void compare(java.lang.Object expected,
             java.lang.Object actual)
Compare the return value from a query method with the expected result, using the 'Object.equals()' method.

Parameters:
expected - the expected result
actual - the actual result of the call

compare

void compare(int expectedSize,
             java.util.List actualList)
Check a List object returned from a query method to make sure it is not null and has the expected number of elements.

Parameters:
expectedSize - the expected size of the list
actualList - the actual List returned from the call

testQueries

public void testQueries()
                 throws java.lang.Exception
Test the XPath query methods.

Throws:
java.lang.Exception


Copyright © 2002 counterclaim.com. All Rights Reserved.