Index: src/tests/tests.xml =================================================================== RCS file: /scm/castor/castor/src/tests/tests.xml,v retrieving revision 1.20 diff -u -r1.20 tests.xml --- src/tests/tests.xml 11 May 2005 17:18:52 -0000 1.20 +++ src/tests/tests.xml 1 Jun 2005 08:26:38 -0000 @@ -29,27 +29,29 @@ - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - @@ -93,27 +95,30 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - @@ -158,29 +163,27 @@ - - - - - - - - - + + + + + + + + + + + + + + + - + - - - - - - - - @@ -223,28 +226,33 @@ - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - + + + @@ -288,29 +296,31 @@ - - - - - - - - + + + + + + + + + + + + + + + + + - - + - - - - - - - + @@ -352,29 +362,31 @@ - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + - + @@ -416,27 +428,30 @@ - - - - - - - - + + + + + + + + + + + + + + + + + - + - - - - - - @@ -452,10 +467,6 @@ - - - - - - Table used for MAX key generator testing - - - - - - - - - - - Table used for MAX key generator testing - - - - - - - - Table used for HIGH-LOW key generator testing - - - - - - - - - - - Table used for HIGH-LOW key generator testing - - - - - - - - Table used for HIGH-LOW key generator testing with same-connection=true - - - - - - - - - - - Table used for HIGH-LOW key generator testing with same-connection=true - - - - - - - - Table used for SEQUENCE key generator testing - - - - - - - - - - - Table used for SEQUENCE key generator testing - - - - - - - - Table used for IDENTITY key generator testing - - - - - - - - - - - Table used for IDENTITY key generator testing - - - - - - - - Table used for SEQUENCE key generator testing in RETURNING - mode for Oracle8i - - - - - - - - - - - - Table used for SEQUENCE key generator testing in RETURNING - mode for Oracle8i - - - - - - - - - Table used for UUID key generator testing - - - - - - - - - - - Table used for UUID key generator testing - - - - - - Test Persistent interface handling @@ -764,22 +497,4 @@ - - - - - - - - - - - - - - - - - - Index: lib/mysql-connector-java-3.0.16-ga-bin.jar =================================================================== RCS file: lib/mysql-connector-java-3.0.16-ga-bin.jar diff -N lib/mysql-connector-java-3.0.16-ga-bin.jar --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lib/mysql-connector-java-3.0.16-ga-bin.jar 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2011 @@ +PK +qp1 META-INF/PK +pp1.p%¤[gMETA-INF/MANIFEST.MFóMÌËLK-.Ñ +K-*ÎÌϳR0Ô3àårÌCq,HLÎHUŠ%ÍôŒx¹œ‹RKRSt?*AêMôŒt“Œ,4‚Kó|3“‹ò‹+‹KRs‹<ó’õ4y¹x¹PK +fp1yºÉ’ÁKCOPYING?\[sÛÈ•~ÎüŠ.½XÚ¢5±³™dF[©¢$Êf"‘’²GoÉ&‰4 ™ÿ~¿séF$•Ù?J]ØÜÙþëä??ü`èŸ?ПˆÀ`4˜ôïÍãÓõýðÆàÿƒÑt=„¾ØÒ¥En>öÌßëÜš?ÿüAž??oŠÝ¾Lכʜß\àÛ¿þÜãgÌ]i­™«ê5)­¹+ê|™T Ô3Ã|q©‹`•Ÿþògó?8gú/¶gn’í¼L—küçCßüñã‡??ÞÓ´/Ï^l¹/ÀEêÌΖ۴ªìÒT…Y€ “äK³L]U¦óº²Ïα▾L­ +ÅÊT¼?‰°Ì²XÔ[›W=ƒwÌb“äë4_›´¢%ò¢2I–¯vyïù,œÇÒ‚ÙÌÆßÌ6Ö“vfU”f[¸Ê8/úÿÒºt? ÛUò +¾&{³/êRH¬ ·e±¥¯Ý†_¶˜1l»º4æz?åU™8p]aÁOº ”T!h'i^Ù|)‹®ë¤LðwË‹¾¹}'´üÞ¿Çs[bÛÕx––»Ã:ôïb·ÎÔúsI‚IõŽk­Iv» §Dl°Ìø l[‹„@£Jï\$Úœ7—ä{SàÅÒìÊb]&[óº)ˆ|]mŠÒAr[h +žZµ“Ó‡çÓbkõÝSºÛÚ뢀†A¤ó½ÐòGqŸÎˤܟÚhš»Ê&ËË cž‹Ú,’œ÷¾7[|0º‡C.Š–þ}ÝØÜ¼Bò;›|#I±Ø=o=úŠx,íÊ–%m‚Ñcî‘R •] ްñ1Ö:Ϋ;PØøä“ŠøZ›äE”!Ò¦ÈÅ85çªkåšµÆËÂ…Ú¼€ “®hóšºÍE/,Š­-lúB”êrAô—8º’…¹¶°]Ý¢êŽÏ¢÷éAÕñ– +ƒ4Ö€Û…ð(å&·¯Â¾?˜+Q:Oó[^¼âË‚;"?p­ã›D¢²‹JšÝ§ãcËm$çÒ’¤xN–?ŒæéR¨@ÓÉ’ mÎDWr´²÷M¾*èØJr%oYžº nËu׃?pYRñ + [V D€'vø2?§YZ¥ê∼Zˆ=÷XÊ=âM?f[,Óé~KBwxÀ~O¶» ë“Gɺz±1‰?ˆpcÉ€… +>ªR{$³² Æ‹Öp0ëTUº”‚^™‘×j„Ã2É:~)FË:¶€÷ölª½ ?‘Fâ[ïHƒÆ‚X +8r(ÜzÕA„#ǤE½ð_©î®u€êì1Å‚ñTS½B*»s¿˜ó0%l·O-´Î?^@Àp ªYQÌ|ݤ?:ÉÏñ—™]Ãup +»,Q¥'=j<ܦÈ(ê¹d¯Ð~ À?“i“ЍÑQ„ì“…ãèèRÎåìQ8=C +a!Tõz ¾Ân8NE[¢Í°³÷g¼³y"n‚—÷$õä,B±±)‹!úšq0?¾à\¡—LJ¶Ñì?K^‰œEÊ\A`@^PyªA´È›]Q²Æ0Ò½)+!Á¢ +QŒ‰UÌyg€Ä’<‰£hBtc¯“5Éòü3|1ÜË +²ï…·hiÎ_YMù ­SÔd-€ñúuðõrnæ,æãŒ€ö€ÂˆûÓd¹–aksæ A쬀d^á*uŒ§ ¬m[Èn’Q%Õ?+qï 9ëÊ¥ìM뱄׫„œôJ•©ÎNG£‚mvÙS8Ê$á¾áaŠmüŠ"Ù&s)rJ;V¼4éG"vÝiÅáÚ¨¦Ðð<œÃëÚ?Êœ36øFbsn‘Ÿ°‹Ä¶?ð~qò/]Q˲¦tƒ:ZÏÇÁ°Þ²°íxôáRðX²ÿ=%D•Ü;wÉHâü‚’†4g+Û"Õ€˜°bÄÛйۥ‹º¨]&|À¡q0?êã“ùÄ:l‹A?²?å y»U·¦{ZdIº…°°U®Ì7kwdV¤, +^…мë|%Gõ†–ÕŒ™’Ì?ͱXl5Ð÷™ÆRÐr“\GÈ¥-Sè ïÌ»N_”BYE8Ú¼Ò:Ðpš’2hWD¿Ù;XY¦¶!NÂ縲p„`÷J*Q4\ìÔ‘‘0Ú‹0%¡ƒï¾òá3†wuS Ë”eÇåq-ó^Zi(CI>ZsìÞÊN‚žÆ{ÑðXÍÑ¥í|5Æ iSÝ®–ñ’yA…·µÆi!õØZ+š%›r6B¿Ä¢I.šÌh‘ÔNr«?Wi&±}Á³Ô±gòª¨j‰äÒÙWønI©©ê«<Õ:©ù;¬Ø$’@<’ Ä¥ªET^øk†“e°æ$öÒþ:¾VOÝ#ÂRs?bE)b Âã$ºLBâðªO¡’-:-— +Ò¯S0Åã’X‹ Ÿ±„£ð0$‡Þ1Zj_JeŒ3#ª– E@ø-/8t8ò(}¡’ó—8¹’B¼÷öd?¤–¾zH2äMse‰ +}åQ¿$¯Ãù3Õ¥(š”t>€t¤òÞåE +7EõZEl7-'zÜ&±W|#÷;'ŒŽÔ­çÑbPµ9ýM +ˆK?좴EÌÀ‹œO. •–1iô¶Yæƒ%Ñ3\(ÌKj_;®µUã%ü4ø¾°ìâ~¡˜Þ‚ +•³ÙÊ×?ýA€;õ$ˆªŒ%‚FÈHq%oɽ'¯å©øu€Mþ]§¥T´„d‡ÚåE'Ëá*¿´•‚ WF5J +æÕ»á¬\??J? +gµ–Å£¼šßxvÒr{MУâÍœ8J\‘ƒ$Þ ¬• fèC; û$¤U\ŒJ·?þ ¥ŸYJlªrè¿Ø’{T6ä¦C³íÂϰ¶·ŽÿâªQâ:LP³ ®Â qƒ É6’H°³âL[œ’¤\©kÅ'?b? Å~9ÆÆ …?Oˆõ-ﻢ¢o?ŠÔ웊’$¸=<ŒGFô?šªš™àôK]ÐãášãŽT’ð§à²ËÒ®“r‰¨Â*‚—Ì+¡?n5r½¨%DÜsC¥ +®WÈŽpZT„e`íš:b(ËáYÉiKjcåÊ»TLðÜ•ÁAn8jÖãÜM·úÝ–RðK©»Qõ';zQžèkí‹"£j?OÝQôÑÆ0§ä)•NÞ–\h²^“ ý*šßÉÞH\ÇHjXé Av¿üáXè‚þž˜—"«©_³òÙUE‰LRG³qÁí?“›—ÞÁF|¶³äaoÆÕ?½?xt7ÕÝOH¥%–{Höñ‚Bc1ÿ•¨|S½¨+öh?„!5õFü?¹ù(Èî°ƒ§¡:¥Z¨Ôƒ ˜.¦ë/€ v„? ÿá¼è³Ìr°-¥'À‘x ª{O€" ?Ñ(½ê©7ñ® ªÀ¼?T5Ôµ·ÅJ g»¹b›”)Œ§ö¥¶¦BK1O âäÙëÀÄÃ&Á$9Wè™—$K…($˜!T\ëÔýímRr“®I’´±?Ù÷4•PT—S{SZyÔô]hËÓg8ƒmé3•`¬Ö=Fr +Z%ê? Ýsj?ÃÑnhxó8NŸ„næÿ}‹S +—æ$ ñ1Q~ÎèYÑŸ•šp§ùxb™d`)Ïè?•öý¥F²âmN™œ.2Ѓ?¯¥„8XŒà¶nÞrƒœ“ „T†€lJ©?™i=÷Ag.q¦Z…?Uã…¤ž(lq‹XŽhÂ5=Ú±Z)o§—?07Íï8͉7!•Íà „¯äàC÷?¶ñ9Vª)ÓK›d éiV»&¡Jœ+©¯)ÂP2»JóTÊÛ”*êKâÏËt'ÓË@}¨$^S-52£ÖE–%1‚i6ˆM†b¼Ð‘U·³¬ÖcðÞÁöbãâ6/#­kú³Þs·8ÔÃ?ß=§2…`•<ä6çJÈÐQ^4¦³MþÅ(d `L}.¦ +|ƒÚÛL€’£€p¡V|$ ¹Û» +“kräÀÛ2¡¬â®s†RÌ}XOq¹d ‰7×ùÛbmaŒÕv‰#$Ù5à´ÔÈ–vUœ‹³£ÓAŒó?f`Õá~?¢rÿª¡ìþ>pÞ¡r ´>{`ÍñE͹‹ëxÕHŸZ˜L„ôëõ&Š©Ž_D¥äíéa4ðQê”Ö"µ$ûß +l!õ“Š™”²?òr{CxŒ¢ZpƃOÒs2û}G•tNhøÐA'êtS%J´Óí0úze[œdä4ÁQSãP4˜û€IM±§Ò J±+¥Ón!ï# +­`Ùþ('à†_ðæRãcù¹ +ÖŠJ-UZCóÕ?ɤe3%Xdäc¤D.DÏ +Rbêiâ«:¯•¥ éÖÿYØ'¹qNš¼«:™–K©îëÇeÓ‘vòA*„ìÙF¨¹½¦ú‡TËÛ­­Œúøqâø¨|V¹nïJFŨ ?øŒ´l:´›tžVÒLÉ’×0¢9óáö„b\A£ +~NKø£}´R…N{å\˶ow@.¤"FÍçEÐ2á$Ñ‚zK*Þ4Ýê¸~RîÿÒ×ÞÃF 0ZþuqÆÑÒ“Ÿ.¥)V¥[«ˆê­ôå÷¢Šgi:v¨æCEoÙÞsª7Ð9ýZ†—Ä+´Ë´Ñìˆç]F"ì‰>ù¥i¹¿1J+ëºlº’­A(Í>›ŽÇ»&õVo®n…-âÙp#ó²ih4Ö¨ãSö?ñãÏ?fcÍÚ)Œ‚@³­¹è_.1?p? +6º9ŒÊÊü«^®¹l*+J×eZÁ—iW­r¥Gï{>T3ç2¬°MuôVÇ`ÿµu½€­¼ +3ægA³â?®?ë˜íUø¬e@µFV¥«w¢Ä…Ç4ù +k«4¯ ëtL?õq¯Î!-*>!lŸ& ³>:ÏhÄ]—B³GcfÐI—në vo¥(M'D²µ‚æ&ì´j·R næV-Ž?[#Ñ»ŠRŽ8d^¥O±Î”NÖ%-^E? @•)kS{$Iû÷<´¹ŠÒø¥¼›ˆ_ð¼XªÚ"["(-h:ˆ;+áoȪa[²ãƳq~¥“Ò¤4àÏË}ÁQ¶ å¾8îòcsL¡ ¤ Jm¬oì¦ K£FÞAíÿ¹±åR/ YÒ\LÜ2p?àÓ!û^ÔYŸ–‹zë8fˆ#?'Y@l¼F4Ê­´¸Xìûbþɨ­Ô™ÿÖiãÜDs1íû°UöÜÕ%»Ì#uOc­P‚ÿ&®¤;åš?jÙ@×÷Z¼äº©[Õ¢©T^Òj¯?>Å&Ô—?ǯÚllÍ÷hÛ¯¾ÉO|‘HÖ¥Ò®tt¹)S´”BÒŸ^¨…+²"òVIv2ämhÇ}§1|Þ¶ÀóÍü˜YÓl†x6]05^i2¤äŽ4M»0ç+ñÞpØGj²ÆóºTŠ\ZŽ}5?Z-¢×?¹Ê›WZë®wa>€ç\¹ÏÁpÉÃÙö%²¥¹=Œ¡ý]u bþzéû¬ÝÊÐ?:SÞq“©‹FwB·ÈZs +Y’§ÔTŸô«1 ù¾isÆ5‰Du0Gþ˜3U×âè0+jBK²\J?‡Ú±¶ôÎnÃÓ­GƒYˆ·Ò¢õ:Z8Ûì¬'“ÍIÕ~¿u³GŠj9£–má 5·T;]Ê./¹A!"Åä:|5È\Y"Žá> Ó¾ú«]êy±<˜gi?ýÏ—\m;yi„èÇJû’r×_ƒî¼È +«ø‚’=uyDp av²LüžÒncBl‡AŸ?JRŠ1Ø?Û¥%ß2ñÅ?GÞ@_“PÄ+6?Èà…¥…6fM¤‘©9^,ŒK‹ ŠÛæôBiÓ©Rqœ*ÅtÚЉÒ ìŸÈëíÜ–Í€u«ÜÀåµWD:/dX⢣aRg!|Ð,béÉœõšä—a†jZ"Q¼?M(ªõ=fÏ^Qúé”Öz^š9Õ»ÐH8¢;òhúX"“ý1‰k©îÃ`Uásÿ%÷Çù:yóª=„÷ÇK•ý8wdiŒs†¢xTüÿÁ@·ÓþoË/t2 +ÑQH sµíH"]¡,¦©P(ñ(´·c‡ú{ަ³ð)ë¿â‹ZÅÖ’µºPR·M©Ø…z‹¢+ ×?`Â0–eÃÝäXIÖ8 ¶äòÅ몸´ZFæA¤)³ðGþÞ_ëú\D®Ø¡ B—eÌf 陋,¼·?•í?\??Í×þdÒÍž[êòáÒ\núOÓ?™}˜ÇÉøÓ¤ÿ`†S?k~kî&ƒ?ß™›ÏýɧA?ž› 艚4|QÁ£cþûà·Ù`43?ƒÉÃp6ÉëgÓ|Ä +ýëû?¹ï…´¿Ý gæëç?ަ?i¡¯Cp6?õé­áÈ|? gÃÑ'¦Jcî“á§Ï3óy|;˜ð,ü?`?_4?ýÉl8˜jed2þ2¼mïñ¬?Å.ÎÌ×áìóøiöB{í?žÍ?†£Ûž ™Úà·ÇÉ` +q(o3|Àxb8º¹ºå?ûk??g?6 +Žgc—Ö/¶°ˆPzL ØÑ¬=¼bqÓ¿ÎFXŒåÙ—?Ü<Ý÷±§§Éãx: Z‰”p“áô¦¯U‰ÿúÔÔ vzè?nø;ÇL»7Ïã' +^Ãý-=„ÆO‘ðævp7¸™ +¿@ð8œ>= ô ¦3Úý½ +nÀyòl¦ƒÉ—á +‰E¨M?ýáÄðý„É„H?Gm×õñ’ŽZ5øBêò4º'!L¿>a›G”†hõ?A;IБv¹¯C°CçØÕ“¿‡/=y†Ú?ÍCÿYnH<«&yÆÃ=жA•î_?I4×àlÈ ‚%’?ámÿ¡ÿi0UA}a&ô†GÏL7Cú|U…FÜ‹°`„¿>ÑYã¥dú8ô°SR^=X²cÒÍ‘W'pѵíó†?޾ºOIC±Ü¬oxø÷õ€^™ F?![cÿææiˤ'è +ð5}‚­G|ZZsƒ Ø- '·Þ&ùÌ]xÿ49ÐI,?†X‰.ëf8©–RN/z¬&fx‡Eo>ëÙš–ù?›Ï8£ëëß~’3“Å”xªœÆJF|xÖ&o¹u?ÜßÑ Zúý*ÕS@êsŠ/…ô#|øL^è¦1Øuj\KÈŠÝ©Œ×LGiu„UCúšo}ù 'djRà¬]ˆ?’kaƒ2)ªãpGbCé— ¹–¡Ñ_ºm‡(‰Ôá2 +絊Öѽõ0¼àëÀÝû·¾_U‰v3¸Fç=L–J?/…¸d6K{$¶þ +ž…å¦%}£ +:jI‡Ëír -°ºy±{í‰"•q +B›I]#zLÈm¸´Å°ÕϤ4ÍYÀ2gÈnr­0âh8QäÁ3~å}×Ò›âËÖE »–´þ‡„ÍTü„K$•wÀ¢Ôø”æHÊV4ƒ™È<]ÂÊ—6þ&ĺ¿±ßc¦@@…±ÛßRûèŠaK#®Âmë–àoî™j +¡:6Òâ!ðÇ?w?ü]?ÐÏ})ŸÉÇ÷7ö5ÝÜÐèY¥²óÆ„ƒRgNyšä©<ˆ¸ +·£´£Ì…÷Œ'fý€³OºÒú`jmS`xCTòËüÛ”@¶Í?:"±þ6³<­‘¥Óä}}9êx7R½¢ úü<ïf3ò“$½ßùS$W•¹:O(Q%R1°ÈulÒKÖe‘c/r7y \^šuëÌ­™¡ÖØvÏ»HË+!a–aÚ=K¿Ù¨ÇÀ³¿x˜}’“»L­)p؈m +ý}Ê?þ_$ñæñv~ÄtÛ†{øúi?^?ï_OÇ÷3÷Ï1„¿bMQ%1ÕšÿO¾ÿúî22˜®á7‰ã‚Íh!wÇ ½*k>?¼Š\¼‹Y9¸|»Ùï(YåvfsSÂóÊì:ªÛþ6ÿá +¯VB|ònéxŽ1íd5‹ò ?£ò>Ôx¨ÉÊóH3¹ªÝZ<ʤÞ?”> +{ ?¸-@üý¼|ãÚÎÖæ5Di·îý{òè\,pu*­ÿð+%§,œgMéøa wTìAàÜÿ2G˜äW:[[^ùQ U(G‹LšU¹Ü¡áº8ÛT6›ûqgÍm1?^Rõy9ý¨‡“›ÝŸõòGBƒ;» ±„‡ùERëöå¦çb_,÷¹õŽ‚¢ç|V•y¶†¶/Â9êÒwq-럑…¼£V(Ħ?üV€3:>E#Zî"T#±Þ߉1ó9Y|³e;FËLýÔj¶‡±ùßzæ?`™fü³LªÌò]?~½È¥þÞæ—ÔÏèEVw·‡”¶›R)^¬\ä •­>TyBƒµŒ]]Bíü² !rfüS:¡zÀ_Âà«Üe$:r3Zx\á¡ÅxÙ¨éá ”Ve_l?óêÇ¥ý¯K,ý½¶#¿ó£øþè?ý–?ø_PK +ep1Ð(½?README?TMs›0½ëWìä’¤pšfzèd:M°›:ƒ?[;?æ¨ÀÔ‚D%a¿ïJ€?¦=ô`#´ÒÛ·oß²èÖ_cˆ””˜Z¥'ð.¼ ß¾^8œåJW¨Ë‹páž3ÿ€Û»SÓ»¦ZlQ?b‘ª;-^ + gé9\]^^ôw +ãEÆ¢d¹™-7kÆÞ@,R”i5UiS¡´Ü +%!V©_0Æây4[®glH}HU({€ ™[ ܯb :RUýTðr<Ær­ª•›çЩ +¾Å=–-¹Ö*kR{ |u‰Ü D¿%«§ùòžå¢D¯B¥4‚?N:_?K²)?69ýL?ž¾¦X»°«5±O{ö#š­6ód¹¨7ËY´I¾.ì®fB{½»‹²1#ÅŒÕâ¹ñ…þ¿˜ÿj +¸Öììõ—Ξè‰ÏãÛоÚ +pë Ð@+l1°;$å[²—wPcH¹g,‘ˆJ%§ô5þîÑ#Ü?õÊrª‹U7׿>U?ù]†tí£3á?á%šƒMÊɦIô¸  ¸ušCœD~ÁÀù²£9ØM O$$Ñôm¡:½"¹¢R[¿=‰?Äé¾mÐzû +æÙrQòçÒy¾läèÕô³÷]]Rgæ²búDÒT¼^EùdÖ«Ç-§{Ý?‚“V½qúïA‹ÏFXr¿…ÂÚúÃdÒ¶m¸drtu’ŽÓüœ0$É?Ã]Ézj+r7I?ÖªÑ)Òc˜v|ÆU +iÿÚUÀujä~1—4xtdë¼ñPK +ep1com/PK +ep1 +com/mysql/PK +op1com/mysql/jdbc/PK +lp1Óo™ß:-com/mysql/jdbc/AssertionFailedException.class?RMoÓ@}›„8q +¥iSÊGÛ-”6¥>p@¢) F Y=ÔUD?{Û¸rìàZ~—D¢ÜùQˆY»J?$ö0»3ûæ½Ù™ýõûûûhkx¨ƒáQ?ÕþDÇ:6*ØTΆŽp +[:ªxªáCù?xÉ[†µ†u!¾ÓÁ¹yxåÈQâ…ÁA³ÇPzº’aÑòy”û2:}Ÿ"5+t„ß‘§ü›`)x1CÓr¡9üöÍ ·ï˜?8–‘âì +Ï—îL‚¡ ¯êsõI6„©ï…É1É€AŸ^“Žn‡iäÈ®§´×ÿ%²¯¸VgvyÁù»ôìLF lS :¶}x|»??–ýšO“¹?çØÑ°k ?&ÃO"áy]<Þ—ŠÂË`?_Šøæ¬X[ »ÿÙ¿Kƒ›•xœ‰7”SC±¡æQÎúà2ìý=³üAÍ[¡ü?ÔÉå9 +f¨$aŽcXiÜΦ¼ú<™¶è-@­ý-*žì=ò>¡H€·®ÁN'(ÔŠc”ÚcÜ¡­V&3†6Aå[–¹HVÏðmlâîÓi5ÏÇj?Ç2Vˆ½Š:©2•—¤Âh¯^£zÚš@ÿ9¥+g¯2*#eŠ(eD 2üÚPK +lp1Ó?_ó’ +com/mysql/jdbc/Blob.class?VÝoWÿÍ~Íîd'Ž?t“¸ž¦Þ]DZMC?ìÄ4NÓ²®±›ÚM)”Ù݉½awÇ??­ãòÑoâ4¥´?ò„x@‚ +$?¨Ý”¼"^xC Á ñ? ~çÎd¼Þn¤ÊòÜ;÷ž{ÎïüÎïžÙ?ÿï·ÅO <€R÷£lðQ‘™#?‹:–ÒXN£j …K:¾eÀ@I5yÔu4ä„k`Vdö’uy4uøi´ÒxYÖWÓ¸l` +¯ìÀƒø¶<¾#ËßMã{âúUñöš<^×ñ†?ûPÒñ¦Ž·t¼­ãûv—=Çö]ï9§Ùªù ޝáÀlÙ­?Öך/ÕF/UJåÑhoRƒQª6loíIÛ·5Ä.LkØQvk­z£Ø¨8—5hE +©ãÕFÕŸÒ?Ì]˜ÎŸÕ?8åV +=³Õ†3ת—oÑ.Õ¸Ò;ë–íÚYÛ«Ê{¸˜ð—«M +ý?0¦kn‰Û¢ï»-JØž¦ãO+¸ >³¬kÈæfò³—ì—íѪ;:ßòWZ~°E¿»ª’Á¢{ΫúÎIò ÍhH—Ö|§IK +uF;gûåe?ÜáÈ8}¹ì¬øU·Á,z–:1ìÏmA(6Ú¦¯Äã47saºXÌ“ÍLÅ?sIIcI8‰NÎGQ„“ª{šäë«w°'K?Ÿ”{ñbSŠšª9?%Yþ»åŸ’?0½ÁàZ1/Eޝ¸|ÕÎjPùx./ìpµ*4ìÍ~…U¨1ÐWlßw¼†Ô~û6!6}Ûd,¤26› +Ê©šÛt*ò¹ÏG¸T:îJ…ŒÀÁBõª(í{­FÙöEP¬º¨Ðö–Æ4ìŒT¤²“Im{_Ú¾ŸÈ)Œ·å•?§ª"ÑŒäpT221‚+&ò(˜xGM !gbGX¬(ã…3³Qµ4Ü.4«ÞjúVɱ¦NXã¤ea|lìqq»®á?ÏÀ‰«xÇÄ5¼«áÐ?âJOzž½Ö&1ßÀ‹â™0Á£:~`â=\añº¨ŠÁ‹óÖiÏs=ku™Y[".ªÐRÒ²|×*‘„ð˜‰/á +Ï†Š°†¨?!«l7¬†«Ò;n?ëø¡‰÷ñ?‰§1gbϘ˜Ç"ÕA…[ÕúJÍ©; +ߩșø1®›ø/Òo´/n™3ƒ.½‚ÍMåU³K£ó¥KN™Ù¹M†wl'V±íxJíÔÏP(qå?äbò³+biPbÑá¡Ïè¸K u,©®/oMNÝ}®ôu»«4,ËÙ–ßÂZÓw¸•±¥èeweMC¡p@Àd±Ë’ +Õß%;ukšê:‘¶†¾ ‹ß’ûùy‹ñ“óâ©|~õbrÔÈKÀqÿ©8håÌæzŒc¶° ­ }ŒXaxq™% +ñ?‘ü?::Æç~¾@?$ð2x†Žf±_Á=˜Ã8wöŽð< ¨Ù1ÖT¸/†áZ´It wD +t ·†{žáÎ2Ü9†ûª +Wu —U™`$ç8Wy½¸"Þ?®N4®ÿ=7‘:ß«÷¦7‘¹}ÆùMì˜)lÀÌ\ÿv?~?X|ÐpÖ7°sä·º{éEØK¡„^8D{ƒX&÷U"ª)„#3N„ðÃãÄr€˜äîq®&¸’âÿ L…Qˆó&v?'Q=›Ø½9¥öVU3° #´{ãå¼i}\3¸3UÜÀž‰T65ÒŸèOn 7›ÚÀÞ?ðà„þ¬ ]1Ñß»O˜˜H‡›É‰L6}»?yIìa‰³ècæ{˜0Q¿«&æ>®UïÎ ¥´WiõíÖyöO_ÅA¼KË7ÉÎ[´¾Â3ë<?®’Ÿkäå=•Û ¬úAŽ'1M³<¥f?…kÉ)âv +O*nevš:ˆ«ÙSŒ?P³§9Kòô£Äõe2´?«bȼ숽Q‰?ÜÚÀþ¼ØVY#ŠnDÑ?0z»¶ÕÐÿëÄ?ä˜oÓÞ=?öþ˜žHH±EkÙD|àd³‰­²ïSA‡¿¤à~…ýø5¯ù?¶«??àäy38y•xœÖ½¼©b׌M?6ÎQìuApëíßtdýI›Úô.j›Ç³¡£çBû +ÙáOq@Ãú§8˜€µ?C?^ÿÔÆe_¾gèES³¦눴Õ*ÔJ±8°‰{owøÿË]ju&ìFÿϳËÜiUIurhxƒ'I¸õsì–Iðv¨ÂžPà¶Å>¶Õ¸‚Jý•Ï¿ñ +ü?bÿ+õÏ60C˜!6´ILâ0ÛÚU…óøZ˜âqŽbŸ¾‰ûؘw&ø¯¶¾›Ž|¦qAU+­˜ü +Óš +~ª0¼ +µ¡VÿM$ÿi󚊼¦ðuE[L~³„¾F9 +ޤÐÑÙ¡þÛ¦™dèFÃ7••ýPK +np1 ER´?a#com/mysql/jdbc/Buffer.classµX |TÕ™ÿŸyg2  @H€€aòBAÄ@P’ð†ðH?_L’ ŒL2qf"¡EA*­Õ¶n[kÁR«ÐE”À +…µ»µ­ÝZ«­»}ØíÖÖ¶ÛÝn×Úº…ýçÞ¹sg2ZúšßoÎ=÷»ç|çÿýÏ÷}ç»÷ùsÏœP‡ó~\ŽÇ 0OHsXš#Ò|Fšð³9*Í“~ÃSÒ{Ú?ãöãNúqþÑ‹gü(Æã>œ’ëii>[ÀÑg|8ëÇ?áY‘|·Ïûð¹ÿ¢çÊ_CÿDÝsÒ|IšvŸ7r÷eiž÷â+²ÈW¥ùš/xñuþŇoøð¢3ñMõ’ßÂËÒ{Å?oã;nC;´žWeê¿úñoø®ÿžß÷â +£ÚWÝØ¶¤}YçòÛZW¶v*¨V…¢æx2îO]Ž +FœF¡°}][›9˜ÃV(ø»¶§"Mƒ½½‘„‚ãÚ&…âmáäÊÁX*º:ܽ5’â°? +]ƒ½m‘þÍ©- +¾?x2šŠÆû9;éïIË= £ýÑÔ"wÕµM³®Qp5Ç{"Ä×í?´öuE?á®%£ÛâÝáØ5áDTîM¡+µ%šTßÖï«ïÛž¼9VSOWw½n?‚“8¬ªUëNFßÃIEÉHªÉfAÑæì{WÕ,±©?ÃV[¨ 7ÛïœU³HW G¬Ï1ÜUµQ/Õ oæˆÞp2Õ±5:@{;R‰h?eÎXÄÐ@ŠFÉÒzÙŽø`¢›à|&˜¤PÒª?¨.…`4ÙFU-áT8½’»; '´&Y°g°o€äÊey$Ü#†x¶D†¸“ÂÝMá[Âõ±pÿæz©QQsx{f=M“›.?àž~ó?/œìŽF›„É #4YTGú“ƒ‰Hsx ÜMmçþ÷G¶YûϾ©­8ÜÓ£i ÇÄ‚X2Ô ŸqàZâOO¤uô8Gru$(%ZJbF‰`i4³F{EÒÚOðÁ„¡DÆ/N$ÂÄã‰÷ö&…9¶€ÖÚ—?)Lwµ†@úÎx¨'¥÷plÕ¬|”zúÂCm²»Š–̨9$ï,çà’%n<ŠÆëבÇ??x"éYÒßïá(‹!÷EL¡‰)½KÛQ:±æÇU¥ƒI‘¤ %N¶ÇÛctw—1Ã˘3¶Ü3Ù(Ô£[âƒFxUµh5=ü·ðϹ~=`i,ÖξT?§c¨¥D¦Ÿiò 0s®ª2*`‰ôˆ"ëÖ$_ß§ .ÍG•”ØF¥Í‰ä{A’œ¤ÑAaL3Õ¼%œ §0Þá6$è˜.NF¼_bÑ_Ð? PýGhc@ˆ(qu|[r]´[ç¼@R'ƒ´c6gÝJÖê°eN¿‘1–Fe£ +?(¬X6WaqM¸"€fiZ¤Y„+x+؆¤¯ðCü{?¢Ó‹ðø±¯ðü4€{ÀCa\þhçvÏà +ü,€ŸcW¿ÀRTéÅ/ø/ì“GÿMA÷¾’¿~%Â!tp«4·!Àu¸>€ sWî–æ¦_HXÐaô0a¿cM›M^i›VÙÍ?ws *Ó1T9“8ùww\2{ö²ä¯èÃJ/þ7€7ñ›ƒ^¼Àoñ»ö‹×a?oðø½Üœãây?Ÿ,ÃVuÝéNeÛº=™ŠôÑ?Â’ŸºãÌQ!»/s´æé¨?˜ërš¼u©hLÒ?¤öÅÉå‘!†·ºŸŒ&ad³€,LÅ9(x­ùS[x`€Þ§PsAiÍ:|©¸uðÅI@©•çVSœâÃH¸?Çäs_äN¡¼ªù]ñêQ1nw™NiùsÇÌ Ê2Ò¶IéTìÑ?θd«¦h*idGžM£2ƒÍ´XÜ+×Î8)N?\*õ¬ N4)7óú¸|„K]°àOÌ{9•,/g•èÅÌÇPhà? x¿?Öýþ™6tŸ)E_™UôµÙ¼¶èk +ÿK°”3—±—¢ÜÁëôÐ ¨?ó8Ò8¥qIãU‡'T}fÞ'µ–ål§ÁǶ.T¡³X9‡0ÕÄT‡I¨g-;­1ÎÐ?¸Z׺ÓÑFŒJ#Xi"¸ÃDP÷ŽÊOûCèixFÈË',3ˆ¸4–9de.¥—é<ž: OÚ5§ +«,F™x<ÚòÌ:~-]7-ÈèòXº<šѵkL]õú´?Ø?Zªém°?[omçZk;oµh» nñŸ .׫F³ +Æb ÆB ÆmGo?ku,?Œ=#%AßöÛóHƒy¥òJ+óJ«òJgç•Îß~{.ý­´ûj›ÝÇ,»?XvïdvS.ç[äPYèl”#fQù¤ÆI[>çv;”.#~~ +mHW{'0½Á¥U¸6 ¢2W&ÎôkŠºŽH®‡WÝ€€Ú„‰Š)_u1Î"¸Lõb±Ú¢QÎ5Ö·P^i–^ÆÚ}T˜?ngÏIïÅò1ÂøþÖ8%Ã?Ív°Fç"±až«¢ÔeZQ¡­p*rèüÏìVLª>?‹ÜÚŒI¦î£ +îS˜¹!]*T±F¨–"d–Q,Œæ«[õÙOÖ$ÏY¢»˜8—Ñv¹n…¼óôé«ÁIk¨9é#'ýÌ?¨P7cŠJàbu æ«÷2ªY·«íØÊ~º–heVß?=š¥VVÚ?÷‘ÉJÛ4_20¨ùròpŽk¾\YÇè?VÈ}ÚÌY׿KÎjôÉä2s–œ4óùoÌ7ç°¤1i&I3mïa +3áh¤±]Lcw0?±òWw¢]}ênlP¶¹êõV[n¥±½,à?b¨Ã„=>ä6ÎŽòÎL‘¢_¨ÔÇÈô}§î·-0Þâo 0 ) + details2 = details2 + ", "; + details2 = details2 + _details2.get( i ).toString(); + } + } + return ""; + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof Detail ) { + return ( ( (Detail) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/Detail2.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/Detail2.java diff -N src/tests/ctf/jdo/tc2x/Detail2.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/Detail2.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,142 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestDetail2.java,v 1.1.1.1 2003/03/03 07:10:12 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object mapping to test_detail2 used to conduct relation tests. + */ +public class Detail2 +{ + + + private int _id; + + + private String _value; + + + private Detail _detail; + + + static final int DefaultId = 5; + + + static final String DefaultValue = "value"; + + + public Detail2( int id ) + { + _id = id; + _value = DefaultValue; + } + + + public Detail2() + { + _value = DefaultValue; + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setDetail( Detail detail ) + { + _detail = detail; + } + + + public Detail getDetail() + { + return _detail; + } + + + public String toString() + { + return _id + " / " + _value + " / " + (_detail==null?0:_detail.getId()); + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof Detail2 ) { + return ( ( (Detail2) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/Detail3.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/Detail3.java diff -N src/tests/ctf/jdo/tc2x/Detail3.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/Detail3.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,143 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id $ + */ + + +package ctf.jdo.tc2x; + + + +/** + * Test object mapping to test_detail2 used to conduct relation tests. + */ +public class Detail3 +{ + + + private int _id; + + + private String _value; + + + private Detail _detail; + + + static final int DefaultId = 100; + + + static final String DefaultValue = "value"; + + + public Detail3( int id ) + { + _id = id; + _value = DefaultValue; + } + + + public Detail3() + { + _value = DefaultValue; + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setDetail( Detail detail ) + { + _detail = detail; + } + + + public Detail getDetail() + { + return _detail; + } + + + public String toString() + { + return _id + " / " + _value + " / " + (_detail==null?0:_detail.getId()); + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof Detail3 ) { + return ( ( (Detail3) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/DetailKeyGen.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/DetailKeyGen.java diff -N src/tests/ctf/jdo/tc2x/DetailKeyGen.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/DetailKeyGen.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,220 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestDetailKeyGen.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import java.util.ArrayList; +import java.util.Iterator; + + +/** + * Test object mapping to test_detaul used to conduct relation tests. + */ +public class DetailKeyGen +{ + + + private int _id; + + + private String _value; + + + private MasterKeyGen _master; + + + private ArrayList _details2; + + + private DetailKeyGen3 _detail3; + + + static final int DefaultId = 5; + + + static final String DefaultValue = "group"; + + + public DetailKeyGen( int id ) + { + this(); + _id = id; + } + + public DetailKeyGen() + { + _value = DefaultValue; + _details2 = new ArrayList(); + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setMaster( MasterKeyGen master ) + { + _master = master; + } + + + public MasterKeyGen getMaster() + { + return _master; + } + + + public void addDetail2( DetailKeyGen2 detail2 ) + { + _details2.add( detail2 ); + detail2.setDetail( this ); + } + + + public ArrayList getDetails2() + { + return _details2; + } + + + public void setDetail3( DetailKeyGen3 detail3 ) + { + if ( _detail3 != null ) + _detail3.setDetail( null ); + + if ( detail3 != null ) + detail3.setDetail( this ); + _detail3 = detail3; + } + + + public DetailKeyGen3 getDetail3() { + return _detail3; + } + + + public void setDetails2( ArrayList list ) { + _details2 = list; + } + + public DetailKeyGen2 createDetail2() + { + return new DetailKeyGen2(); + } + + + public DetailKeyGen2 findDetail2( int id ) + { + Iterator enumeration; + DetailKeyGen2 detail2; + + if ( _details2 == null ) { + return null; + } + + enumeration = _details2.iterator(); + while ( enumeration.hasNext() ) { + detail2 = (DetailKeyGen2) enumeration.next(); + if ( detail2.getId() == id ) { + return detail2; + } + } + return null; + } + + + public String toString() + { + String details2 = ""; + + if ( _details2 != null ) { + for ( int i = 0 ; i < _details2.size() ; ++i ) { + if ( i > 0 ) + details2 = details2 + ", "; + details2 = details2 + _details2.get( i ).toString(); + } + } + return ""; + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof DetailKeyGen ) { + return ( ( (DetailKeyGen) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/DetailKeyGen2.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/DetailKeyGen2.java diff -N src/tests/ctf/jdo/tc2x/DetailKeyGen2.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/DetailKeyGen2.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,142 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestDetailKeyGen2.java,v 1.1.1.1 2003/03/03 07:10:12 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object mapping to test_detail2 used to conduct relation tests. + */ +public class DetailKeyGen2 +{ + + + private int _id; + + + private String _value; + + + private DetailKeyGen _detail; + + + static final int DefaultId = 5; + + + static final String DefaultValue = "value"; + + + public DetailKeyGen2( int id ) + { + _id = id; + _value = DefaultValue; + } + + + public DetailKeyGen2() + { + _value = DefaultValue; + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setDetail( DetailKeyGen detail ) + { + _detail = detail; + } + + + public DetailKeyGen getDetail() + { + return _detail; + } + + + public String toString() + { + return _id + " / " + _value + " / " + (_detail==null?0:_detail.getId()); + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof DetailKeyGen2 ) { + return ( ( (DetailKeyGen2) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/DetailKeyGen3.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/DetailKeyGen3.java diff -N src/tests/ctf/jdo/tc2x/DetailKeyGen3.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/DetailKeyGen3.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,142 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestDetailKeyGen3.java,v 1.1.1.1 2003/03/03 07:10:12 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object mapping to test_detail2 used to conduct relation tests. + */ +public class DetailKeyGen3 +{ + + + private int _id; + + + private String _value; + + + private DetailKeyGen _detail; + + + static final int DefaultId = 5; + + + static final String DefaultValue = "value"; + + + public DetailKeyGen3( int id ) + { + _id = id; + _value = DefaultValue; + } + + + public DetailKeyGen3() + { + _value = DefaultValue; + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setDetail( DetailKeyGen detail ) + { + _detail = detail; + } + + + public DetailKeyGen getDetail() + { + return _detail; + } + + + public String toString() + { + return _id + " / " + _value + " / " + (_detail==null?0:_detail.getId()); + } + + + public int hashCode() { + return _id; + } + + public boolean equals( Object other ) + { + if ( other == this ) + return true; + if ( other != null && other instanceof DetailKeyGen2 ) { + return ( ( (DetailKeyGen3) other )._id == _id ); + } + return false; + } + + +} Index: src/tests/ctf/jdo/tc2x/Group.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/Group.java diff -N src/tests/ctf/jdo/tc2x/Group.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/Group.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,106 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestGroup.java,v 1.2 2005/05/11 17:18:50 rjoachim Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object mapping to test_group used to conduct relation the tests. + */ +public class Group +{ + + + private int _id; + + + private String _value; + + + public static final int DefaultId = 4; + + + public static final String DefaultValue = "group"; + + + public Group() + { + _id = DefaultId; + _value = DefaultValue; + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public String toString() + { + return _id + " / " + _value; + } + + +} Index: src/tests/ctf/jdo/tc2x/HighLowExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/HighLowExtends.java diff -N src/tests/ctf/jdo/tc2x/HighLowExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/HighLowExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestHighLowExtends.java,v 1.1.1.1 2003/03/03 07:10:13 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object for HIGH-LOW key generator. + */ +public class HighLowExtends extends HighLowObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public HighLowExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/HighLowExtendsSameConnection.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/HighLowExtendsSameConnection.java diff -N src/tests/ctf/jdo/tc2x/HighLowExtendsSameConnection.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/HighLowExtendsSameConnection.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestHighLowExtendsSameConnection.java,v 1.1 2004/09/15 21:22:41 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object for HIGH-LOW key generator. + */ +public class HighLowExtendsSameConnection extends HighLowObjectSameConnection +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public HighLowExtendsSameConnection() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/HighLowObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/HighLowObject.java diff -N src/tests/ctf/jdo/tc2x/HighLowObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/HighLowObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,90 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestHighLowObject.java,v 1.1.1.1 2003/03/03 07:10:13 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for HIGH-LOW key generator. + */ +public class HighLowObject extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public HighLowObject() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} + Index: src/tests/ctf/jdo/tc2x/HighLowObjectSameConnection.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/HighLowObjectSameConnection.java diff -N src/tests/ctf/jdo/tc2x/HighLowObjectSameConnection.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/HighLowObjectSameConnection.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,90 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestHighLowObjectSameConnection.java,v 1.1 2004/09/15 21:22:54 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for HIGH-LOW key generator. + */ +public class HighLowObjectSameConnection extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public HighLowObjectSameConnection() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} + Index: src/tests/ctf/jdo/tc2x/IdentityExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/IdentityExtends.java diff -N src/tests/ctf/jdo/tc2x/IdentityExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/IdentityExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestIdentityExtends.java,v 1.1.1.1 2003/03/03 07:10:13 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test "extends" relation for IDENTITY key generator. + */ +public class IdentityExtends extends IdentityObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public IdentityExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/IdentityObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/IdentityObject.java diff -N src/tests/ctf/jdo/tc2x/IdentityObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/IdentityObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,89 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestIdentityObject.java,v 1.1.1.1 2003/03/03 07:10:13 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for IDENTITY key generator. + */ +public class IdentityObject extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public IdentityObject() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} Index: src/tests/ctf/jdo/tc2x/Master.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/Master.java diff -N src/tests/ctf/jdo/tc2x/Master.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/Master.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,111 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: Master.java,v 1.1.1.1 2003/03/03 07:10:07 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import java.util.ArrayList; + +import ctf.jdo.tc2x.Depend1; + +/** + * @table MASTER + * @key-generator MAX + */ +public class Master +{ + /** @sql-name depend1_oid */ + private Depend1 depend1; + + /** @primary-key */ + private int id; + + public Depend1 getDepend1() + { + return depend1; + } + + public void setDepend1(Depend1 depend1) + { + this.depend1 = depend1; + } + + public int getId() + { + return id; + } + + public void setId(int id) + { + this.id = id; + } + + public ArrayList getDepends2() + { + return depends2; + } + + public void setDepends2(ArrayList depends2) + { + this.depends2 = depends2; + } + + /** + * @field-type jdo.Depend2 + * @many-key master_oid + */ + private ArrayList depends2 = new ArrayList(); + + public void addDepend2(Depend2 depend2) + { + depends2.add(depend2); + depend2.setMaster(this); + } + + public String toString() + { + return "Master object #" + id; + } +} Index: src/tests/ctf/jdo/tc2x/MasterKeyGen.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/MasterKeyGen.java diff -N src/tests/ctf/jdo/tc2x/MasterKeyGen.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/MasterKeyGen.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,199 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestMasterKeyGen.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import java.util.ArrayList; +import java.util.Iterator; + +import org.exolab.castor.jdo.TimeStampable; + + +/** + * Test object mapping to test_master used to conduct relation tests. + */ +public class MasterKeyGen implements TimeStampable +{ + + + private int _id; + + + private String _value; + + + private Group _group; + + + private ArrayList _details; + + + private long _timeStamp; + + + static final int DefaultId = 3; + + + static final String DefaultValue = "master"; + + + public MasterKeyGen() + { + _id = DefaultId; + _value = DefaultValue; + _group = null; + _details = new ArrayList(); + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setGroup( Group group ) + { + _group = group; + } + + + public Group getGroup() + { + return _group; + } + + + public Group createGroup() + { + return new Group(); + } + + + public void addDetail( DetailKeyGen detail ) + { + _details.add( detail ); + detail.setMaster( this ); + } + + + public ArrayList getDetails() + { + return _details; + } + + + public void setDetails( ArrayList array ) { + _details = array; + } + + public DetailKeyGen findDetail(int id) + { + Iterator enumeration; + DetailKeyGen detail; + + enumeration = _details.iterator(); + while ( enumeration.hasNext() ) { + detail = (DetailKeyGen) enumeration.next(); + if ( detail.getId() == id ) { + return detail; + } + } + return null; + } + + + public DetailKeyGen createDetail() + { + return new DetailKeyGen(); + } + + + public String toString() + { + String details = ""; + + for ( int i = 0 ; i < _details.size() ; ++i ) { + if ( i > 0 ) + details = details + ", "; + details = details + _details.get( i ).toString(); + } + return _id + " / " + _value + " (" + _group + ") { " + details + " }"; + } + + + public void jdoSetTimeStamp( long timeStamp ) + { + _timeStamp = timeStamp; + } + + + public long jdoGetTimeStamp() + { + return _timeStamp; + } + + +} Index: src/tests/ctf/jdo/tc2x/MasterTest.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/MasterTest.java diff -N src/tests/ctf/jdo/tc2x/MasterTest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/MasterTest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,199 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestMaster.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import java.util.ArrayList; +import java.util.Iterator; + +import org.exolab.castor.jdo.TimeStampable; + + +/** + * Test object mapping to test_master used to conduct relation tests. + */ +public class MasterTest implements TimeStampable +{ + + + private int _id; + + + private String _value; + + + private Group _group; + + + private ArrayList _details; + + + private long _timeStamp; + + + static final int DefaultId = 3; + + + static final String DefaultValue = "master"; + + + public MasterTest() + { + _id = DefaultId; + _value = DefaultValue; + _group = null; + _details = new ArrayList(); + } + + + public void setId( int id ) + { + _id = id; + } + + + public int getId() + { + return _id; + } + + + public void setValue1( String value ) + { + _value = value; + } + + + public String getValue1() + { + return _value; + } + + + public void setGroup( Group group ) + { + _group = group; + } + + + public Group getGroup() + { + return _group; + } + + + public Group createGroup() + { + return new Group(); + } + + + public void addDetail( Detail detail ) + { + _details.add( detail ); + detail.setMaster( this ); + } + + + public ArrayList getDetails() + { + return _details; + } + + + public void setDetails( ArrayList array ) { + _details = array; + } + + public Detail findDetail(int id) + { + Iterator enumeration; + Detail detail; + + enumeration = _details.iterator(); + while ( enumeration.hasNext() ) { + detail = (Detail) enumeration.next(); + if ( detail.getId() == id ) { + return detail; + } + } + return null; + } + + + public Detail createDetail() + { + return new Detail(); + } + + + public String toString() + { + String details = ""; + + for ( int i = 0 ; i < _details.size() ; ++i ) { + if ( i > 0 ) + details = details + ", "; + details = details + _details.get( i ).toString(); + } + return _id + " / " + _value + " (" + _group + ") { " + details + " }"; + } + + + public void jdoSetTimeStamp( long timeStamp ) + { + _timeStamp = timeStamp; + } + + + public long jdoGetTimeStamp() + { + return _timeStamp; + } + + +} Index: src/tests/ctf/jdo/tc2x/MaxExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/MaxExtends.java diff -N src/tests/ctf/jdo/tc2x/MaxExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/MaxExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestMaxExtends.java,v 1.1.1.1 2003/03/03 07:10:13 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test "extends" relation for MAX key generator. + */ +public class MaxExtends extends MaxObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public MaxExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/MaxObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/MaxObject.java diff -N src/tests/ctf/jdo/tc2x/MaxObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/MaxObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,89 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestMaxObject.java,v 1.1.1.1 2003/03/03 07:10:14 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for MAX key generator. + */ +public class MaxObject extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public MaxObject() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} Index: src/tests/ctf/jdo/tc2x/ReturningExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/ReturningExtends.java diff -N src/tests/ctf/jdo/tc2x/ReturningExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/ReturningExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestReturningExtends.java,v 1.1.1.1 2003/03/03 07:10:15 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test "extends" relation for RETURNING key generator. + */ +public class ReturningExtends extends ReturningObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public ReturningExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/ReturningObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/ReturningObject.java diff -N src/tests/ctf/jdo/tc2x/ReturningObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/ReturningObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,89 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestReturningObject.java,v 1.1.1.1 2003/03/03 07:10:15 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for RETURNING key generator. + */ +public class ReturningObject extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public ReturningObject() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} Index: src/tests/ctf/jdo/tc2x/SequenceExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/SequenceExtends.java diff -N src/tests/ctf/jdo/tc2x/SequenceExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/SequenceExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestSequenceExtends.java,v 1.1.1.1 2003/03/03 07:10:15 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test "extends" relation for SEQUENCE key generator. + */ +public class SequenceExtends extends SequenceObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public SequenceExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/SequenceObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/SequenceObject.java diff -N src/tests/ctf/jdo/tc2x/SequenceObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/SequenceObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,89 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestSequenceObject.java,v 1.1.1.1 2003/03/03 07:10:15 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + +import jdo.TestKeyGenObject; + + +/** + * Test object for SEQUENCE key generator. + */ +public class SequenceObject extends TestKeyGenObject +{ + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public SequenceObject() + { + _attr = DefaultAttr; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return super.toString() + " / " + _attr; + } + + +} Index: src/tests/ctf/jdo/tc2x/TestDependent.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestDependent.java diff -N src/tests/ctf/jdo/tc2x/TestDependent.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestDependent.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,298 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: Dependent.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import jdo.JDOCategory; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; +import harness.CastorTestCase; + + +/** + * Test for dependent relationship between data objects. + * A dependent object life cycle rely on its master object. + * For example, if the master object is deleted, it will + * be deleted by Castor as well. If the dependent object + * is dereferenced, it will be removed from the database. + */ +public class TestDependent extends CastorTestCase { + + private JDOCategory _category; + + private Database _db; + + /** + * Constructor + * + * @param category The test suite for these tests + */ + public TestDependent( TestHarness category ) { + super( category, "TC25", "Dependent objects tests" ); + _category = (JDOCategory) category; + } + + /** + * Get a JDO database + */ + public void setUp() + throws PersistenceException { + + _db = _category.getDatabase(); + } + + public void runTest() + throws PersistenceException { + + OQLQuery oql; + OQLQuery groupOql; + MasterTest master; + Group group; + Detail detail; + QueryResults qres; + MasterTest master2; + int cnt; + + _db = _category.getDatabase(); + + stream.println( "Delete everything" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterTest.class.getName() + " master" ); + qres = oql.execute(); + + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.next() ); + } + oql.close(); + stream.println( "Deleting " + cnt + " master objects" ); + + + oql = _db.getOQLQuery( "SELECT group FROM " + Group.class.getName() + " group" ); + qres = oql.execute(); + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.nextElement() ); + } + oql.close(); + stream.println( "Deleting " + cnt + " group objects" ); + _db.commit(); + + stream.println( "Attempt to create master with details" ); + _db.begin(); + master = new MasterTest(); + master.addDetail( new Detail( 5 ) ); + detail = new Detail( 6 ); + detail.addDetail2( new Detail2() ); + detail.addDetail2( new Detail2() ); + + master.addDetail( detail ); + detail = new Detail( 7 ); + detail.setDetail3( new Detail3( 101 ) ); + detail.addDetail2( new Detail2() ); + detail.addDetail2( new Detail2() ); + master.addDetail( detail ); + group = new Group(); + _db.create( group ); + master.setGroup( group ); + _db.create( master ); + _db.commit(); + + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getGroup() == null ) { + stream.println( "Error: loaded master without group: " + master ); + fail("loaded master without group: " + master); + } else if ( master.getGroup().getId() != Group.DefaultId ) { + stream.println( "Error: loaded master with wrong group: " + master ); + fail("loaded master with wrong group: " + master); + } + if ( master.getDetails() == null || + ! master.getDetails().contains( new Detail( 5 ) ) || + ! master.getDetails().contains( new Detail( 6 ) ) || + ! master.getDetails().contains( new Detail( 7 ) ) ) { + stream.println( "Error: loaded master without three details: " + master ); + fail("loaded master without three details: " + master); + } + detail = master.findDetail( 5 ); + if ( detail.getDetails2() != null && detail.getDetails2().size() != 0 ) { + stream.println( "Error: loaded detail 5 with details2: " + detail ); + fail("loaded detail 5 with details2: " + detail); + } + detail = master.findDetail( 6 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2 ) { + stream.println( "Error: loaded detail 6 without two details: " + detail ); + fail("loaded detail 6 without two details: " + detail); + } + detail = master.findDetail( 7 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 7 without two details: " + detail ); + fail("loaded detail 7 without two details: " + detail); + } + if ( detail.getDetail3() == null || detail.getDetail3().getId() != 101 ) { + stream.println( "Error: loaded detail 6 wrong detail3: " + detail ); + fail("loaded detail 7 wrong detail3: " + detail); + } + } else { + stream.println( "Error: failed to create master with details and group" ); + fail("failed to create master with details and group"); + } + stream.println( "Created master with details: " + master ); + _db.commit(); + + + stream.println( "Attempt to change details" ); + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("failed to find master with details group" ); + } + // remove detail with id == 5 + master.getDetails().remove( master.getDetails().indexOf( master.findDetail( 5 ) ) ); + // remove detail with id == 6 explicitly + detail = (Detail) master.findDetail( 6 ); + master.getDetails().remove( master.getDetails().indexOf( detail ) ); + detail = (Detail) master.findDetail( 7 ); + detail.setDetail3( new Detail3( 102 ) ); + // add new detail + master.addDetail( new Detail( 8 ) ); + // add new detail and create it explicitely + detail = new Detail( 9 ); + master.addDetail( detail ); + // delete, then create detail with id == 7 explicitly + detail = (Detail) master.findDetail( 7 ); + master.getDetails().remove( master.getDetails().indexOf( detail ) ); + master.addDetail( detail ); + _db.commit(); + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + master.getDetails().contains( new Detail( 5 ) ) || + master.getDetails().contains( new Detail( 6 ) ) || + ! master.getDetails().contains( new Detail( 7 ) ) || + ! master.getDetails().contains( new Detail( 8 ) ) || + ! master.getDetails().contains( new Detail( 9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("loaded master has wrong set of details: " + master); + } else { + stream.println( "Details changed correctly: " + master ); + } + detail = (Detail) master.findDetail( 7 ); + if ( detail.getDetail3() == null || detail.getDetail3().getId() != 102 ) { + stream.println( "Error: loaded detail y wrong detail3: " + detail ); + fail("loaded detail 7 wrong detail3: " + detail); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + stream.println( "Test OQL query" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterTest.class.getName() + " master WHERE master.details.value1=$1" ); + oql.bind(Detail.DefaultValue); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 1 " ); + } else { + stream.println( "Error: incorrect result of query 1 " ); + fail("incorrect result of query 1"); + } + oql.bind(Detail.DefaultValue + "*"); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "Error: incorrect result of query 2 " ); + fail("incorrect result of query 2"); + } else { + stream.println( "OK: correct result of query 2 " ); + } + oql.close(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterTest.class.getName() + " master WHERE master.details.details2.value1=$1" ); + oql.bind(Detail2.DefaultValue); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 3 " ); + } else { + stream.println( "Error: incorrect result of query 3 " ); + fail("incorrect result of query 3"); + } + oql.bind(Detail2.DefaultValue + "*"); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "Error: incorrect result of query 4 " ); + fail("incorrect result of query 4"); + } else { + stream.println( "OK: correct result of query 4 " ); + } + oql.close(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterTest.class.getName() + " master WHERE master.group=$1" ); + oql.bind(group); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 5 " ); + } else { + stream.println( "Error: incorrect result of query 5 " ); + fail("incorrect result of query 5"); + } + oql.close(); + _db.commit(); + + } + + public void tearDown() + throws PersistenceException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + } +} Index: src/tests/ctf/jdo/tc2x/TestDependentKeyGen.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestDependentKeyGen.java diff -N src/tests/ctf/jdo/tc2x/TestDependentKeyGen.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestDependentKeyGen.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,326 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: DependentKeyGen.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import jdo.JDOCategory; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; +import harness.CastorTestCase; + + +/** + * Test for dependent relationship between data objects. + * A dependent object life cycle rely on its master object. + * For example, if the master object is deleted, it will + * be deleted by Castor as well. If the dependent object + * is dereferenced, it will be removed from the database. + */ +public class TestDependentKeyGen extends CastorTestCase { + + private JDOCategory _category; + + private Database _db; + + /** + * Constructor + * + * @param category The test suite for these tests + */ + public TestDependentKeyGen( TestHarness category ) { + super( category, "TC26", "Dependent objects tests" ); + _category = (JDOCategory) category; + } + + /** + * Get a JDO database + */ + public void setUp() + throws PersistenceException { + + _db = _category.getDatabase(); + } + + public void runTest() + throws PersistenceException { + + int detailId5, detailId6, detailId7, detailId8, detailId9; + DetailKeyGen detail5, detail6, detail7, detail8, detail9; + OQLQuery oql; + OQLQuery groupOql; + int masterId; + MasterKeyGen master; + Group group; + int groupId; + DetailKeyGen detail; + QueryResults qres; + MasterKeyGen master2; + int cnt; + + _db = _category.getDatabase(); + + stream.println( "Delete everything" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterKeyGen.class.getName() + " master" ); + qres = oql.execute(); + + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.next() ); + } + oql.close(); + stream.println( "Deleting " + cnt + " master objects" ); + + + oql = _db.getOQLQuery( "SELECT group FROM " + Group.class.getName() + " group" ); + qres = oql.execute(); + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.nextElement() ); + } + oql.close(); + stream.println( "Deleting " + cnt + " group objects" ); + _db.commit(); + + stream.println( "Attempt to create master with details" ); + _db.begin(); + master = new MasterKeyGen(); + detail5 = new DetailKeyGen(); + master.addDetail( detail5 ); + detail6 = new DetailKeyGen(); + detail6.addDetail2( new DetailKeyGen2() ); + detail6.addDetail2( new DetailKeyGen2() ); + master.addDetail( detail6 ); + detail7 = new DetailKeyGen(); + detail7.addDetail2( new DetailKeyGen2() ); + detail7.addDetail2( new DetailKeyGen2() ); + detail7.setDetail3( new DetailKeyGen3() ); + master.addDetail( detail7 ); + group = new Group(); + _db.create( group ); + + master.setGroup( group ); + _db.create( master ); + _db.commit(); + + detailId5 = detail5.getId(); + detailId6 = detail6.getId(); + detailId7 = detail7.getId(); + masterId = master.getId(); + groupId = group.getId(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getGroup() == null ) { + stream.println( "Error: loaded master without group: " + master ); + fail("loaded master without group: " + master); + } else if ( master.getGroup().getId() != groupId ) { + stream.println( "Error: loaded master with wrong group: " + master ); + fail("loaded master with wrong group: " + master); + } + if ( master.getDetails() == null || + ! master.getDetails().contains( new DetailKeyGen( detailId5 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) ) { + stream.println( "Error: loaded master without three details: " + master ); + fail("loaded master without three details: " + master); + } + detail = master.findDetail( detailId5 ); + if ( detail.getDetails2() != null && detail.getDetails2().size() != 0 ) { + stream.println( "Error: loaded detail 5 with details2: " + detail ); + fail("loaded detail 5 with details2: " + detail ); + } + if ( detail.getDetail3() != null ) { + stream.println( "Error: loaded detail 5 with unexpected details3: " + detail ); + fail("loaded detail 5 with unexpected details3: " + detail ); + } + detail = master.findDetail( detailId6 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2 ) { + stream.println( "Error: loaded detail 6 without two details: " + detail ); + fail("loaded detail 6 without two details2: " + detail); + } + if ( detail.getDetail3() != null ) { + stream.println( "Error: loaded detail 6 with unexpected details3: " + detail ); + fail("loaded detail 6 with unexpected details3: " + detail ); + } + + detail = master.findDetail( detailId7 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 7 without two details: " + detail ); + fail("loaded detail 7 without two details2: " + detail); + } + if ( detail.getDetail3() == null ) { + stream.println( "Error: loaded detail 7 without the expected details3: " + detail ); + fail("loaded detail 7 without the expected details3: " + detail ); + } + + } else { + stream.println( "Error: failed to create master with details and group" ); + fail("failed to create master with details and group"); + } + stream.println( "Created master with details: " + master ); + _db.commit(); + + + stream.println( "Attempt to change details" ); + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("failed to find master with details group" ); + } + // remove detail with id == 5 + master.getDetails().remove( master.getDetails().indexOf( master.findDetail( detailId5 ) ) ); + // remove detail with id == 6 explicitly + detail = (DetailKeyGen) master.findDetail( detailId6 ); + master.getDetails().remove( master.getDetails().indexOf( detail ) ); + // add new detail + detail8 = new DetailKeyGen(); + master.addDetail( detail8 ); + // add new detail and create it explicitely + detail9 = new DetailKeyGen(); + master.addDetail( detail9 ); + // delete, then create detail with id == 7 explicitly + detail7 = (DetailKeyGen) master.findDetail( detailId7 ); + master.getDetails().remove( master.getDetails().indexOf( detail7 ) ); + master.addDetail( detail7 ); + _db.commit(); + detailId8 = detail8.getId(); + detailId9 = detail9.getId(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + master.getDetails().contains( new DetailKeyGen( detailId5 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId8 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("loaded master has wrong set of details: " + master); + } else { + stream.println( "Details changed correctly: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + stream.println( "Test OQL query" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterKeyGen.class.getName() + " master WHERE master.details.value1=$1" ); + oql.bind(Detail.DefaultValue); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 1 " ); + } else { + stream.println( "Error: incorrect result of query 1 " ); + fail("incorrect result of query 1"); + } + oql.bind(Detail.DefaultValue + "*"); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "Error: incorrect result of query 2 " ); + fail("incorrect result of query 2"); + } else { + stream.println( "OK: correct result of query 2 " ); + } + oql.close(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterKeyGen.class.getName() + " master WHERE master.details.details2.value1=$1" ); + oql.bind(DetailKeyGen2.DefaultValue); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 3 " ); + } else { + stream.println( "Error: incorrect result of query 3 " ); + fail("incorrect result of query 3"); + } + oql.bind(DetailKeyGen2.DefaultValue + "*"); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "Error: incorrect result of query 4 " ); + fail("incorrect result of query 4"); + } else { + stream.println( "OK: correct result of query 4 " ); + } + oql.close(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterKeyGen.class.getName() + " master WHERE master.group=$1" ); + oql.bind(group); + qres = oql.execute(); + if ( qres.hasMore() ) { + stream.println( "OK: correct result of query 5 " ); + } else { + stream.println( "Error: incorrect result of query 5 " ); + fail("incorrect result of query 5"); + } + oql.close(); + _db.commit(); + + stream.println( "Test rollback" ); + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + int detailsCount = master.getDetails().size(); + _db.rollback(); + if ( detailsCount != master.getDetails().size() ) { + stream.println( "Error: "+(master.getDetails().size() - detailsCount)+" details added in rollback"); + fail("Details added in rollback"); + } + + } + + public void tearDown() + throws PersistenceException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + } +} Index: src/tests/ctf/jdo/tc2x/TestDependentKeyGenUpdate.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestDependentKeyGenUpdate.java diff -N src/tests/ctf/jdo/tc2x/TestDependentKeyGenUpdate.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestDependentKeyGenUpdate.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,431 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999-2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: DependentKeyGenUpdate.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import java.sql.Connection; +import java.sql.SQLException; + +import jdo.JDOCategory; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.PersistenceException; +import org.exolab.castor.jdo.ObjectModifiedException; + +import harness.TestHarness; +import harness.CastorTestCase; + + +/** + * Test for dependent relationship between data objects for + * long transaction. A dependent object life cycle rely on + * its master object. For example, if the master object is + * deleted, it will be deleted by Castor as well. If the + * dependent object is dereferenced, it will be removed from + * the database. + */ +public class TestDependentKeyGenUpdate extends CastorTestCase { + + + private Connection _conn; + + + private JDOCategory _category; + + + private Database _db; + + + public TestDependentKeyGenUpdate( TestHarness category ) + throws PersistenceException { + + super( category, "TC28", "Dependent update objects tests" ); + _category = (JDOCategory) category; + } + + public void setUp() + throws PersistenceException, SQLException { + _db = _category.getDatabase(); + _conn = _category.getJDBCConnection(); + _conn.setAutoCommit( false ); + } + + public void runTest() + throws PersistenceException, SQLException { + + OQLQuery oql; + OQLQuery groupOql; + QueryResults qres; + int cnt; + MasterKeyGen master, master2; + int masterId, masterId2; + DetailKeyGen detail5, detail6, detail7, detail8, detail9; + int detailId5, detailId6, detailId7, detailId8, detailId9; + DetailKeyGen detailA, detailB, detailC, detailD, detailE; + int detailIdA, detailIdB, detailIdC, detailIdD, detailIdE; + Group group; + DetailKeyGen detail; + DetailKeyGen2 detail2; + int detail2Id; + DetailKeyGen3 detail3; + int detail3Id; + + stream.println( "Delete everything" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterKeyGen.class.getName() + " master" ); + qres = oql.execute(); + + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.next() ); + } + stream.println( "Deleting " + cnt + " master objects" ); + + oql = _db.getOQLQuery( "SELECT group FROM " + Group.class.getName() + " group" ); + qres = oql.execute(); + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.nextElement() ); + } + stream.println( "Deleting " + cnt + " group objects" ); + _db.commit(); + + stream.println( "Attempt to create master with details" ); + _db.begin(); + master = new MasterKeyGen(); + detail5 = new DetailKeyGen(); + master.addDetail( detail5 ); + detail6 = new DetailKeyGen(); + detail6.addDetail2( new DetailKeyGen2() ); + detail6.addDetail2( new DetailKeyGen2() ); + detail3 = new DetailKeyGen3( 101 ); + detail6.setDetail3( detail3 ); + master.addDetail( detail6 ); + detail7 = new DetailKeyGen(); + detail7.addDetail2( new DetailKeyGen2() ); + detail7.addDetail2( new DetailKeyGen2() ); + master.addDetail( detail7 ); + group = new Group(); + _db.create( group ); + master.setGroup( group ); + _db.create( master ); + _db.commit(); + + masterId = master.getId(); + detailId5 = detail5.getId(); + detailId6 = detail6.getId(); + detailId7 = detail7.getId(); + detail3Id = detail3.getId(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getGroup() == null ) { + stream.println( "Error: loaded master without group: " + master ); + fail("expecting group"); + } else if ( master.getGroup().getId() != Group.DefaultId ) { + stream.println( "Error: loaded master with wrong group: " + master ); + fail("incorrect group" + master); + } + if ( master.getDetails() == null || + ! master.getDetails().contains( new DetailKeyGen( detailId5 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) ) { + stream.println( "Error: loaded master without three details: " + master ); + fail("incorrect detail(s)"+master+" expecting: "+detailId5+","+detailId6+","+detailId7); + } + detail5 = master.findDetail( detailId5 ); + if ( detail5.getDetails2() != null && detail5.getDetails2().size() != 0 ) { + stream.println( "Error: loaded detail 5 with details2: " + detail5 ); + fail("unexpected element found"); + } + detail6 = master.findDetail( detailId6 ); + if ( detail6.getDetails2() == null || detail6.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 6 without two details: " + detail6 ); + fail("details' size mismatch"); + } + if ( detail6.getDetail3() == null || detail6.getDetail3().getId() != detail3Id ) { + stream.println( "Error: loaded detail 6 with wrong detail3: " + detail6 ); + fail("loaded detail 6 with wrong detail3: " + detail6); + } + detail7 = master.findDetail( detailId7 ); + if ( detail7.getDetails2() == null || detail7.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 7 without two details: " + detail7 ); + fail("details' size mismatch"); + } + } else { + stream.println( "Error: failed to create master with details and group" ); + fail("failed to create master with details and group"); + } + _db.commit(); + stream.println( "Created master with details: " + master ); + + stream.println( "Attempt to change details" ); + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("master not found"); + } + // remove detail with id == 5 + master.getDetails().remove( master.getDetails().indexOf( master.findDetail( detailId5 ) ) ); + // add new detail + detail8 = new DetailKeyGen(); + master.addDetail( detail8 ); + // add new detail and create it explicitely + detail9 = new DetailKeyGen(); + master.addDetail( detail9 ); + detail6 = (DetailKeyGen) master.findDetail( detailId6 ); + // change 1:1 dependent relationship + detail3 = new DetailKeyGen3(); + detail6.setDetail3( detail3 ); + + _db.commit(); + detailId8 = detail8.getId(); + detailId9 = detail9.getId(); + detail3Id = detail3.getId(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + master.getDetails().contains( new DetailKeyGen( detailId5 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + master.findDetail( detailId6 ).getDetails2() == null || + master.findDetail( detailId6 ).getDetails2().size() != 2 || + master.findDetail( detailId6 ).getDetail3() == null || + master.findDetail( detailId6 ).getDetail3().getId() != detail3Id || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId8 ) ) || + ! master.getDetails().contains( new DetailKeyGen( detailId9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("loaded master has wrong set of details: "+master.findDetail( detailId6 )); + } else { + stream.println( "Details changed correctly: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + + stream.println( "Test long transaction with dirty checking" ); + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("master not found"); + } + _db.commit(); + _db.begin(); + master2 = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + master2.setValue1( master2.getValue1() + "2" ); + _db.commit(); + + stream.println( "Test 1" ); + try { + _db.begin(); + _db.update( master ); + _db.commit(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } catch ( ObjectModifiedException exept ) { + _db.rollback(); + stream.println( "OK: Dirty checking works" ); + } + + stream.println( "Test 2" ); + detailA = new DetailKeyGen(); + detail2 = new DetailKeyGen2(); + detailA.addDetail2( detail2 ); + master2.addDetail( detailA ); + master2.getDetails().remove( new DetailKeyGen( detailId8 ) ); + master2.getDetails().remove( new DetailKeyGen( detailId9 ) ); + try { + _db.begin(); + _db.update( master2 ); + _db.commit(); + stream.println( "OK: Dirty checking works" ); + } catch ( ObjectModifiedException exept ) { + _db.rollback(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } + detailIdA = detailA.getId(); + detail2Id = detail2.getId(); + + stream.println( "Test 3" ); + _conn.createStatement().execute( "UPDATE test_master SET value1='concurrent' WHERE id=" + + master2.getId() ); + _conn.commit(); + master2.setValue1( "long transaction new value" ); + try { + _db.begin(); + _db.update( master2 ); + _db.commit(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } catch ( ObjectModifiedException except ) { + if (_db.isActive()) { + _db.rollback(); + } + + stream.println( "OK: Dirty checking works" ); + } + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + ! master.getDetails().contains( new DetailKeyGen( detailIdA ) ) || + master.findDetail( detailIdA ).findDetail2( detail2Id ) == null || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + master.findDetail( detailId6 ).getDetails2() == null || + master.findDetail( detailId6 ).getDetails2().size() != 2 || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId8 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("unexpect set of details"); + } else { + stream.println( "Details changed correctly in the long transaction: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + // modify an dependent object and see if it got updated + stream.println( "Test 3" ); + detailA = master.findDetail( detailIdA ); + detailA.setValue1("new updated value"); + detailA.findDetail2( detail2Id ).setValue1("new detail 2 value"); + detail3 = new DetailKeyGen3(); + detailA.setDetail3( detail3 ); + detail6 = master.findDetail( detailId6 ); + detail6.getDetails2().clear(); + + _db.begin(); + _db.update( master ); + _db.commit(); + detail3Id = detail3.getId(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getDetails() == null || + master.getDetails().size() == 0 || + ! master.getDetails().contains( new DetailKeyGen( detailIdA ) ) || + master.findDetail( detailIdA ).getDetail3() == null || + master.findDetail( detailIdA ).getDetail3().getId() != detail3Id || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + master.findDetail( detailId6 ).getDetails2().size() != 0 || + master.findDetail( detailId6 ).getDetail3() == null || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId8 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId9 ) ) || + ! "new updated value".equals( master.findDetail( detailIdA ).getValue1()) || + master.findDetail( detailIdA ).findDetail2( detail2Id ) == null || + ! "new detail 2 value".equals( master.findDetail( detailIdA ).findDetail2( detail2Id ).getValue1() ) ) { + + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("unexpected set of details"); + } else { + stream.println( "Details changed correctly in the long transaction: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + // test unsetting one-one relationship + detail6 = master.findDetail( detailId6 ); + detail6.setDetail3( null ); + _db.begin(); + _db.update( master ); + _db.commit(); + + _db.begin(); + master = (MasterKeyGen) _db.load( MasterKeyGen.class, new Integer( masterId ) ); + if ( master != null ) { + if ( master.getDetails() == null || + master.getDetails().size() == 0 || + ! master.getDetails().contains( new DetailKeyGen( detailIdA ) ) || + master.findDetail( detailIdA ).getDetail3() == null || + master.findDetail( detailIdA ).getDetail3().getId() != detail3Id || + ! master.getDetails().contains( new DetailKeyGen( detailId6 ) ) || + master.findDetail( detailId6 ).getDetails2().size() != 0 || + master.findDetail( detailId6 ).getDetail3() != null || + ! master.getDetails().contains( new DetailKeyGen( detailId7 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId8 ) ) || + master.getDetails().contains( new DetailKeyGen( detailId9 ) ) || + ! "new updated value".equals( master.findDetail( detailIdA ).getValue1()) || + master.findDetail( detailIdA ).findDetail2( detail2Id ) == null || + ! "new detail 2 value".equals( master.findDetail( detailIdA ).findDetail2( detail2Id ).getValue1() ) ) { + + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("unexpected set of details"); + } else { + stream.println( "Details changed correctly in the long transaction: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + } + + public void tearDown() + throws PersistenceException, SQLException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + _conn.close(); + } +} Index: src/tests/ctf/jdo/tc2x/TestDependentOrder.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestDependentOrder.java diff -N src/tests/ctf/jdo/tc2x/TestDependentOrder.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestDependentOrder.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,171 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: DependentOrder.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; +import harness.CastorTestCase; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import jdo.JDOCategory; + +public class TestDependentOrder extends CastorTestCase +{ + + private JDOCategory _category; + + private Database _db; + + private Connection _conn; + + /** + * Constructor + * + * @param category The test suite for these tests + */ + public TestDependentOrder( TestHarness category ) + { + super( category, "TC29", "Dependent object order using key-gen" ); + _category = (JDOCategory) category; + } + + /** + * Get a JDO database + */ + public void setUp() + throws PersistenceException, SQLException + { + _db = _category.getDatabase(); + _conn = _category.getJDBCConnection(); + _conn.setAutoCommit( false ); + + stream.println( "Delete everything" ); + Statement stmt = _conn.createStatement(); + stmt.executeUpdate( "delete from depend2" ); + stmt.executeUpdate( "delete from master" ); + stmt.executeUpdate( "delete from depend1" ); + _conn.commit(); + + } + + public void runTest() + throws PersistenceException, SQLException + { + _db.begin(); + + stream.println( "Build master object and its dependent objects" ); + + // no ids needed, they come from the key-gen + Master master = new Master(); + Depend1 depend1 = new Depend1(); + master.setDepend1(depend1); + Depend2 depend2 = new Depend2(); + master.addDepend2(depend2); + + stream.println( "Create object tree in db" ); + _db.create(master); + _db.commit(); + stream.println( "depend1_id after creation : " + master.getDepend1().getId() ); + + _db.begin(); + try + { + stream.println( "read depend1_id from db" ); + PreparedStatement pstmt = + _conn.prepareStatement( "select depend1_id from master where id=?" ); + stream.println( "master id: " + master.getId() ); + pstmt.setInt( 1, master.getId() ); + pstmt.execute(); + ResultSet result = pstmt.getResultSet(); + if (!result.next()) + { + fail("Master object not created"); + } + + stream.println( "depend1_id in db : " + result.getInt( "depend1_id" ) ); + + if ( result.getInt( "depend1_id" ) == 0 ) + { + fail( "Depend1 object not linked to Master object" ); + } + } + catch ( SQLException e ) + { + fail( "Exception when checking master object row: " + e ); + } + + _db.commit(); + + // test for bug 973 Dependent objects deletion order problem + try + { + stream.println( "Deleting master object" ); + _db.begin(); + master = ( Master ) _db.load( Master.class, new Integer( master.getId() ) ); + _db.remove( master ); + _db.commit(); + } + catch ( Exception e ) + { + fail( "Exception thrown " + e ); + } + + } + + public void tearDown() throws PersistenceException + { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + } +} Index: src/tests/ctf/jdo/tc2x/TestDependentUpdate.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestDependentUpdate.java diff -N src/tests/ctf/jdo/tc2x/TestDependentUpdate.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestDependentUpdate.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,367 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999-2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: DependentUpdate.java,v 1.3 2005/03/05 13:42:01 mfuchs Exp $ + */ + + +package ctf.jdo.tc2x; + + +import java.sql.Connection; +import java.sql.SQLException; + +import jdo.JDOCategory; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.PersistenceException; +import org.exolab.castor.jdo.ObjectModifiedException; + +import harness.TestHarness; +import harness.CastorTestCase; + + +/** + * Test for dependent relationship between data objects for + * long transaction. A dependent object life cycle rely on + * its master object. For example, if the master object is + * deleted, it will be deleted by Castor as well. If the + * dependent object is dereferenced, it will be removed from + * the database. + */ +public class TestDependentUpdate extends CastorTestCase { + + + private Connection _conn; + + + private JDOCategory _category; + + + private Database _db; + + + public TestDependentUpdate( TestHarness category ) + throws PersistenceException { + + super( category, "TC27", "Dependent update objects tests" ); + _category = (JDOCategory) category; + } + + public void setUp() + throws PersistenceException, SQLException { + _db = _category.getDatabase(); + _conn = _category.getJDBCConnection(); + _conn.setAutoCommit( false ); + } + + public void runTest() + throws PersistenceException, SQLException { + + OQLQuery oql; + OQLQuery groupOql; + MasterTest master; + Group group; + Detail detail; + Detail2 detail2; + QueryResults qres; + MasterTest master2; + int cnt; + int detailId = 0; + + stream.println( "Delete everything" ); + _db.begin(); + oql = _db.getOQLQuery( "SELECT master FROM " + MasterTest.class.getName() + " master" ); + qres = oql.execute(); + + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.next() ); + } + stream.println( "Deleting " + cnt + " master objects" ); + + oql = _db.getOQLQuery( "SELECT group FROM " + Group.class.getName() + " group" ); + qres = oql.execute(); + for ( cnt = 0; qres.hasMore(); cnt++ ) { + _db.remove( qres.nextElement() ); + } + stream.println( "Deleting " + cnt + " group objects" ); + _db.commit(); + + stream.println( "Attempt to create master with details" ); + _db.begin(); + master = new MasterTest(); + master.addDetail( new Detail( 5 ) ); + detail = new Detail( 6 ); + detail.addDetail2( new Detail2() ); + detail.addDetail2( new Detail2() ); + detail.setDetail3( new Detail3( 101 ) ); + master.addDetail( detail ); + detail = new Detail( 7 ); + detail.addDetail2( new Detail2() ); + detail.addDetail2( new Detail2() ); + master.addDetail( detail ); + group = new Group(); + _db.create( group ); + master.setGroup( group ); + _db.create( master ); + _db.commit(); + + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getGroup() == null ) { + stream.println( "Error: loaded master without group: " + master ); + fail("expecting group"); + } else if ( master.getGroup().getId() != Group.DefaultId ) { + stream.println( "Error: loaded master with wrong group: " + master ); + fail("incorrect group"); + } + if ( master.getDetails() == null || + ! master.getDetails().contains( new Detail( 5 ) ) || + ! master.getDetails().contains( new Detail( 6 ) ) || + ! master.getDetails().contains( new Detail( 7 ) ) ) { + stream.println( "Error: loaded master without three details: " + master ); + fail("incorrect detail(s)"); + } + detail = master.findDetail( 5 ); + if ( detail.getDetails2() != null && detail.getDetails2().size() != 0 ) { + stream.println( "Error: loaded detail 5 with details2: " + qres.next() ); + fail("unexpected element found"); + } + detail = master.findDetail( 6 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 6 without two details: " + detail ); + fail("details' size mismatch"); + } + if ( detail.getDetail3() == null || detail.getDetail3().getId() != 101 ) { + stream.println( "Error: loaded detail 6 with wrong detail3: " + detail ); + fail("loaded detail 6 with wrong detail3: " + detail); + } + detail = master.findDetail( 7 ); + if ( detail.getDetails2() == null || detail.getDetails2().size() != 2) { + stream.println( "Error: loaded detail 7 without two details: " + detail ); + fail("details' size mismatch"); + } + } else { + stream.println( "Error: failed to create master with details and group" ); + fail("failed to create master with details and group"); + } + _db.commit(); + stream.println( "Created master with details: " + master ); + + stream.println( "Attempt to change details" ); + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("master not found"); + } + // remove detail with id == 5 + master.getDetails().remove( master.getDetails().indexOf( master.findDetail( 5 ) ) ); + // add new detail + master.addDetail( new Detail( 8 ) ); + // add new detail and create it explicitely + detail = new Detail( 9 ); + master.addDetail( detail ); + detail = (Detail) master.findDetail( 6 ); + // change 1:1 dependent relationship + detail.setDetail3( new Detail3( 102 ) ); + // delete, then create detail with id == 7 explicitly + detail = (Detail) master.findDetail( 7 ); + master.getDetails().remove( master.getDetails().indexOf( detail ) ); + master.addDetail( detail ); + _db.commit(); + + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + master.getDetails().contains( new Detail( 5 ) ) || + ! master.getDetails().contains( new Detail( 6 ) ) || + master.findDetail( 6 ).getDetails2() == null || + master.findDetail( 6 ).getDetails2().size() != 2 || + master.findDetail( 6 ).getDetail3() == null || + master.findDetail( 6 ).getDetail3().getId() != 102 || + ! master.getDetails().contains( new Detail( 7 ) ) || + ! master.getDetails().contains( new Detail( 8 ) ) || + ! master.getDetails().contains( new Detail( 9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("loaded master has wrong set of details"); + } else { + stream.println( "Details changed correctly: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + + stream.println( "Test long transaction with dirty checking" ); + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master == null ) { + stream.println( "Error: failed to find master with details group" ); + fail("master not found"); + } + _db.commit(); + _db.begin(); + master2 = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + master2.setValue1( master2.getValue1() + "2" ); + _db.commit(); + + stream.println( "Test 1" ); + try { + _db.begin(); + _db.update( master ); + _db.commit(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } catch ( ObjectModifiedException exept ) { + _db.rollback(); + stream.println( "OK: Dirty checking works" ); + } + + stream.println( "Test 2" ); + detail = new Detail( 5 ); + detail2 = new Detail2(); + detail.addDetail2( detail2 ); + master2.addDetail( detail ); + master2.getDetails().remove( new Detail( 8 ) ); + master2.getDetails().remove( new Detail( 9 ) ); + try { + _db.begin(); + _db.update( master2 ); + _db.commit(); + detailId = detail2.getId(); + stream.println( "OK: Dirty checking works" ); + } catch ( ObjectModifiedException exept ) { + _db.rollback(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } + + stream.println( "Test 3" ); + _conn.createStatement().execute( "UPDATE test_master SET value1='concurrent' WHERE id=" + + master2.getId() ); + _conn.commit(); + master2.setValue1( "long transaction new value" ); + try { + _db.begin(); + _db.update( master2 ); + _db.commit(); + stream.println( "Error: Dirty checking doesn't work" ); + fail("dirty check failed"); + } catch ( ObjectModifiedException except ) { + if (_db.isActive()) { + _db.rollback(); + } + + stream.println( "OK: Dirty checking works" ); + } + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getDetails().size() == 0 || + ! master.getDetails().contains( new Detail( 5 ) ) || + master.findDetail( 5 ).findDetail2( detailId ) == null || + ! master.getDetails().contains( new Detail( 6 ) ) || + master.findDetail( 6 ).getDetails2() == null || + master.findDetail( 6 ).getDetails2().size() != 2 || + ! master.getDetails().contains( new Detail( 7 ) ) || + master.getDetails().contains( new Detail( 8 ) ) || + master.getDetails().contains( new Detail( 9 ) ) ) { + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("unexpect set of details"); + } else { + stream.println( "Details changed correctly in the long transaction: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + + // modify an dependent object and see if it got updated + stream.println( "Test 3" ); + detail = master.findDetail( 5 ); + detail.setValue1("new updated value"); + detail.findDetail2( detailId ).setValue1("new detail 2 value"); + _db.begin(); + _db.update( master ); + _db.commit(); + + _db.begin(); + master = (MasterTest) _db.load( MasterTest.class, new Integer( MasterTest.DefaultId ) ); + if ( master != null ) { + if ( master.getDetails() == null || + master.getDetails().size() == 0 || + ! master.getDetails().contains( new Detail( 5 ) ) || + ! master.getDetails().contains( new Detail( 6 ) ) || + ! master.getDetails().contains( new Detail( 7 ) ) || + master.getDetails().contains( new Detail( 8 ) ) || + master.getDetails().contains( new Detail( 9 ) ) || + ! "new updated value".equals( master.findDetail( 5 ).getValue1()) || + master.findDetail( 5 ).findDetail2( detailId ) == null || + ! "new detail 2 value".equals( master.findDetail( 5 ).findDetail2( detailId ).getValue1() ) ) { + + stream.println( "Error: loaded master has wrong set of details: " + master ); + fail("unexpected set of details"); + } else { + stream.println( "Details changed correctly in the long transaction: " + master ); + } + } else { + stream.println( "Error: master not found" ); + fail("master not found"); + } + _db.commit(); + } + + public void tearDown() + throws PersistenceException, SQLException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + _conn.close(); + } +} Index: src/tests/ctf/jdo/tc2x/TestKeyGenGeneric.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestKeyGenGeneric.java diff -N src/tests/ctf/jdo/tc2x/TestKeyGenGeneric.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestKeyGenGeneric.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,176 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: KeyGenGeneric.java,v 1.5 2004/10/05 22:26:41 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + + +import jdo.JDOCategory; +import jdo.TestKeyGenObject; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.PersistenceException; +import harness.TestHarness; +import harness.CastorTestCase; + + +/** + * Test for generic key generators (MAX and HIGH-LOW). + */ +public class TestKeyGenGeneric extends CastorTestCase { + + private JDOCategory _category; + + private Database _db; + + public TestKeyGenGeneric( TestHarness category ) { + this( category, "TC20", "Key generators: MAX, HIGH-LOW" ); + } + + public TestKeyGenGeneric( TestHarness category, String name, String description ) { + super( category, name, description ); + _category = (JDOCategory) category; + } + + public void setUp() + throws PersistenceException { + _db = _category.getDatabase(); + } + + public void runTest() + throws PersistenceException, Exception { + + testOneKeyGen( MaxObject.class, MaxExtends.class ); + + testOneKeyGen( HighLowObject.class, HighLowExtends.class ); + + testOneKeyGen( HighLowObjectSameConnection.class, HighLowExtendsSameConnection.class ); + + } + + public void tearDown() + throws PersistenceException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + } + + /** + * The main goal of the test is to verify key generators in the case + * of "extends" relation between two classes. + * For each key generator we have a pair of classes: TestXXXObject and + * TestXXXExtends which use key generator XXX. + */ + protected boolean testOneKeyGen( Class objClass, Class extClass ) + throws PersistenceException, Exception { + + OQLQuery oql; + TestKeyGenObject object; + TestKeyGenObject ext; + QueryResults enumeration; + boolean result; + + result = true; + + // Open transaction in order to perform JDO operations + _db.begin(); + + // Create first object + object = (TestKeyGenObject) objClass.newInstance(); + stream.println( "Creating first object: " + object ); + _db.create( object ); + stream.println( "Created first object: " + object ); + + // Create second object + ext = (TestKeyGenObject) extClass.newInstance(); + stream.println( "Creating second object: " + ext ); + _db.create( ext ); + stream.println( "Created second object: " + ext ); + + _db.commit(); + + _db.begin(); + + // Find the first object and remove it + //object = (TestKeyGenObject) _db.load( objClass, object.getId() ); + oql = _db.getOQLQuery(); + oql.create( "SELECT object FROM " + objClass.getName() + + " object WHERE id = $1" ); + oql.bind( object.getId() ); + enumeration = oql.execute(); + stream.println( "Removing first object: " + object ); + if ( enumeration.hasMore() ) { + object = (TestKeyGenObject) enumeration.next(); + _db.remove( object ); + stream.println( "OK: Removed" ); + } else { + stream.println( "Error: Not found" ); + result = false; + } + + // Find the second object and remove it + //ext = (TestKeyGenObject) _db.load( extClass, ext.getId() ); + oql = _db.getOQLQuery(); + oql.create( "SELECT ext FROM " + extClass.getName() + + " ext WHERE id = $1" ); + oql.bind( ext.getId() ); + enumeration = oql.execute(); + stream.println( "Removing second object: " + ext ); + if ( enumeration.hasMore() ) { + ext = (TestKeyGenObject) enumeration.next(); + _db.remove( ext ); + stream.println( "OK: Removed" ); + } else { + stream.println( "Error: Not found" ); + result = false; + } + + _db.commit(); + + return result; + } + +} Index: src/tests/ctf/jdo/tc2x/TestKeyGenIdentity.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestKeyGenIdentity.java diff -N src/tests/ctf/jdo/tc2x/TestKeyGenIdentity.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestKeyGenIdentity.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,73 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: KeyGenIdentity.java,v 1.2 2004/06/08 10:15:59 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + + +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; + + +/** + * Test for IDENTITY key generator. An IDENTITY key generator + * make uses of the RDBMS auto - increment features to generate + * a primary key for a newly created object. + */ +public class TestKeyGenIdentity extends TestKeyGenGeneric { + + public TestKeyGenIdentity( TestHarness category ) { + + super( category, "TC23" , "Key generator: IDENTITY" ); + } + + public void runTest() + throws PersistenceException, Exception { + + testOneKeyGen( IdentityObject.class, IdentityExtends.class ); + } + +} Index: src/tests/ctf/jdo/tc2x/TestKeyGenReturning.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestKeyGenReturning.java diff -N src/tests/ctf/jdo/tc2x/TestKeyGenReturning.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestKeyGenReturning.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,72 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: KeyGenReturning.java,v 1.3 2005/05/11 17:18:50 rjoachim Exp $ + */ + + +package ctf.jdo.tc2x; + + +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; + + +/** + * Test for RETURNING key generator. + */ +public class TestKeyGenReturning extends TestKeyGenGeneric { + + public TestKeyGenReturning( TestHarness category ) { + + super( category, "TC22" , "Key generator: RETURNING" ); + } + + public void runTest() + throws PersistenceException, Exception { + + testOneKeyGen( ReturningObject.class, ReturningExtends.class ); + } + +} + Index: src/tests/ctf/jdo/tc2x/TestKeyGenSequence.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestKeyGenSequence.java diff -N src/tests/ctf/jdo/tc2x/TestKeyGenSequence.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestKeyGenSequence.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,70 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: KeyGenSequence.java,v 1.2 2004/06/08 10:17:29 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + + +import org.exolab.castor.jdo.PersistenceException; + +import harness.TestHarness; + + +/** + * Test for SEQUENCE key generator. + */ +public class TestKeyGenSequence extends TestKeyGenGeneric { + + public TestKeyGenSequence( TestHarness category ) { + super( category, "TC21", "Key generator: SEQUENCE" ); + } + + public void runTest() + throws PersistenceException, Exception { + + testOneKeyGen( SequenceObject.class, SequenceExtends.class ); + } + +} Index: src/tests/ctf/jdo/tc2x/TestKeyGenUuid.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/TestKeyGenUuid.java diff -N src/tests/ctf/jdo/tc2x/TestKeyGenUuid.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/TestKeyGenUuid.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,167 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999-2001 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: KeyGenUuid.java,v 1.4 2004/10/05 22:26:41 wguttmann Exp $ + */ + + +package ctf.jdo.tc2x; + + +import jdo.JDOCategory; + +import org.exolab.castor.jdo.Database; +import org.exolab.castor.jdo.OQLQuery; +import org.exolab.castor.jdo.QueryResults; +import org.exolab.castor.jdo.PersistenceException; +import harness.TestHarness; +import harness.CastorTestCase; + +/** + * Test for generic key generators (UUID). + */ +public class TestKeyGenUuid extends CastorTestCase { + + private JDOCategory _category; + + private Database _db; + + public TestKeyGenUuid( TestHarness category ) { + this( "TC24", "Key generator: UUID", category ); + } + + + public TestKeyGenUuid( String name, String description, TestHarness category ) { + super( category, name, description ); + _category = (JDOCategory) category; + } + + + public void setUp() + throws PersistenceException { + _db = _category.getDatabase(); + } + + public void runTest() + throws PersistenceException, Exception { + + testOneKeyGen( UuidObject.class, UuidExtends.class ); + } + + public void tearDown() + throws PersistenceException { + if ( _db.isActive() ) _db.rollback(); + _db.close(); + } + + /** + * The main goal of the test is to verify key generators in the case + * of "extends" relation between two classes. + * For each key generator we have a pair of classes: TestXXXObject and + * TestXXXExtends which use key generator XXX. + */ + protected void testOneKeyGen( Class objClass, Class extClass ) + throws PersistenceException, Exception { + + OQLQuery oql; + UuidObject object; + UuidObject ext; + QueryResults enumeration; + + // Open transaction in order to perform JDO operations + _db.begin(); + + // Create first object + object = (UuidObject) objClass.newInstance(); + stream.println( "Creating first object: " + object ); + _db.create( object ); + stream.println( "Created first object: " + object ); + + // Create second object + ext = (UuidObject) extClass.newInstance(); + stream.println( "Creating second object: " + ext ); + _db.create( ext ); + stream.println( "Created second object: " + ext ); + + _db.commit(); + + _db.begin(); + + // Find the first object and remove it + //object = (TestUuidObject) _db.load( objClass, object.getId() ); + oql = _db.getOQLQuery(); + oql.create( "SELECT object FROM " + objClass.getName() + + " object WHERE id = $1" ); + oql.bind( object.getId() ); + enumeration = oql.execute(); + stream.println( "Removing first object: " + object ); + if ( enumeration.hasMore() ) { + object = (UuidObject) enumeration.next(); + _db.remove( object ); + stream.println( "OK: Removed" ); + } else { + stream.println( "Error: Not found" ); + fail("first object not found"); + } + + // Find the second object and remove it + //ext = (TestUuidObject) _db.load( extClass, ext.getId() ); + oql = _db.getOQLQuery(); + oql.create( "SELECT ext FROM " + extClass.getName() + + " ext WHERE id = $1" ); + oql.bind( ext.getId() ); + enumeration = oql.execute(); + stream.println( "Removing second object: " + ext ); + if ( enumeration.hasMore() ) { + ext = (UuidObject) enumeration.next(); + _db.remove( ext ); + stream.println( "OK: Removed" ); + } else { + stream.println( "Error: Not found" ); + fail("second object not found"); + } + _db.commit(); + + } + +} + Index: src/tests/ctf/jdo/tc2x/UuidExtends.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/UuidExtends.java diff -N src/tests/ctf/jdo/tc2x/UuidExtends.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/UuidExtends.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,87 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestUuidExtends.java,v 1.1.1.1 2003/03/03 07:10:16 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test "extends" relation for UUID key generator. + */ +public class UuidExtends extends UuidObject +{ + + private String _ext; + + + static final String DefaultExt = "ext"; + + + public UuidExtends() + { + super(); + _ext = DefaultExt; + } + + + public void setExt( String ext ) + { + _ext = ext; + } + + + public String getExt() + { + return _ext; + } + + + public String toString() + { + return super.toString() + " / " + _ext; + } + + +} Index: src/tests/ctf/jdo/tc2x/UuidObject.java =================================================================== RCS file: src/tests/ctf/jdo/tc2x/UuidObject.java diff -N src/tests/ctf/jdo/tc2x/UuidObject.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/UuidObject.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,102 @@ +/** + * Redistribution and use of this software and associated documentation + * ("Software"), with or without modification, are permitted provided + * that the following conditions are met: + * + * 1. Redistributions of source code must retain copyright + * statements and notices. Redistributions must also contain a + * copy of this document. + * + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. The name "Exolab" must not be used to endorse or promote + * products derived from this Software without prior written + * permission of Intalio, Inc. For written permission, + * please contact info@exolab.org. + * + * 4. Products derived from this Software may not be called "Exolab" + * nor may "Exolab" appear in their names without prior written + * permission of Intalio, Inc. Exolab is a registered + * trademark of Intalio, Inc. + * + * 5. Due credit should be given to the Exolab Project + * (http://www.exolab.org/). + * + * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Copyright 1999 (C) Intalio, Inc. All Rights Reserved. + * + * $Id: TestUuidObject.java,v 1.1.1.1 2003/03/03 07:10:16 kvisco Exp $ + */ + + +package ctf.jdo.tc2x; + + +/** + * Test object for UUID key generator. + */ +public class UuidObject +{ + + + private String _id; + + + private String _attr; + + + static final String DefaultAttr = "attr"; + + + public UuidObject() + { + _attr = DefaultAttr; + } + + + public void setId( String id ) + { + _id = id; + } + + + public String getId() + { + return _id; + } + + + public void setAttr( String attr ) + { + _attr = attr; + } + + + public String getAttr() + { + return _attr; + } + + + public String toString() + { + return ( _id == null ? "null" : _id.toString() ) + " / " + _attr; + } + + +} Index: src/tests/ctf/jdo/tc2x/mapping.xml =================================================================== RCS file: src/tests/ctf/jdo/tc2x/mapping.xml diff -N src/tests/ctf/jdo/tc2x/mapping.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/tests/ctf/jdo/tc2x/mapping.xml 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,340 @@ + + + + + Test master table + + + + + + + + + + + + + + + + + Test detail table + + + + + + + + + + + + + + + + + + + + Test detail2 table + + + + + + + + + + + + + + Test detail3 table + + + + + + + + + + + + + + Test master table + + + + + + + + + + + + + + + + + Test detail table + + + + + + + + + + + + + + + + + + + + Test detail2 table + + + + + + + + + + + + + + Test detail3 table + + + + + + + + + + + + + + Test groups table + + + + + + + + + + + + Table used for MAX key generator testing + + + + + + + + + + + Table used for MAX key generator testing + + + + + + + + Table used for HIGH-LOW key generator testing + + + + + + + + + + + Table used for HIGH-LOW key generator testing + + + + + + + + Table used for HIGH-LOW key generator testing with same-connection=true + + + + + + + + + + + Table used for HIGH-LOW key generator testing with same-connection=true + + + + + + + + Table used for SEQUENCE key generator testing + + + + + + + + + + + Table used for SEQUENCE key generator testing + + + + + + + + Table used for IDENTITY key generator testing + + + + + + + + + + + Table used for IDENTITY key generator testing + + + + + + + + Table used for SEQUENCE key generator testing in RETURNING + mode for Oracle8i + + + + + + + + + + + + Table used for SEQUENCE key generator testing in RETURNING + mode for Oracle8i + + + + + + + + + Table used for UUID key generator testing + + + + + + + + + + + Table used for UUID key generator testing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +