org.apache.jdo.tck.api.instancecallbacks
Class InstanceLifecycleListenerAttach

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.jdo.tck.JDO_Test
              extended byorg.apache.jdo.tck.api.instancecallbacks.AbstractInstanceLifecycleListener
                  extended byorg.apache.jdo.tck.api.instancecallbacks.InstanceLifecycleListenerAttach
All Implemented Interfaces:
junit.framework.Test

public class InstanceLifecycleListenerAttach
extends AbstractInstanceLifecycleListener

Title: Test TestInstanceLifecycleListenerAttach
Keywords: LifeCycleListener preAttach postAttach
Assertion IDs: A12.15-13 A12.15-14
Assertion Description: A12.15-13 void preAttach(InstanceLifecycleEvent event); This method is called before a detached instance is attached. The source instance is the detached instance]. A12.15-14 void postAttach(InstanceLifecycleEvent event); This method is called after a detached instance is attached. The source instance is the corresponding persistent instance in the cache; the target instance is the detached instance.


Nested Class Summary
static class InstanceLifecycleListenerAttach.PC
          The persistence-capable class that implements the attach callback.
 
Nested classes inherited from class org.apache.jdo.tck.api.instancecallbacks.AbstractInstanceLifecycleListener
AbstractInstanceLifecycleListener.InstanceLifecycleListenerImpl
 
Field Summary
 
Fields inherited from class org.apache.jdo.tck.api.instancecallbacks.AbstractInstanceLifecycleListener
ASSERTION1_FAILED, ASSERTION10_FAILED, ASSERTION11_FAILED, ASSERTION12_FAILED, ASSERTION13_FAILED, ASSERTION14_FAILED, ASSERTION2_FAILED, ASSERTION3_FAILED, ASSERTION4_FAILED, ASSERTION5_FAILED, ASSERTION6_FAILED, ASSERTION7_FAILED, ASSERTION8_FAILED, ASSERTION9_FAILED
 
Fields inherited from class org.apache.jdo.tck.JDO_Test
APPLICATION_IDENTITY, cleanupData, closePMFAfterEachTest, DATASTORE_IDENTITY, debug, DETACHED_CLEAN, DETACHED_DIRTY, HOLLOW, identitytype, ILLEGAL_STATE, logger, messages, NL, NUM_STATES, PERSISTENT_CLEAN, PERSISTENT_DELETED, PERSISTENT_DIRTY, PERSISTENT_NEW, PERSISTENT_NEW_DELETED, PERSISTENT_NONTRANSACTIONAL, PERSISTENT_NONTRANSACTIONAL_DIRTY, pm, pmf, PMFProperties, PMFPropertiesObject, states, testSucceeded, TRANSIENT, TRANSIENT_CLEAN, TRANSIENT_DIRTY
 
Constructor Summary
InstanceLifecycleListenerAttach()
           
 
Method Summary
protected  AbstractInstanceLifecycleListener.InstanceLifecycleListenerImpl getListener()
          Return the listener.
protected  java.lang.Class[] getPersistentClasses()
          Return the persistent classes.
static void main(java.lang.String[] args)
          The main is called when the class is directly executed from the command line.
 void testAttach()
          This test creates a new persistent instance and detaches it.
 
Methods inherited from class org.apache.jdo.tck.api.instancecallbacks.AbstractInstanceLifecycleListener
addListener, localSetUp, localTearDown, removeListener
 
Methods inherited from class org.apache.jdo.tck.JDO_Test
addTearDownClass, addTearDownClass, addTearDownInstance, addTearDownObjectId, appendMessage, cleanupPM, cleanupPM, closePMF, compareStates, currentState, deleteTearDownClasses, deleteTearDownInstances, dumpSupportedOptions, fail, failOnError, getAllObjects, getFailedPersistenceManagers, getModifiableFields, getPM, getPMF, getPMFProperty, getStateOfInstance, isApplicationIdentitySupported, isArrayListSupported, isArraySupported, isBinaryCompatibilitySupported, isChangeApplicationIdentitySupported, isClassLoadable, isDataStoreConnectionSupported, isDatastoreIdentitySupported, isHashMapSupported, isHashtableSupported, isJRE14orBetter, isLinkedListSupported, isListSupported, isMapSupported, isNonDurableIdentitySupported, isNontransactionalReadSupported, isNontransactionalWriteSupported, isNullCollectionSupported, isOptimisticSupported, isRetainValuesSupported, isSQLSupported, isTestToBePerformed, isTransientTransactionalSupported, isTreeMapSupported, isTreeSetSupported, isUnconstrainedVariablesSupported, isVectorSupported, loadProperties, mangleObject, printNonApplicableIdentityType, printUnsupportedOptionalFeatureNotTested, retrieveMessages, runBare, runsWithApplicationIdentity, setUp, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runTest, 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, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceLifecycleListenerAttach

public InstanceLifecycleListenerAttach()
Method Detail

getListener

protected AbstractInstanceLifecycleListener.InstanceLifecycleListenerImpl getListener()
Return the listener.

Specified by:
getListener in class AbstractInstanceLifecycleListener

getPersistentClasses

protected java.lang.Class[] getPersistentClasses()
Return the persistent classes.

Specified by:
getPersistentClasses in class AbstractInstanceLifecycleListener

main

public static void main(java.lang.String[] args)
The main is called when the class is directly executed from the command line.

Parameters:
args - The arguments passed to the program.

testAttach

public void testAttach()
This test creates a new persistent instance and detaches it. The instance is attached in a new transaction, which causes the attach callbacks and listeners to be called.



Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.