Produced by Araxis Merge on 3/13/2019 2:49:39 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\dns\src\test\java\org\nhindirect\dns\tools | DNSManager_functional_Test.java | Tue Mar 12 22:00:56 2019 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\DSM-scrubbed\Direct Implementation\java\dns\src\test\java\org\nhindirect\dns\tools | DNSManager_functional_Test.java | Wed Mar 13 02:19:22 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1228 |
| 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 | package or g.nhindire ct.dns.too ls; | |
| 2 | ||
| 3 | import jav a.net.URL; | |
| 4 | import jav a.util.Arr ayList; | |
| 5 | import jav a.util.Col lection; | |
| 6 | ||
| 7 | import org .apache.mi na.util.Av ailablePor tFinder; | |
| 8 | import org .nhind.con fig.Certif icate; | |
| 9 | import org .nhind.con fig.Config urationSer viceProxy; | |
| 10 | import org .nhind.con fig.DnsRec ord; | |
| 11 | import org .nhindirec t.dns.Conf igServiceD NSStore; | |
| 12 | import org .nhindirec t.dns.DNSS erver; | |
| 13 | import org .nhindirec t.dns.DNSS erverSetti ngs; | |
| 14 | import org .nhindirec t.dns.tool s.DNSManag er; | |
| 15 | import org .nhindirec t.dns.util .BaseTestP lan; | |
| 16 | import org .nhindirec t.dns.util .ConfigSer viceRunner ; | |
| 17 | import org .xbill.DNS .ARecord; | |
| 18 | import org .xbill.DNS .DClass; | |
| 19 | import org .xbill.DNS .MXRecord; | |
| 20 | import org .xbill.DNS .Name; | |
| 21 | import org .xbill.DNS .Record; | |
| 22 | import org .xbill.DNS .SOARecord ; | |
| 23 | import org .xbill.DNS .Type; | |
| 24 | ||
| 25 | import jun it.framewo rk.TestCas e; | |
| 26 | ||
| 27 | public cla ss DNSMana ger_functi onal_Test extends Te stCase | |
| 28 | { | |
| 29 | ab stract cla ss TestPla n extends BaseTestPl an | |
| 30 | { | |
| 31 | prot ected stat ic final i nt ERROR_F UNCTION_FA ILED = 0x7 877; // b ogus error code for our test p urposes | |
| 32 | ||
| 33 | prot ected int port; | |
| 34 | prot ected DNSS erver serv er = null; | |
| 35 | prot ected Conf igurationS erviceProx y proxy; | |
| 36 | ||
| 37 | prot ected Reco rd toRecor d(DnsRecor d rec) thr ows Except ion | |
| 38 | { | |
| 39 | ||
| 40 | return Record.ne wRecord(Na me.fromStr ing(rec.ge tName()), rec.getTyp e(), rec.g etDclass() , rec.getT tl(), rec. getData()) ; | |
| 41 | } | |
| 42 | ||
| 43 | @Ove rride | |
| 44 | prot ected void setupMock s() throws Exception | |
| 45 | { | |
| 46 | if (!C onfigServi ceRunner.i sServiceRu nning()) | |
| 47 | ConfigSe rviceRunne r.startCon figService (); | |
| 48 | ||
| 49 | proxy = new Conf igurationS erviceProx y(ConfigSe rviceRunne r.getConfi gServiceUR L()); | |
| 50 | ||
| 51 | cleanR ecords(); | |
| 52 | ||
| 53 | port = Available PortFinder .getNextAv ailable(10 24); | |
| 54 | DNSSer verSetting s settings = new DNS ServerSett ings(); | |
| 55 | settin gs.setPort (port); | |
| 56 | ||
| 57 | server = new DNS Server(new ConfigSer viceDNSSto re(new URL (ConfigSer viceRunner .getConfig ServiceURL ())), sett ings); | |
| 58 | ||
| 59 | server .start(); | |
| 60 | DNSMan ager.setEx itOnEndCom mands(fals e); | |
| 61 | } | |
| 62 | ||
| 63 | @Ove rride | |
| 64 | prot ected void performIn ner() thro ws Excepti on | |
| 65 | { | |
| 66 | Collec tion<Strin g[]> comma nds = getC ommands(); | |
| 67 | ||
| 68 | ||
| 69 | for (S tring[] co mmandSet : commands) | |
| 70 | { | |
| 71 | ||
| 72 | String[] args = ne w String[c ommandSet. length + 2 ]; | |
| 73 | args[0] = "config url"; | |
| 74 | args[1] = ConfigS erviceRunn er.getConf igServiceU RL(); | |
| 75 | System.a rraycopy(c ommandSet, 0, args, 2, command Set.length ); | |
| 76 | DNSManag er.main(ar gs); | |
| 77 | } | |
| 78 | ||
| 79 | doAsse rtions(); | |
| 80 | } | |
| 81 | ||
| 82 | @Ove rride | |
| 83 | prot ected void tearDownM ocks() thr ows Except ion | |
| 84 | { | |
| 85 | if (se rver != nu ll) | |
| 86 | server.s top(); | |
| 87 | } | |
| 88 | ||
| 89 | priv ate void c leanRecord s() throws Exception | |
| 90 | { | |
| 91 | DnsRec ord[] rec = proxy.ge tDNSByType (Type.ANY) ; | |
| 92 | ||
| 93 | if (re c != null && rec.len gth > 0) | |
| 94 | proxy.re moveDNS(re c); | |
| 95 | ||
| 96 | rec = proxy.getD NSByType(T ype.ANY); | |
| 97 | ||
| 98 | assert Null(rec); | |
| 99 | ||
| 100 | ||
| 101 | Certif icate[] ce rts = prox y.getCerti ficatesFor Owner(null , null); | |
| 102 | if (ce rts != nul l && certs .length > 0) | |
| 103 | { | |
| 104 | long[] i ds = new l ong[certs. length]; | |
| 105 | int cnt = 0; | |
| 106 | for (Cer tificate c ert : cert s) | |
| 107 | ids[cnt++] = cert.ge tId(); | |
| 108 | ||
| 109 | proxy.re moveCertif icates(ids ); | |
| 110 | } | |
| 111 | ||
| 112 | certs = proxy.ge tCertifica tesForOwne r("", null ); | |
| 113 | ||
| 114 | assert Null(certs ); | |
| 115 | } | |
| 116 | ||
| 117 | prot ected abst ract Colle ction<Stri ng[]> getC ommands() throws Exc eption; | |
| 118 | ||
| 119 | prot ected abst ract void doAssertio ns() throw s Exceptio n; | |
| 120 | } | |
| 121 | ||
| 122 | pu blic void testAddANa me_AssertR ecordAdded () throws Exception | |
| 123 | { | |
| 124 | new TestPlan() | |
| 125 | { | |
| 126 | @Overr ide | |
| 127 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 128 | { | |
| 129 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 130 | ||
| 131 | String[] command = new Strin g[] {"dns_ aname_add" , "example .domain.co m", "127.0 .0.1", "36 00"}; | |
| 132 | commands .add(comma nd); | |
| 133 | ||
| 134 | return c ommands; | |
| 135 | } | |
| 136 | ||
| 137 | @Overr ide | |
| 138 | protec ted void d oAssertion s() throws Exception | |
| 139 | { | |
| 140 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.A) ; | |
| 141 | assertNo tNull(reco rds); | |
| 142 | assertEq uals(1, re cords.leng th); | |
| 143 | ||
| 144 | DnsRecor d rec = re cords[0]; | |
| 145 | assertEq uals("exam ple.domain .com.", re c.getName( )); | |
| 146 | assertEq uals(3600, rec.getTt l()); | |
| 147 | assertEq uals(Type. A, rec.get Type()); | |
| 148 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 149 | ||
| 150 | ARecord aRec = (AR ecord)toRe cord(rec); | |
| 151 | assertEq uals(aRec. getAddress ().getHost Address(), "127.0.0. 1"); | |
| 152 | ||
| 153 | } | |
| 154 | ||
| 155 | }.pe rform(); | |
| 156 | } | |
| 157 | ||
| 158 | pu blic void testAddDup AName_Asse rtOneEntry () throws Exception | |
| 159 | { | |
| 160 | new TestPlan() | |
| 161 | { | |
| 162 | @Overr ide | |
| 163 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 164 | { | |
| 165 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 166 | ||
| 167 | String[] command = new Strin g[] {"dns_ aname_add" , "example .domain.co m", "127.0 .0.1", "36 00"}; | |
| 168 | commands .add(comma nd); | |
| 169 | command = new Stri ng[] {"dns _aname_add ", "exampl e.domain.c om", "127. 0.0.1", "3 600"}; | |
| 170 | commands .add(comma nd); | |
| 171 | ||
| 172 | return c ommands; | |
| 173 | } | |
| 174 | ||
| 175 | @Overr ide | |
| 176 | protec ted void d oAssertion s() throws Exception | |
| 177 | { | |
| 178 | // make sure the f irst comma nd worked | |
| 179 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.A) ; | |
| 180 | assertNo tNull(reco rds); | |
| 181 | assertEq uals(1, re cords.leng th); | |
| 182 | ||
| 183 | DnsRecor d rec = re cords[0]; | |
| 184 | assertEq uals("exam ple.domain .com.", re c.getName( )); | |
| 185 | assertEq uals(3600, rec.getTt l()); | |
| 186 | assertEq uals(Type. A, rec.get Type()); | |
| 187 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 188 | ||
| 189 | ARecord aRec = (AR ecord)toRe cord(rec); | |
| 190 | assertEq uals(aRec. getAddress ().getHost Address(), "127.0.0. 1"); | |
| 191 | } | |
| 192 | ||
| 193 | }.pe rform(); | |
| 194 | } | |
| 195 | ||
| 196 | pu blic void testAddANa meEnsure_A ssertRecor dAdded() t hrows Exce ption | |
| 197 | { | |
| 198 | new TestPlan() | |
| 199 | { | |
| 200 | @Overr ide | |
| 201 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 202 | { | |
| 203 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 204 | ||
| 205 | String[] command = new Strin g[] {"dns_ aname_ensu re", "exam ple.domain .com", "12 7.0.0.1", "3600"}; | |
| 206 | commands .add(comma nd); | |
| 207 | ||
| 208 | return c ommands; | |
| 209 | } | |
| 210 | ||
| 211 | @Overr ide | |
| 212 | protec ted void d oAssertion s() throws Exception | |
| 213 | { | |
| 214 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.A) ; | |
| 215 | assertNo tNull(reco rds); | |
| 216 | assertEq uals(1, re cords.leng th); | |
| 217 | ||
| 218 | DnsRecor d rec = re cords[0]; | |
| 219 | assertEq uals("exam ple.domain .com.", re c.getName( )); | |
| 220 | assertEq uals(3600, rec.getTt l()); | |
| 221 | assertEq uals(Type. A, rec.get Type()); | |
| 222 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 223 | ||
| 224 | ARecord aRec = (AR ecord)toRe cord(rec); | |
| 225 | assertEq uals(aRec. getAddress ().getHost Address(), "127.0.0. 1"); | |
| 226 | ||
| 227 | } | |
| 228 | ||
| 229 | }.pe rform(); | |
| 230 | } | |
| 231 | ||
| 232 | pu blic void testDupANa meEnsure_A ssertOneEn try() thro ws Excepti on | |
| 233 | { | |
| 234 | new TestPlan() | |
| 235 | { | |
| 236 | @Overr ide | |
| 237 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 238 | { | |
| 239 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 240 | ||
| 241 | String[] command = new Strin g[] {"dns_ aname_ensu re", "exam ple.domain .com", "12 7.0.0.1", "3600"}; | |
| 242 | commands .add(comma nd); | |
| 243 | command = new Stri ng[] {"dns _aname_ens ure", "exa mple.domai n.com", "1 27.0.0.1", "3600"}; | |
| 244 | commands .add(comma nd); | |
| 245 | ||
| 246 | return c ommands; | |
| 247 | } | |
| 248 | ||
| 249 | @Overr ide | |
| 250 | protec ted void d oAssertion s() throws Exception | |
| 251 | { | |
| 252 | // make sure firs t command worked | |
| 253 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.A) ; | |
| 254 | assertNo tNull(reco rds); | |
| 255 | assertEq uals(1, re cords.leng th); | |
| 256 | ||
| 257 | DnsRecor d rec = re cords[0]; | |
| 258 | assertEq uals("exam ple.domain .com.", re c.getName( )); | |
| 259 | assertEq uals(3600, rec.getTt l()); | |
| 260 | assertEq uals(Type. A, rec.get Type()); | |
| 261 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 262 | ||
| 263 | ARecord aRec = (AR ecord)toRe cord(rec); | |
| 264 | assertEq uals(aRec. getAddress ().getHost Address(), "127.0.0. 1"); | |
| 265 | } | |
| 266 | ||
| 267 | }.pe rform(); | |
| 268 | } | |
| 269 | ||
| 270 | ||
| 271 | pu blic void testAddSOA _AssertRec ordAdded() throws Ex ception | |
| 272 | { | |
| 273 | new TestPlan() | |
| 274 | { | |
| 275 | @Overr ide | |
| 276 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 277 | { | |
| 278 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 279 | ||
| 280 | String[] command = new Strin g[] {"dns_ soa_add", "example.c om", "ns1. example.co m", "gm255 2@example. com", "1", "3600"}; | |
| 281 | commands .add(comma nd); | |
| 282 | ||
| 283 | return c ommands; | |
| 284 | } | |
| 285 | ||
| 286 | @Overr ide | |
| 287 | protec ted void d oAssertion s() throws Exception | |
| 288 | { | |
| 289 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.SO A); | |
| 290 | assertNo tNull(reco rds); | |
| 291 | assertEq uals(1, re cords.leng th); | |
| 292 | ||
| 293 | DnsRecor d rec = re cords[0]; | |
| 294 | assertEq uals("exam ple.com.", rec.getNa me()); | |
| 295 | assertEq uals(3600, rec.getTt l()); | |
| 296 | assertEq uals(Type. SOA, rec.g etType()); | |
| 297 | ||
| 298 | SOARecor d soaRec = (SOARecor d)toRecord (rec); | |
| 299 | assertEq uals(soaRe c.getAdmin ().toStrin g(), "gm2 552\\@exam ple.com.") ; | |
| 300 | ||
| 301 | assertEq uals(soaRe c.getDClas s(), DCla ss.IN); | |
| 302 | assertEq uals(soaRe c.getHost( ).toString (), "ns1.e xample.com ."); | |
| 303 | assertEq uals(soaRe c.getName( ).toString (), "examp le.com."); | |
| 304 | assertEq uals(soaRe c.getTTL() , 3600); | |
| 305 | assertEq uals(soaRe c.getSeria l(), 1); | |
| 306 | } | |
| 307 | ||
| 308 | }.pe rform(); | |
| 309 | } | |
| 310 | ||
| 311 | pu blic void testAddDup SOA_Assert OneEntry() throws Ex ception | |
| 312 | { | |
| 313 | new TestPlan() | |
| 314 | { | |
| 315 | @Overr ide | |
| 316 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 317 | { | |
| 318 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 319 | ||
| 320 | String[] command = new Strin g[] {"dns_ soa_add", "example.c om", "ns1. example.co m", "gm255 2@example. com", "1", "3600"}; | |
| 321 | commands .add(comma nd); | |
| 322 | command = new Stri ng[] {"dns _soa_add", "example. com", "ns1 .example.c om", "gm25 52@example .com", "1" , "3600"}; | |
| 323 | commands .add(comma nd); | |
| 324 | ||
| 325 | return c ommands; | |
| 326 | } | |
| 327 | ||
| 328 | @Overr ide | |
| 329 | protec ted void d oAssertion s() throws Exception | |
| 330 | { | |
| 331 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.SO A); | |
| 332 | assertNo tNull(reco rds); | |
| 333 | assertEq uals(1, re cords.leng th); | |
| 334 | ||
| 335 | DnsRecor d rec = re cords[0]; | |
| 336 | assertEq uals("exam ple.com.", rec.getNa me()); | |
| 337 | assertEq uals(3600, rec.getTt l()); | |
| 338 | assertEq uals(Type. SOA, rec.g etType()); | |
| 339 | ||
| 340 | SOARecor d soaRec = (SOARecor d)toRecord (rec); | |
| 341 | assertEq uals(soaRe c.getAdmin ().toStrin g(), "gm2 552\\@exam ple.com.") ; | |
| 342 | ||
| 343 | assertEq uals(soaRe c.getDClas s(), DCla ss.IN); | |
| 344 | assertEq uals(soaRe c.getHost( ).toString (), "ns1.e xample.com ."); | |
| 345 | assertEq uals(soaRe c.getName( ).toString (), "examp le.com."); | |
| 346 | assertEq uals(soaRe c.getTTL() , 3600); | |
| 347 | assertEq uals(soaRe c.getSeria l(), 1); | |
| 348 | } | |
| 349 | ||
| 350 | }.pe rform(); | |
| 351 | } | |
| 352 | ||
| 353 | pu blic void testAddSOA Ensure_Ass ertRecordA dded() thr ows Except ion | |
| 354 | { | |
| 355 | new TestPlan() | |
| 356 | { | |
| 357 | @Overr ide | |
| 358 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 359 | { | |
| 360 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 361 | ||
| 362 | String[] command = new Strin g[] {"dns_ soa_ensure ", "exampl e.com", "n s1.example .com", "gm 2552@examp le.com", " 1", "3600" }; | |
| 363 | commands .add(comma nd); | |
| 364 | ||
| 365 | return c ommands; | |
| 366 | } | |
| 367 | ||
| 368 | @Overr ide | |
| 369 | protec ted void d oAssertion s() throws Exception | |
| 370 | { | |
| 371 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.SO A); | |
| 372 | assertNo tNull(reco rds); | |
| 373 | assertEq uals(1, re cords.leng th); | |
| 374 | ||
| 375 | DnsRecor d rec = re cords[0]; | |
| 376 | assertEq uals("exam ple.com.", rec.getNa me()); | |
| 377 | assertEq uals(3600, rec.getTt l()); | |
| 378 | assertEq uals(Type. SOA, rec.g etType()); | |
| 379 | ||
| 380 | SOARecor d soaRec = (SOARecor d)toRecord (rec); | |
| 381 | assertEq uals(soaRe c.getAdmin ().toStrin g(), "gm2 552\\@exam ple.com.") ; | |
| 382 | ||
| 383 | assertEq uals(soaRe c.getDClas s(), DCla ss.IN); | |
| 384 | assertEq uals(soaRe c.getHost( ).toString (), "ns1.e xample.com ."); | |
| 385 | assertEq uals(soaRe c.getName( ).toString (), "examp le.com."); | |
| 386 | assertEq uals(soaRe c.getTTL() , 3600); | |
| 387 | assertEq uals(soaRe c.getSeria l(), 1); | |
| 388 | ||
| 389 | } | |
| 390 | ||
| 391 | }.pe rform(); | |
| 392 | } | |
| 393 | ||
| 394 | pu blic void testDupSOA Ensure_Ass ertOneEntr y() throws Exception | |
| 395 | { | |
| 396 | new TestPlan() | |
| 397 | { | |
| 398 | @Overr ide | |
| 399 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 400 | { | |
| 401 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 402 | ||
| 403 | String[] command = new Strin g[] {"dns_ soa_ensure ", "exampl e.com", "n s1.example .com", "gm 2552@examp le.com", " 1", "3600" }; | |
| 404 | commands .add(comma nd); | |
| 405 | command = new Stri ng[] {"dns _soa_ensur e", "examp le.com", " ns1.exampl e.com", "g m2552@exam ple.com", "1", "3600 "}; | |
| 406 | commands .add(comma nd); | |
| 407 | ||
| 408 | return c ommands; | |
| 409 | } | |
| 410 | ||
| 411 | @Overr ide | |
| 412 | protec ted void d oAssertion s() throws Exception | |
| 413 | { | |
| 414 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.SO A); | |
| 415 | assertNo tNull(reco rds); | |
| 416 | assertEq uals(1, re cords.leng th); | |
| 417 | ||
| 418 | DnsRecor d rec = re cords[0]; | |
| 419 | assertEq uals("exam ple.com.", rec.getNa me()); | |
| 420 | assertEq uals(3600, rec.getTt l()); | |
| 421 | assertEq uals(Type. SOA, rec.g etType()); | |
| 422 | ||
| 423 | SOARecor d soaRec = (SOARecor d)toRecord (rec); | |
| 424 | assertEq uals(soaRe c.getAdmin ().toStrin g(), "gm2 552\\@exam ple.com.") ; | |
| 425 | ||
| 426 | assertEq uals(soaRe c.getDClas s(), DCla ss.IN); | |
| 427 | assertEq uals(soaRe c.getHost( ).toString (), "ns1.e xample.com ."); | |
| 428 | assertEq uals(soaRe c.getName( ).toString (), "examp le.com."); | |
| 429 | assertEq uals(soaRe c.getTTL() , 3600); | |
| 430 | assertEq uals(soaRe c.getSeria l(), 1); | |
| 431 | } | |
| 432 | ||
| 433 | }.pe rform(); | |
| 434 | } | |
| 435 | ||
| 436 | pu blic void testAddMX_ AssertReco rdAdded() throws Exc eption | |
| 437 | { | |
| 438 | new TestPlan() | |
| 439 | { | |
| 440 | @Overr ide | |
| 441 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 442 | { | |
| 443 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 444 | ||
| 445 | String[] command = new Strin g[] {"dns_ mx_add", " domain.com ", "mail1. domain.com ", "3600", "1"}; | |
| 446 | commands .add(comma nd); | |
| 447 | ||
| 448 | return c ommands; | |
| 449 | } | |
| 450 | ||
| 451 | @Overr ide | |
| 452 | protec ted void d oAssertion s() throws Exception | |
| 453 | { | |
| 454 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.MX ); | |
| 455 | assertNo tNull(reco rds); | |
| 456 | assertEq uals(1, re cords.leng th); | |
| 457 | ||
| 458 | DnsRecor d rec = re cords[0]; | |
| 459 | assertEq uals("doma in.com.", rec.getNam e()); | |
| 460 | assertEq uals(3600, rec.getTt l()); | |
| 461 | assertEq uals(Type. MX, rec.ge tType()); | |
| 462 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 463 | ||
| 464 | MXRecord mxRec = ( MXRecord)t oRecord(re c); | |
| 465 | assertEq uals(mxRec .getTarget ().toStrin g(), "mail 1.domain.c om."); | |
| 466 | ||
| 467 | } | |
| 468 | ||
| 469 | }.pe rform(); | |
| 470 | } | |
| 471 | ||
| 472 | pu blic void testAddDup MX_AssertO neEntry() throws Exc eption | |
| 473 | { | |
| 474 | new TestPlan() | |
| 475 | { | |
| 476 | @Overr ide | |
| 477 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 478 | { | |
| 479 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 480 | ||
| 481 | String[] command = new Strin g[] {"dns_ mx_add", " domain.com ", "mail1. domain.com ", "3600", "1"}; | |
| 482 | commands .add(comma nd); | |
| 483 | command = new Stri ng[] {"dns _mx_add", "domain.co m", "mail1 .domain.co m", "3600" , "1"}; | |
| 484 | commands .add(comma nd); | |
| 485 | ||
| 486 | return c ommands; | |
| 487 | } | |
| 488 | ||
| 489 | @Overr ide | |
| 490 | protec ted void d oAssertion s() throws Exception | |
| 491 | { | |
| 492 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.MX ); | |
| 493 | assertNo tNull(reco rds); | |
| 494 | assertEq uals(1, re cords.leng th); | |
| 495 | ||
| 496 | DnsRecor d rec = re cords[0]; | |
| 497 | assertEq uals("doma in.com.", rec.getNam e()); | |
| 498 | assertEq uals(3600, rec.getTt l()); | |
| 499 | assertEq uals(Type. MX, rec.ge tType()); | |
| 500 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 501 | ||
| 502 | MXRecord mxRec = ( MXRecord)t oRecord(re c); | |
| 503 | assertEq uals(mxRec .getTarget ().toStrin g(), "mail 1.domain.c om."); | |
| 504 | } | |
| 505 | ||
| 506 | }.pe rform(); | |
| 507 | } | |
| 508 | ||
| 509 | pu blic void testAddMXE nsure_Asse rtRecordAd ded() thro ws Excepti on | |
| 510 | { | |
| 511 | new TestPlan() | |
| 512 | { | |
| 513 | @Overr ide | |
| 514 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 515 | { | |
| 516 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 517 | ||
| 518 | String[] command = new Strin g[] {"dns_ mx_ensure" , "domain. com", "mai l1.domain. com", "360 0", "1"}; | |
| 519 | commands .add(comma nd); | |
| 520 | ||
| 521 | return c ommands; | |
| 522 | } | |
| 523 | ||
| 524 | @Overr ide | |
| 525 | protec ted void d oAssertion s() throws Exception | |
| 526 | { | |
| 527 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.MX ); | |
| 528 | assertNo tNull(reco rds); | |
| 529 | assertEq uals(1, re cords.leng th); | |
| 530 | ||
| 531 | DnsRecor d rec = re cords[0]; | |
| 532 | assertEq uals("doma in.com.", rec.getNam e()); | |
| 533 | assertEq uals(3600, rec.getTt l()); | |
| 534 | assertEq uals(Type. MX, rec.ge tType()); | |
| 535 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 536 | ||
| 537 | MXRecord mxRec = ( MXRecord)t oRecord(re c); | |
| 538 | assertEq uals(mxRec .getTarget ().toStrin g(), "mail 1.domain.c om."); | |
| 539 | ||
| 540 | } | |
| 541 | ||
| 542 | }.pe rform(); | |
| 543 | } | |
| 544 | ||
| 545 | pu blic void testDupMXE nsure_Asse rtOneEntry () throws Exception | |
| 546 | { | |
| 547 | new TestPlan() | |
| 548 | { | |
| 549 | @Overr ide | |
| 550 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 551 | { | |
| 552 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 553 | ||
| 554 | String[] command = new Strin g[] {"dns_ mx_ensure" , "domain. com", "mai l1.domain. com", "360 0", "1"}; | |
| 555 | commands .add(comma nd); | |
| 556 | command = new Stri ng[] {"dns _mx_ensure ", "domain .com", "ma il1.domain .com", "36 00", "1"}; | |
| 557 | commands .add(comma nd); | |
| 558 | ||
| 559 | return c ommands; | |
| 560 | } | |
| 561 | ||
| 562 | @Overr ide | |
| 563 | protec ted void d oAssertion s() throws Exception | |
| 564 | { | |
| 565 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.MX ); | |
| 566 | assertNo tNull(reco rds); | |
| 567 | assertEq uals(1, re cords.leng th); | |
| 568 | ||
| 569 | DnsRecor d rec = re cords[0]; | |
| 570 | assertEq uals("doma in.com.", rec.getNam e()); | |
| 571 | assertEq uals(3600, rec.getTt l()); | |
| 572 | assertEq uals(Type. MX, rec.ge tType()); | |
| 573 | assertEq uals(DClas s.IN, rec. getDclass( )); | |
| 574 | ||
| 575 | MXRecord mxRec = ( MXRecord)t oRecord(re c); | |
| 576 | assertEq uals(mxRec .getTarget ().toStrin g(), "mail 1.domain.c om."); | |
| 577 | } | |
| 578 | ||
| 579 | }.pe rform(); | |
| 580 | } | |
| 581 | ||
| 582 | ||
| 583 | pu blic void testGetAll _AssertAll Records() throws Exc eption | |
| 584 | { | |
| 585 | new TestPlan() | |
| 586 | { | |
| 587 | @Overr ide | |
| 588 | protec ted Collec tion<Strin g[]> getCo mmands() t hrows Exce ption | |
| 589 | { | |
| 590 | Collecti on<String[ ]> command s = new Ar rayList<St ring[]>(); | |
| 591 | ||
| 592 | String[] command = new Strin g[] {"dns_ mx_ensure" , "domain. com", "mai l1.domain. com", "360 0", "1"}; | |
| 593 | commands .add(comma nd); | |
| 594 | command = new Stri ng[] {"dns _soa_ensur e", "domai n.com", "n s1.domain. com", "gm2 552@domain .com", "1" , "3600"}; | |
| 595 | commands .add(comma nd); | |
| 596 | command = new String [] {"dns_a name_ensur e", "ns1.d omain.com" , " IP ", "3600"} ; | |
| 597 | commands .add(comma nd); | |
| 598 | command = new Stri ng[] {"dns _get_all"} ; | |
| 599 | commands .add(comma nd); | |
| 600 | ||
| 601 | return c ommands; | |
| 602 | } | |
| 603 | ||
| 604 | @Overr ide | |
| 605 | protec ted void d oAssertion s() throws Exception | |
| 606 | { | |
| 607 | DnsRecor d[] record s = proxy. getDNSByTy pe(Type.AN Y); | |
| 608 | assertNo tNull(reco rds); | |
| 609 | assertEq uals(3, re cords.leng th); | |
| 610 | } | |
| 611 | ||
| 612 | }.pe rform(); | |
| 613 | } | |
| 614 | } | |
| 615 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.