Produced by Araxis Merge on 3/13/2019 2:49:40 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\DSM\Direct Implementation\java\dsm-config\dsm-config-service-jar\src\test\java\org\nhindirect\config\service | DNSServiceTest.java | Tue Mar 12 21:58:48 2019 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\DSM-scrubbed\Direct Implementation\java\dsm-config\dsm-config-service-jar\src\test\java\org\nhindirect\config\service | DNSServiceTest.java | Wed Mar 13 02:23:06 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 4 | 738 |
| Changed | 3 | 6 |
| 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 | package or g.nhindire ct.config. service; | |
| 2 | ||
| 3 | import jav a.util.Arr ays; | |
| 4 | import jav a.util.Col lection; | |
| 5 | ||
| 6 | import org .jmock.Exp ectations; | |
| 7 | import org .jmock.Moc kery; | |
| 8 | import org .jmock.int egration.j unit3.JUni t3Mockery; | |
| 9 | import org .jmock.int egration.j unit3.Mock ObjectTest Case; | |
| 10 | import org .nhindirec t.config.s ervice.imp l.DNSServi ceImpl; | |
| 11 | import org .nhindirec t.config.s tore.DNSRe cord; | |
| 12 | import org .nhindirec t.config.s tore.dao.D NSDao; | |
| 13 | import org .nhindirec t.config.s tore.util. DNSRecordU tils; | |
| 14 | import org .xbill.DNS .Type; | |
| 15 | ||
| 16 | public cla ss DNSServ iceTest ex tends Mock ObjectTest Case | |
| 17 | { | |
| 18 | privat e Mockery context = new JUnit3 Mockery(); | |
| 19 | ||
| 20 | /** | |
| 21 | * Def ault const ructor. | |
| 22 | * | |
| 23 | * @pa ram testNa me | |
| 24 | * Th e test nam e. | |
| 25 | */ | |
| 26 | public DNSServic eTest(Stri ng testNam e) | |
| 27 | { | |
| 28 | su per(testNa me); | |
| 29 | } | |
| 30 | ||
| 31 | /* | |
| 32 | * (no n-Javadoc) | |
| 33 | * | |
| 34 | * @se e junit.fr amework.Te stCase#set Up() | |
| 35 | */ | |
| 36 | @Overr ide | |
| 37 | protec ted void s etUp() thr ows Except ion | |
| 38 | { | |
| 39 | su per.setUp( ); | |
| 40 | } | |
| 41 | ||
| 42 | /* | |
| 43 | * (no n-Javadoc) | |
| 44 | * | |
| 45 | * @se e junit.fr amework.Te stCase#tea rDown() | |
| 46 | */ | |
| 47 | @Overr ide | |
| 48 | protec ted void t earDown() throws Exc eption | |
| 49 | { | |
| 50 | su per.tearDo wn(); | |
| 51 | } | |
| 52 | ||
| 53 | /** | |
| 54 | * Tes t the addD NS method. | |
| 55 | */ | |
| 56 | public void test AddDNS() | |
| 57 | { | |
| 58 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 59 | ||
| 60 | final Coll ection<DNS Record> re cords = Ar rays.asLis t(DNSRecor dUtils.cre ateARecord ("example. domain.com ", 84000L, " IP ")); | |
| 61 | ||
| 62 | ||
| 63 | co ntext.chec king(new E xpectation s() | |
| 64 | { | |
| 65 | { | |
| 66 | oneOf( dnsDao).ad d(records) ; | |
| 67 | } | |
| 68 | }) ; | |
| 69 | ||
| 70 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 71 | se rvice.setD ao(dnsDao) ; | |
| 72 | ||
| 73 | tr y | |
| 74 | { | |
| 75 | service. addDNS(rec ords); | |
| 76 | } | |
| 77 | ca tch (Excep tion e) | |
| 78 | { | |
| 79 | fail("Ex ception th rown"); | |
| 80 | } | |
| 81 | } | |
| 82 | ||
| 83 | /** | |
| 84 | * Tes t the getD NSCount me thod. | |
| 85 | */ | |
| 86 | public void test GetCount() | |
| 87 | { | |
| 88 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 89 | ||
| 90 | co ntext.chec king(new E xpectation s() | |
| 91 | { | |
| 92 | { | |
| 93 | oneOf( dnsDao).co unt(); | |
| 94 | } | |
| 95 | }) ; | |
| 96 | ||
| 97 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 98 | se rvice.setD ao(dnsDao) ; | |
| 99 | ||
| 100 | tr y | |
| 101 | { | |
| 102 | service. getDNSCoun t(); | |
| 103 | } | |
| 104 | ca tch (Excep tion e) | |
| 105 | { | |
| 106 | fail("Ex ception th rown"); | |
| 107 | } | |
| 108 | } | |
| 109 | ||
| 110 | /** | |
| 111 | * Tes t the getD NSByName m ethod. | |
| 112 | */ | |
| 113 | public void test GetDNSByNa me() | |
| 114 | { | |
| 115 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 116 | fi nal String name = "e xample.dom ain.com"; | |
| 117 | ||
| 118 | co ntext.chec king(new E xpectation s() | |
| 119 | { | |
| 120 | { | |
| 121 | oneOf( dnsDao).ge t(name); | |
| 122 | } | |
| 123 | }) ; | |
| 124 | ||
| 125 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 126 | se rvice.setD ao(dnsDao) ; | |
| 127 | ||
| 128 | tr y | |
| 129 | { | |
| 130 | service. getDNSByNa me(name); | |
| 131 | } | |
| 132 | ca tch (Excep tion e) | |
| 133 | { | |
| 134 | fail("Ex ception th rown"); | |
| 135 | } | |
| 136 | } | |
| 137 | ||
| 138 | ||
| 139 | /** | |
| 140 | * Tes t the getD NSByType m ethod. | |
| 141 | */ | |
| 142 | public void test GetDNSByTy pe() | |
| 143 | { | |
| 144 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 145 | fi nal int ty pe = Type. A; | |
| 146 | ||
| 147 | co ntext.chec king(new E xpectation s() | |
| 148 | { | |
| 149 | { | |
| 150 | oneOf( dnsDao).ge t(type); | |
| 151 | } | |
| 152 | }) ; | |
| 153 | ||
| 154 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 155 | se rvice.setD ao(dnsDao) ; | |
| 156 | ||
| 157 | tr y | |
| 158 | { | |
| 159 | service. getDNSByTy pe(type); | |
| 160 | } | |
| 161 | ca tch (Excep tion e) | |
| 162 | { | |
| 163 | fail("Ex ception th rown"); | |
| 164 | } | |
| 165 | } | |
| 166 | ||
| 167 | /** | |
| 168 | * Tes t the getD NSByNameAn dType meth od. | |
| 169 | */ | |
| 170 | public void test GetDNSByNa meAndType( ) | |
| 171 | { | |
| 172 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 173 | fi nal String name = "e xample.dom ain.com"; | |
| 174 | fi nal int ty pe = Type. A; | |
| 175 | ||
| 176 | co ntext.chec king(new E xpectation s() | |
| 177 | { | |
| 178 | { | |
| 179 | oneOf( dnsDao).ge t(name, ty pe); | |
| 180 | } | |
| 181 | }) ; | |
| 182 | ||
| 183 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 184 | se rvice.setD ao(dnsDao) ; | |
| 185 | ||
| 186 | tr y | |
| 187 | { | |
| 188 | service. getDNSByNa meAndType( name, type ); | |
| 189 | } | |
| 190 | ca tch (Excep tion e) | |
| 191 | { | |
| 192 | fail("Ex ception th rown"); | |
| 193 | } | |
| 194 | } | |
| 195 | ||
| 196 | ||
| 197 | /** | |
| 198 | * Tes t the getD NSByRecord Id method. | |
| 199 | */ | |
| 200 | public void test GetDNSByRe cordId() | |
| 201 | { | |
| 202 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 203 | fi nal long r ecId = 838 7; | |
| 204 | ||
| 205 | co ntext.chec king(new E xpectation s() | |
| 206 | { | |
| 207 | { | |
| 208 | oneOf( dnsDao).ge t(recId); | |
| 209 | } | |
| 210 | }) ; | |
| 211 | ||
| 212 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 213 | se rvice.setD ao(dnsDao) ; | |
| 214 | ||
| 215 | tr y | |
| 216 | { | |
| 217 | service. getDNSByRe cordId(rec Id); | |
| 218 | } | |
| 219 | ca tch (Excep tion e) | |
| 220 | { | |
| 221 | fail("Ex ception th rown"); | |
| 222 | } | |
| 223 | } | |
| 224 | ||
| 225 | /** | |
| 226 | * Tes t the getD NSByRecord Ids method . | |
| 227 | */ | |
| 228 | public void test GetDNSByRe cordIds() | |
| 229 | { | |
| 230 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 231 | fi nal long[] recIds = new long[] {8387}; | |
| 232 | ||
| 233 | co ntext.chec king(new E xpectation s() | |
| 234 | { | |
| 235 | { | |
| 236 | oneOf( dnsDao).ge t(recIds); | |
| 237 | } | |
| 238 | }) ; | |
| 239 | ||
| 240 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 241 | se rvice.setD ao(dnsDao) ; | |
| 242 | ||
| 243 | tr y | |
| 244 | { | |
| 245 | service. getDNSByRe cordIds(re cIds); | |
| 246 | } | |
| 247 | ca tch (Excep tion e) | |
| 248 | { | |
| 249 | fail("Ex ception th rown"); | |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 253 | /** | |
| 254 | * Tes t the remo veDNS meth od. | |
| 255 | */ | |
| 256 | public void test RemoveDNS( ) | |
| 257 | { | |
| 258 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 259 | ||
| 260 | final Coll ection<DNS Record> re cords = Ar rays.asLis t(DNSRecor dUtils.cre ateARecord ("example. domain.com ", 84000L, " IP ")); | |
| 261 | ||
| 262 | ||
| 263 | co ntext.chec king(new E xpectation s() | |
| 264 | { | |
| 265 | { | |
| 266 | oneOf( dnsDao).re move(recor ds); | |
| 267 | } | |
| 268 | }) ; | |
| 269 | ||
| 270 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 271 | se rvice.setD ao(dnsDao) ; | |
| 272 | ||
| 273 | tr y | |
| 274 | { | |
| 275 | service. removeDNS( records); | |
| 276 | } | |
| 277 | ca tch (Excep tion e) | |
| 278 | { | |
| 279 | fail("Ex ception th rown"); | |
| 280 | } | |
| 281 | } | |
| 282 | ||
| 283 | /** | |
| 284 | * Tes t the remo veDNSByRec ordId meth od. | |
| 285 | */ | |
| 286 | public void test RemoveDNSB yRecordId( ) | |
| 287 | { | |
| 288 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 289 | ||
| 290 | fi nal long r ecId = 838 7; | |
| 291 | ||
| 292 | ||
| 293 | co ntext.chec king(new E xpectation s() | |
| 294 | { | |
| 295 | { | |
| 296 | oneOf( dnsDao).re move(recId ); | |
| 297 | } | |
| 298 | }) ; | |
| 299 | ||
| 300 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 301 | se rvice.setD ao(dnsDao) ; | |
| 302 | ||
| 303 | tr y | |
| 304 | { | |
| 305 | service. removeDNSB yRecordId( recId); | |
| 306 | } | |
| 307 | ca tch (Excep tion e) | |
| 308 | { | |
| 309 | fail("Ex ception th rown"); | |
| 310 | } | |
| 311 | } | |
| 312 | ||
| 313 | /** | |
| 314 | * Tes t the remo veDNSByRec ordIds met hod. | |
| 315 | */ | |
| 316 | public void test RemoveDNSB yRecordIds () | |
| 317 | { | |
| 318 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 319 | ||
| 320 | fi nal long[] recIds = new long[] {8387}; | |
| 321 | ||
| 322 | ||
| 323 | co ntext.chec king(new E xpectation s() | |
| 324 | { | |
| 325 | { | |
| 326 | oneOf( dnsDao).re move(recId s); | |
| 327 | } | |
| 328 | }) ; | |
| 329 | ||
| 330 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 331 | se rvice.setD ao(dnsDao) ; | |
| 332 | ||
| 333 | tr y | |
| 334 | { | |
| 335 | service. removeDNSB yRecordIds (recIds); | |
| 336 | } | |
| 337 | ca tch (Excep tion e) | |
| 338 | { | |
| 339 | fail("Ex ception th rown"); | |
| 340 | } | |
| 341 | } | |
| 342 | ||
| 343 | /** | |
| 344 | * Tes t the upda teDNS meth od. | |
| 345 | */ | |
| 346 | public void test UpdateDNS( ) | |
| 347 | { | |
| 348 | fi nal DNSDao dnsDao = context.mo ck(DNSDao. class); | |
| 349 | ||
| 350 | final DNSR ecord reco rd = DNSRe cordUtils. createARec ord("examp le.domain. com", 8400 0L, " IP "); | |
| 351 | fi nal long r ecId = 838 7; | |
| 352 | ||
| 353 | co ntext.chec king(new E xpectation s() | |
| 354 | { | |
| 355 | { | |
| 356 | oneOf( dnsDao).up date(recId , record); | |
| 357 | } | |
| 358 | }) ; | |
| 359 | ||
| 360 | DN SServiceIm pl service = new DNS ServiceImp l(); | |
| 361 | se rvice.setD ao(dnsDao) ; | |
| 362 | ||
| 363 | tr y | |
| 364 | { | |
| 365 | service. updateDNS( recId, rec ord); | |
| 366 | } | |
| 367 | ca tch (Excep tion e) | |
| 368 | { | |
| 369 | fail("Ex ception th rown"); | |
| 370 | } | |
| 371 | } | |
| 372 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.