Java Doc for ReferenceTest.java in  » Database-ORM » db-ojb » org » apache » ojb » broker » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » db ojb » org.apache.ojb.broker 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.ojb.junit.PBTestCase
   org.apache.ojb.broker.ReferenceTest

ReferenceTest
public class ReferenceTest extends PBTestCase (Code)
Test case for checking the management of references.
author:
   Armin Waibel
version:
   $Id: ReferenceTest.java,v 1.17.2.4 2005/10/06 15:21:41 arminw Exp $

Inner Class :public static class Repository implements Serializable
Inner Class :public static class RepositoryFK extends Repository
Inner Class :public static interface ReferenceIF extends Serializable
Inner Class :public static interface ReferenceAIF extends Serializable
Inner Class :public static interface ReferenceBIF extends Serializable
Inner Class :public static class Reference implements ReferenceIF
Inner Class :public static class ReferenceA extends Reference implements ReferenceAIF
Inner Class :public static class ReferenceB extends Reference implements ReferenceBIF
Inner Class :abstract public static class Animal
Inner Class :public static class Mammal extends Animal
Inner Class :public static class Bird extends Animal
Inner Class :public static class Fish extends Animal
Inner Class :public static class Wine
Inner Class :public static class Region
Inner Class :public static interface RefObject
Inner Class :public static class ObjA implements RefObject
Inner Class :public static class ObjB extends ObjA
Inner Class :public static class ObjC extends ObjA



Method Summary
public static  voidmain(String[] args)
    
public  voidtearDown()
    
public  voidtestAbstractReferenceDelete()
    
public  voidtestAbstractReferenceQuery()
    
public  voidtestAbstractReferenceStore()
    
public  voidtestAutoUpdateDeleteSettings()
    
public  voidtestDeepPathQuery()
    
public  voidtestDeleteReferencesMappedToSameTable()
    
public  voidtestDeleteReferencesMappedToSameTable_2()
    
public  voidtestDeleteReferencesMappedToSameTable_3()
    
public  voidtestDeleteWithMultiplePK()
    
public  voidtestGetReferencesByIdentityMappedToSameTable()
    
public  voidtestHandlingOfMultiplePKFields()
     not really a reference test, here we check handling of objects with multiple PK fields.
public  voidtestInterfaceAsCollectionRef_1()
     Test the usage of interface as class-ref in collection-descriptor when using inheritance.
public  voidtestInterfaceAsCollectionRef_2()
     Test the usage of interface as class-ref in collection-descriptor when using inheritance.
public  voidtestMassOperations()
    
public  voidtestQueryExtentsWithAutoRefreshEnabled()
    
public  voidtestQueryReferencesMappedToSameTable()
    
public  voidtestRepositoryFKStore()
     This test does the same as the ReferenceTest.testRepositoryFKStore , but the used mapping data differ. RepositoryFK defines all the reference fields as primary key in field-descriptors.
public  voidtestStoreReferencesMappedToSameTable()
    
public  voidtestStoreWithMultiplePK_1()
    
public  voidtestStoreWithMultiplePK_2()
    
public  voidtestStoreWithMultiplePK_3()
    



Method Detail
main
public static void main(String[] args)(Code)



tearDown
public void tearDown()(Code)



testAbstractReferenceDelete
public void testAbstractReferenceDelete() throws Exception(Code)
this test case use an abstract class as reference
throws:
  Exception -



testAbstractReferenceQuery
public void testAbstractReferenceQuery() throws Exception(Code)



testAbstractReferenceStore
public void testAbstractReferenceStore() throws Exception(Code)
this test case use an abstract class as reference
throws:
  Exception -



testAutoUpdateDeleteSettings
public void testAutoUpdateDeleteSettings()(Code)



testDeepPathQuery
public void testDeepPathQuery()(Code)



testDeleteReferencesMappedToSameTable
public void testDeleteReferencesMappedToSameTable()(Code)



testDeleteReferencesMappedToSameTable_2
public void testDeleteReferencesMappedToSameTable_2()(Code)



testDeleteReferencesMappedToSameTable_3
public void testDeleteReferencesMappedToSameTable_3()(Code)



testDeleteWithMultiplePK
public void testDeleteWithMultiplePK()(Code)



testGetReferencesByIdentityMappedToSameTable
public void testGetReferencesByIdentityMappedToSameTable()(Code)



testHandlingOfMultiplePKFields
public void testHandlingOfMultiplePKFields() throws Exception(Code)
not really a reference test, here we check handling of objects with multiple PK fields. Such an object was used in following reference tests.



testInterfaceAsCollectionRef_1
public void testInterfaceAsCollectionRef_1()(Code)
Test the usage of interface as class-ref in collection-descriptor when using inheritance.



testInterfaceAsCollectionRef_2
public void testInterfaceAsCollectionRef_2()(Code)
Test the usage of interface as class-ref in collection-descriptor when using inheritance.



testMassOperations
public void testMassOperations()(Code)



testQueryExtentsWithAutoRefreshEnabled
public void testQueryExtentsWithAutoRefreshEnabled() throws Exception(Code)
Test for OJB-49



testQueryReferencesMappedToSameTable
public void testQueryReferencesMappedToSameTable()(Code)



testRepositoryFKStore
public void testRepositoryFKStore()(Code)
This test does the same as the ReferenceTest.testRepositoryFKStore , but the used mapping data differ. RepositoryFK defines all the reference fields as primary key in field-descriptors. Further on the used database table declares the reference fields as PK too. Based on a user post: > The following fails to be stored by PersistenceBroker: > > I have a class ACL which has two primary keys: objectId and userFK, and > userFK is also a foreign key tied to a reference of type User. If I do this: > > persistentBroker.beginTransaction(); > ACL acl = new ACL(); > acl.setObjectId( 100 ); > acl.setUser( currentUser ); > persistentBroker.store(acl); > persistentBroker.commitTransaction(); > > Acl will not be saved. The reason seems to be because in the storeToDb() > method of the PersistentBroker, there first comes an assertion of the > PrimaryKeys and afterwards comes the assignment of all the foreign keys. In > the scenario above the assertion of the primary keys will fail, because the > userFK has not been assigned yet, so we have an incomplete set of primary > keys. This does work with the ODMG layer, probably because of a different > sequence of events during the storing of the object. > > I wonder if there should be a check whether a primary key is shared by the > foreign key and allow that assignment before the assertion of the primary > keys is performed. Any ideas? > > Cheers, > --Bill.



testStoreReferencesMappedToSameTable
public void testStoreReferencesMappedToSameTable()(Code)



testStoreWithMultiplePK_1
public void testStoreWithMultiplePK_1() throws Exception(Code)



testStoreWithMultiplePK_2
public void testStoreWithMultiplePK_2() throws Exception(Code)



testStoreWithMultiplePK_3
public void testStoreWithMultiplePK_3() throws Exception(Code)



Fields inherited from org.apache.ojb.junit.PBTestCase
public PersistenceBroker broker(Code)(Java Doc)

Methods inherited from org.apache.ojb.junit.PBTestCase
public String getPlatformClass()(Code)(Java Doc)
public void pbPersist(Object obj)(Code)(Java Doc)
public void setUp() throws Exception(Code)(Java Doc)
public void tearDown() throws Exception(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.