313. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:46 PM Central Standard 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.

313.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealmClient\main\src\test\gov\va\med\imaging\vistarealm TestRealmErrorContext.java Mon Dec 4 21:34:42 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingVistaRealmClient\main\src\test\gov\va\med\imaging\vistarealm TestRealmErrorContext.java Mon Dec 4 22:03:51 2017 UTC

313.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 242
Changed 2 4
Inserted 0 0
Removed 0 0

313.3 Comparison options

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

313.4 Active regular expressions

No regular expressions were active.

313.5 Comparison detail

  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:          
WERFEJ
  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 gging.log4 j.LogManag er;
  34   import org .apache.lo gging.log4 j.Logger;
  35   import org .junit.Tes t;
  36   import sta tic org.ju nit.Assert .*;
  37  
  38   /**
  39    * @author         
WERFEJ
  40    *
  41    */
  42   public cla ss TestRea lmErrorCon text
  43   {
  44  
  45           pr ivate fina l static L ogger logg er = 
  46                    LogM anager.get Logger(Tes tRealmErro rContext.c lass);
  47           
  48           pr ivate fina l static i nt ITERATI ONS = 100;
  49           pr ivate fina l static i nt THREADS  = 20;
  50           
  51           pr ivate Coun tDownLatch  waiter =  new CountD ownLatch(T HREADS);
  52           
  53           @T est
  54           pu blic void  threadedTe ster()
  55           {                 
  56                    for( int i = 0;  i < THREA DS; i++)
  57                    {
  58                             RealmE rrorContex tThread t  = new Real mErrorCont extThread( "THREAD ["  + i + "]" );
  59                             t.setD aemon(fals e);
  60                             t.star t();
  61                    }
  62                    
  63                    try
  64                    {
  65                             waiter .await(30,  TimeUnit. SECONDS);                       
  66                    }
  67                    catc h(Interrup tedExcepti on iX)
  68                    {
  69                             iX.pri ntStackTra ce();
  70                             fail(i X.getMessa ge());                    
  71                    }
  72                    asse rtEquals(0 , waiter.g etCount()) ;              
  73           }
  74           
  75           cl ass RealmE rrorContex tThread
  76           ex tends Thre ad
  77           {
  78                    publ ic RealmEr rorContext Thread(Str ing name)
  79                    {
  80                             super( name);
  81                    }
  82  
  83                    @Ove rride
  84                    publ ic void ru n()
  85                    {
  86                             logger .info("Sta rting test  on thread  [" + getN ame() + "] ");
  87                             
  88                             for(in t i = 0; i  < ITERATI ONS; i++)
  89                             {
  90                                      RealmErr orContext. clear();
  91                                      String e xpectedExc eptionMess age = "Thr ead '" + t his.getNam e() + "',  iteration  '" + i + " ' exceptio n message" ;
  92                                      String e xpectedExc eptionClas sName = "T hread[" +  this.getNa me() + "],  " + i;
  93                                      String e xpectedSki pString =  "Skip";
  94                                      RealmErr orContext. setPropert y(RealmErr orContext. realmError ContextExc eptionMess age, expec tedExcepti onMessage) ;
  95                                      RealmErr orContext. setPropert y(RealmErr orContext. realmError ContextExc eptionName , expected ExceptionC lassName);
  96                                      RealmErr orContext. setSkipVis taAuthenti cation(exp ectedSkipS tring);
  97                                      try
  98                                      {
  99                                               Thread.sle ep(10);
  100                                      }
  101                                      catch (I nterrupted Exception  e)
  102                                      {
  103                                               fail(e.get Message()) ;
  104                                      }
  105                                      assertEq uals(expec tedExcepti onMessage,  RealmErro rContext.g etProperty (RealmErro rContext.r ealmErrorC ontextExce ptionMessa ge));
  106                                      assertEq uals(expec tedExcepti onClassNam e, RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionNam e));
  107                                      assertEq uals(expec tedSkipStr ing, 
  108                                                       Re almErrorCo ntext.getP roperty(Re almErrorCo ntext.real mErrorCont extSkipVis taAuthenti cation));
  109                                      
  110                                      RealmErr orContext. unsetRealm ErrorConte xt();
  111                                      assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionMes sage));
  112                                      assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextEx ceptionNam e));
  113                                      assertNu ll(RealmEr rorContext .getProper ty(RealmEr rorContext .realmErro rContextSk ipVistaAut henticatio n));
  114                                      
  115                             }
  116                             
  117                             waiter .countDown ();
  118                             logger .info("Tes t thread [ " + getNam e() + "] c omplete");
  119                             
  120                    }
  121                    
  122           }
  123   }