Produced by Araxis Merge on 5/25/2018 9:21:38 AM 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\ZIP\DSM-cif\Direct Implementation\java\agent\src\test\java\org\nhindirect\stagent\cert\impl | DNSCertificateStore_getServerQuerySettingsTest.java | Tue May 22 13:44:02 2018 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\ZIP\DSM-cif\Direct Implementation\java\agent\src\test\java\org\nhindirect\stagent\cert\impl | DNSCertificateStore_getServerQuerySettingsTest.java | Tue May 22 20:45:22 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 5 | 204 |
| Changed | 4 | 8 |
| 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.stagent .cert.impl ; | |
| 2 | ||
| 3 | import jav a.io.File; | |
| 4 | import jav a.io.Outpu tStream; | |
| 5 | import jav a.util.Arr ays; | |
| 6 | ||
| 7 | import org .apache.co mmons.io.F ileUtils; | |
| 8 | import org .apache.co mmons.io.I OUtils; | |
| 9 | import org .nhindirec t.stagent. options.Op tionsManag erUtils; | |
| 10 | import org .xbill.DNS .ResolverC onfig; | |
| 11 | ||
| 12 | import jun it.framewo rk.TestCas e; | |
| 13 | ||
| 14 | public cla ss DNSCert ificateSto re_getServ erQuerySet tingsTest extends Te stCase | |
| 15 | { | |
| 16 | @O verride | |
| 17 | pu blic void setUp() | |
| 18 | { | |
| 19 | Opti onsManager Utils.clea rOptionsMa nagerInsta nce(); | |
| 20 | } | |
| 21 | ||
| 22 | @O verride | |
| 23 | pu blic void tearDown() | |
| 24 | { | |
| 25 | Opti onsManager Utils.clea rOptionsMa nagerOptio ns(); | |
| 26 | } | |
| 27 | ||
| 28 | pu blic void testGetSer verQuerySe ttingsTest _useDefaul tSettings_ assertSett ings() | |
| 29 | { | |
| 30 | DNSC ertificate Store serv ice = new DNSCertifi cateStore( ); | |
| 31 | asse rtEquals(D NSCertific ateStore.D EFAULT_DNS _RETRIES, service.re tries); | |
| 32 | asse rtEquals(D NSCertific ateStore.D EFAULT_DNS _TIMEOUT, service.ti meout); | |
| 33 | asse rtTrue(ser vice.useTC P); | |
| 34 | ||
| 35 | Stri ng[] confi gedServers = Resolve rConfig.ge tCurrentCo nfig().ser vers(); | |
| 36 | asse rtTrue(Arr ays.equals (configedS ervers, se rvice.serv ers.toArra y())); | |
| 37 | } | |
| 38 | ||
| 39 | pu blic void testGetSer verQuerySe ttingsTest _useSettin gsFromJVMP arams_asse rtSettings () | |
| 40 | { | |
| 41 | System.set Property(" org.nhindi rect.stage nt.cert.dn sresolver. Servers", " IP ,google.lo okup.com") ; | |
| 42 | Syst em.setProp erty("org. nhindirect .stagent.c ert.dnsres olver.Serv erRetries" , "1"); | |
| 43 | Syst em.setProp erty("org. nhindirect .stagent.c ert.dnsres olver.Serv erTimeout" , "5"); | |
| 44 | Syst em.setProp erty("org. nhindirect .stagent.c ert.dnsres olver.Serv erUseTCP", "false"); | |
| 45 | ||
| 46 | try | |
| 47 | { | |
| 48 | DNSCer tificateSt ore servic e = new DN SCertifica teStore(); | |
| 49 | assert Equals(1, service.re tries); | |
| 50 | assert Equals(5, service.ti meout); | |
| 51 | assert False(serv ice.useTCP ); | |
| 52 | assertTrue (Arrays.eq uals(new S tring[] {" IP ", "google .lookup.co m"}, servi ce.servers .toArray() )); | |
| 53 | } | |
| 54 | fina lly | |
| 55 | { | |
| 56 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server s", ""); | |
| 57 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server Retries", ""); | |
| 58 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server Timeout", ""); | |
| 59 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server UseTCP", " "); | |
| 60 | } | |
| 61 | } | |
| 62 | ||
| 63 | pu blic void testGetSer verQuerySe ttingsTest _useSettin gsFromProp ertiesFile _assertSet tings() th rows Excep tion | |
| 64 | { | |
| 65 | File propFile = new File ("./target /props/age ntSettings .propertie s"); | |
| 66 | if ( propFile.e xists()) | |
| 67 | propFi le.delete( ); | |
| 68 | ||
| 69 | Syst em.setProp erty("org. nhindirect .stagent.P ropertiesF ile", "./t arget/prop s/agentSet tings.prop erties"); | |
| 70 | ||
| 71 | Outp utStream o utStream = null; | |
| 72 | ||
| 73 | try | |
| 74 | { | |
| 75 | outStr eam = File Utils.open OutputStre am(propFil e); | |
| 76 | outStream. write("org .nhindirec t.stagent. cert.dnsre solver.Ser vers= IP ,google.lo okup.com\r \n".getByt es()); | |
| 77 | outStr eam.write( "org.nhind irect.stag ent.cert.d nsresolver .ServerRet ries=5\r\n ".getBytes ()); | |
| 78 | outStr eam.write( "org.nhind irect.stag ent.cert.d nsresolver .ServerTim eout=7\r\n ".getBytes ()); | |
| 79 | outStr eam.write( "org.nhind irect.stag ent.cert.d nsresolver .ServerUse TCP=false\ r\n".getBy tes()); | |
| 80 | outStr eam.flush( ); | |
| 81 | ||
| 82 | } | |
| 83 | fina lly | |
| 84 | { | |
| 85 | IOUtil s.closeQui etly(outSt ream); | |
| 86 | } | |
| 87 | ||
| 88 | try | |
| 89 | { | |
| 90 | DNSCer tificateSt ore servic e = new DN SCertifica teStore(); | |
| 91 | assert Equals(5, service.re tries); | |
| 92 | assert Equals(7, service.ti meout); | |
| 93 | assert False(serv ice.useTCP ); | |
| 94 | assertTrue (Arrays.eq uals(new S tring[] {" IP ", "google .lookup.co m"}, servi ce.servers .toArray() )); | |
| 95 | } | |
| 96 | fina lly | |
| 97 | { | |
| 98 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server s", ""); | |
| 99 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server Retries", ""); | |
| 100 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server Timeout", ""); | |
| 101 | System .setProper ty("org.nh indirect.s tagent.cer t.dnsresol ver.Server UseTCP", " "); | |
| 102 | System .setProper ty("org.nh indirect.s tagent.Pro pertiesFil e", ""); | |
| 103 | propFi le.delete( ); | |
| 104 | } | |
| 105 | } | |
| 106 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.