Produced by Araxis Merge on 1/4/2018 4:54:42 PM Eastern 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | CHAMPVA_Benefit_Eligibility_v1.0.0.zip\webservice\vlh\src\test\java\gov\va\med\mbac\vlh\impl | TestVistaLinkHelper.java | Thu Dec 21 19:52:28 2017 UTC |
| 2 | CHAMPVA_Benefit_Eligibility_v1.0.0.zip\webservice\vlh\src\test\java\gov\va\med\mbac\vlh\impl | TestVistaLinkHelper.java | Thu Jan 4 21:05:37 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 344 |
| Changed | 1 | 2 |
| 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 | * The pac kage gov.v a.med.mbac .vlh.impl contains t he VistaLi nkHelper C lass, | |
| 3 | * which i mplements the IVista LinkHelper interface . | |
| 4 | * | |
| 5 | * Includi ng the uni t tests in the same package as the class es under t est allows test case s access t o | |
| 6 | * friendl y and prot ected memb ers, witho ut breakin g encapsul ation. | |
| 7 | * | |
| 8 | */ | |
| 9 | package go v.va.med.m bac.vlh.im pl; | |
| 10 | ||
| 11 | import sta tic org.mo ckito.Mock ito.mock; | |
| 12 | import gov .va.med.mb ac.vlh.com mon.IVista LinkHelper ; | |
| 13 | import gov .va.med.mb ac.vlh.imp l.VistaLin kHelper; | |
| 14 | import gov .va.med.vi stalink.ad apter.cci. VistaLinkC onnection; | |
| 15 | import gov .va.med.vi stalink.in stitution. Institutio nMapNotIni tializedEx ception; | |
| 16 | import gov .va.med.vi stalink.in stitution. Institutio nMappingNo tFoundExce ption; | |
| 17 | import gov .va.med.vi stalink.rp c.RpcReque st; | |
| 18 | import gov .va.med.vi stalink.rp c.RpcRespo nse; | |
| 19 | ||
| 20 | import jav ax.naming. InitialCon text; | |
| 21 | import jav ax.naming. NamingExce ption; | |
| 22 | import jav ax.resourc e.Resource Exception; | |
| 23 | ||
| 24 | /** | |
| 25 | * This is the TestV istaLinkHe lper class , which ge nerates mo ck objects and | |
| 26 | * allows test cases to raise exceptions to exerci se all pro cess paths during | |
| 27 | * unit te sting. | |
| 28 | * | |
| 29 | * @author PII | |
| 30 | * @versio n 1.0.0 | |
| 31 | */ | |
| 32 | ||
| 33 | public cla ss TestVis taLinkHelp er extends VistaLink Helper imp lements IV istaLinkHe lper { | |
| 34 | ||
| 35 | public static fi nal int IN ST_MAP_NOT _FOUND_EXC EPTION = 4 44; | |
| 36 | public static fi nal int IN ST_MAP_NOT _INIT_EXCE PTION = 33 3; | |
| 37 | public static fi nal int RE SOURCE_EXC EPTION = 2 22; | |
| 38 | public static fi nal int NA MING_EXCEP TION = 111 ; | |
| 39 | privat e RpcReque st mockedR eq = null; | |
| 40 | privat e RpcRespo nse mocked Resp = nul l; | |
| 41 | privat e VistaLin kConnectio n mockedVl c = null; | |
| 42 | privat e int conn ectionFail Condition = 0; | |
| 43 | ||
| 44 | /** | |
| 45 | * | |
| 46 | */ | |
| 47 | public TestVista LinkHelper (InitialCo ntext init ialContext ) { | |
| 48 | su per(initia lContext); | |
| 49 | th is.mockedR eq = mock( RpcRequest .class); | |
| 50 | th is.mockedR esp = mock (RpcRespon se.class); | |
| 51 | th is.mockedV lc = mock( VistaLinkC onnection. class); | |
| 52 | } | |
| 53 | ||
| 54 | /* | |
| 55 | * (no n-Javadoc) | |
| 56 | * | |
| 57 | * @se e gov.va.m ed.mbac.vp ls.dao.com mon.IVista LinkHelper #getRpcReq uest() | |
| 58 | */ | |
| 59 | @Overr ide | |
| 60 | public RpcReques t getRpcRe quest() { | |
| 61 | re turn mocke dReq; | |
| 62 | } | |
| 63 | ||
| 64 | /* | |
| 65 | * (no n-Javadoc) | |
| 66 | * | |
| 67 | * @se e | |
| 68 | * gov .va.med.mb ac.vpls.da o.common.I VistaLinkH elper#getC onnection( java.lang. | |
| 69 | * Str ing, java. lang.Strin g) | |
| 70 | */ | |
| 71 | @Overr ide | |
| 72 | public VistaLink Connection getConnec tion(Strin g siteId, String duz ) throws I nstitution MapNotInit ializedExc eption, | |
| 73 | Institut ionMapping NotFoundEx ception, N amingExcep tion, Reso urceExcept ion { | |
| 74 | ||
| 75 | sw itch (this .connectio nFailCondi tion) { | |
| 76 | ||
| 77 | ca se NAMING_ EXCEPTION: | |
| 78 | throw ne w NamingEx ception("N AMES!"); | |
| 79 | ca se RESOURC E_EXCEPTIO N: | |
| 80 | throw ne w Resource Exception( "RESOURCE! "); | |
| 81 | ca se INST_MA P_NOT_INIT _EXCEPTION : | |
| 82 | throw ne w Institut ionMapNotI nitialized Exception( "Instituti onal Malfu nction!"); | |
| 83 | ca se INST_MA P_NOT_FOUN D_EXCEPTIO N: | |
| 84 | throw ne w Institut ionMapping NotFoundEx ception("I nstitution al Map Mis sing."); | |
| 85 | ||
| 86 | } | |
| 87 | ||
| 88 | re turn this. mockedVlc; | |
| 89 | ||
| 90 | } | |
| 91 | ||
| 92 | /* | |
| 93 | * (no n-Javadoc) | |
| 94 | * | |
| 95 | * @se e | |
| 96 | * gov .va.med.mb ac.vlh.imp l.VistaLin kHelper#ge tAppProxyC onnection( java.lang. | |
| 97 | * Str ing, java. lang.Strin g) | |
| 98 | */ | |
| 99 | @Overr ide | |
| 100 | public VistaLink Connection getAppPro xyConnecti on(String siteId, St ring appPr oxyName) | |
| 101 | throws I nstitution MapNotInit ializedExc eption, In stitutionM appingNotF oundExcept ion, Namin gException , | |
| 102 | Resource Exception { | |
| 103 | ||
| 104 | sw itch (this .connectio nFailCondi tion) { | |
| 105 | ||
| 106 | ca se NAMING_ EXCEPTION: | |
| 107 | throw ne w NamingEx ception("N AMES!"); | |
| 108 | ca se RESOURC E_EXCEPTIO N: | |
| 109 | throw ne w Resource Exception( "RESOURCE! "); | |
| 110 | ca se INST_MA P_NOT_INIT _EXCEPTION : | |
| 111 | throw ne w Institut ionMapNotI nitialized Exception( "Instituti onal Malfu nction!"); | |
| 112 | ca se INST_MA P_NOT_FOUN D_EXCEPTIO N: | |
| 113 | throw ne w Institut ionMapping NotFoundEx ception("I nstitution al Map Mis sing."); | |
| 114 | ||
| 115 | } | |
| 116 | ||
| 117 | re turn this. mockedVlc; | |
| 118 | } | |
| 119 | ||
| 120 | /** | |
| 121 | * @re turn the m ockedReq | |
| 122 | */ | |
| 123 | public RpcReques t getMocke dReq() { | |
| 124 | re turn mocke dReq; | |
| 125 | } | |
| 126 | ||
| 127 | /** | |
| 128 | * @re turn the m ockedResp | |
| 129 | */ | |
| 130 | public RpcRespon se getMock edResp() { | |
| 131 | re turn mocke dResp; | |
| 132 | } | |
| 133 | ||
| 134 | /** | |
| 135 | * @pa ram mocked Req | |
| 136 | * th e mockedRe q to set | |
| 137 | */ | |
| 138 | public void setM ockedReq(R pcRequest mockedReq) { | |
| 139 | th is.mockedR eq = mocke dReq; | |
| 140 | } | |
| 141 | ||
| 142 | /** | |
| 143 | * @pa ram mocked Resp | |
| 144 | * th e mockedRe sp to set | |
| 145 | */ | |
| 146 | public void setM ockedResp( RpcRespons e mockedRe sp) { | |
| 147 | th is.mockedR esp = mock edResp; | |
| 148 | } | |
| 149 | ||
| 150 | /** | |
| 151 | * @pa ram aCFC | |
| 152 | * th e connecti onFailCond ition to s et | |
| 153 | */ | |
| 154 | public void setC onnectionF ailConditi on(int aCF C) { | |
| 155 | th is.connect ionFailCon dition = a CFC; | |
| 156 | } | |
| 157 | ||
| 158 | /** | |
| 159 | * @re turn the m ockedVlc | |
| 160 | */ | |
| 161 | public VistaLink Connection getMocked Vlc() { | |
| 162 | re turn mocke dVlc; | |
| 163 | } | |
| 164 | ||
| 165 | /** | |
| 166 | * @pa ram mocked Vlc | |
| 167 | * th e mockedVl c to set | |
| 168 | */ | |
| 169 | public void setM ockedVlc(V istaLinkCo nnection m ockedVlc) { | |
| 170 | th is.mockedV lc = mocke dVlc; | |
| 171 | } | |
| 172 | ||
| 173 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.