Produced by Araxis Merge on 7/10/2017 1:01:45 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\ImagingVistaRealmClient\main\src\test\gov\va\med\imaging\vistarealm | TestRealmErrorContext.java | Thu Jun 29 17:22:25 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingVistaRealmClient\main\src\test\gov\va\med\imaging\vistarealm | TestRealmErrorContext.java | Thu Jul 6 15:03:50 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 240 |
| Changed | 2 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /** | |
| 2 | * | |
| 3 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: May 24, 2011 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.vis tarealm; | |
| 27 | ||
| 28 | import gov .va.med.im aging.tomc at.vistare alm.RealmE rrorContex t; | |
| 29 | ||
| 30 | import jav a.util.con current.Co untDownLat ch; | |
| 31 | import jav a.util.con current.Ti meUnit; | |
| 32 | ||
| 33 | import org .apache.lo g4j.Logger ; | |
| 34 | import org .junit.Tes t; | |
| 35 | import sta tic org.ju nit.Assert .*; | |
| 36 | ||
| 37 | /** | |
| 38 | * @author
|
|
| 39 | * | |
| 40 | */ | |
| 41 | public cla ss TestRea lmErrorCon text | |
| 42 | { | |
| 43 | ||
| 44 | pr ivate fina l static L ogger logg er = | |
| 45 | Logg er.getLogg er(TestRea lmErrorCon text.class ); | |
| 46 | ||
| 47 | pr ivate fina l static i nt ITERATI ONS = 100; | |
| 48 | pr ivate fina l static i nt THREADS = 20; | |
| 49 | ||
| 50 | pr ivate Coun tDownLatch waiter = new CountD ownLatch(T HREADS); | |
| 51 | ||
| 52 | @T est | |
| 53 | pu blic void threadedTe ster() | |
| 54 | { | |
| 55 | for( int i = 0; i < THREA DS; i++) | |
| 56 | { | |
| 57 | RealmE rrorContex tThread t = new Real mErrorCont extThread( "THREAD [" + i + "]" ); | |
| 58 | t.setD aemon(fals e); | |
| 59 | t.star t(); | |
| 60 | } | |
| 61 | ||
| 62 | try | |
| 63 | { | |
| 64 | waiter .await(30, TimeUnit. SECONDS); | |
| 65 | } | |
| 66 | catc h(Interrup tedExcepti on iX) | |
| 67 | { | |
| 68 | iX.pri ntStackTra ce(); | |
| 69 | fail(i X.getMessa ge()); | |
| 70 | } | |
| 71 | asse rtEquals(0 , waiter.g etCount()) ; | |
| 72 | } | |
| 73 | ||
| 74 | cl ass RealmE rrorContex tThread | |
| 75 | ex tends Thre ad | |
| 76 | { | |
| 77 | publ ic RealmEr rorContext Thread(Str ing name) | |
| 78 | { | |
| 79 | super( name); | |
| 80 | } | |
| 81 | ||
| 82 | @Ove rride | |
| 83 | publ ic void ru n() | |
| 84 | { | |
| 85 | logger .info("Sta rting test on thread [" + getN ame() + "] "); | |
| 86 | ||
| 87 | for(in t i = 0; i < ITERATI ONS; i++) | |
| 88 | { | |
| 89 | RealmErr orContext. clear(); | |
| 90 | String e xpectedExc eptionMess age = "Thr ead '" + t his.getNam e() + "', iteration '" + i + " ' exceptio n message" ; | |
| 91 | String e xpectedExc eptionClas sName = "T hread[" + this.getNa me() + "], " + i; | |
| 92 | String e xpectedSki pString = "Skip"; | |
| 93 | RealmErr orContext. setPropert y(RealmErr orContext. realmError ContextExc eptionMess age, expec tedExcepti onMessage) ; | |
| 94 | RealmErr orContext. setPropert y(RealmErr orContext. realmError ContextExc eptionName , expected ExceptionC lassName); | |
| 95 | RealmErr orContext. setSkipVis taAuthenti cation(exp ectedSkipS tring); | |
| 96 | try | |
| 97 | { | |
| 98 | Thread.sle ep(10); | |
| 99 | } | |
| 100 | catch (I nterrupted Exception e) | |
| 101 | { | |
| 102 | fail(e.get Message()) ; | |
| 103 | } | |
| 104 | assertEq uals(expec tedExcepti onMessage, RealmErro rContext.g etProperty (RealmErro rContext.r ealmErrorC ontextExce ptionMessa ge)); | |
| 105 | assertEq uals(expec tedExcepti onClassNam e, RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionNam e)); | |
| 106 | assertEq uals(expec tedSkipStr ing, | |
| 107 | Re almErrorCo ntext.getP roperty(Re almErrorCo ntext.real mErrorCont extSkipVis taAuthenti cation)); | |
| 108 | ||
| 109 | RealmErr orContext. unsetRealm ErrorConte xt(); | |
| 110 | assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionMes sage)); | |
| 111 | assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionNam e)); | |
| 112 | assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextSk ipVistaAut henticatio n)); | |
| 113 | ||
| 114 | } | |
| 115 | ||
| 116 | waiter .countDown (); | |
| 117 | logger .info("Tes t thread [ " + getNam e() + "] c omplete"); | |
| 118 | ||
| 119 | } | |
| 120 | ||
| 121 | } | |
| 122 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.