Produced by Araxis Merge on 7/10/2017 1:01:44 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\IV-ehmp_cif\ImagingCommon\main\test\java\gov\va\med\imaging\channels | CheckedByteChannelTest.java | Thu Jun 29 17:22:55 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\ImagingCommon\main\test\java\gov\va\med\imaging\channels | CheckedByteChannelTest.java | Thu Jul 6 15:02:47 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 158 |
| 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 | * | |
| 3 | */ | |
| 4 | package go v.va.med.i maging.cha nnels; | |
| 5 | ||
| 6 | import jav a.io.File; | |
| 7 | import jav a.io.FileI nputStream ; | |
| 8 | import jav a.io.FileO utputStrea m; | |
| 9 | import jav a.io.IOExc eption; | |
| 10 | import jav a.nio.Byte Buffer; | |
| 11 | import jav a.nio.chan nels.Chann els; | |
| 12 | import jav a.nio.chan nels.Reada bleByteCha nnel; | |
| 13 | import jav a.nio.chan nels.Writa bleByteCha nnel; | |
| 14 | import jav a.util.zip .Adler32; | |
| 15 | ||
| 16 | import jun it.framewo rk.TestCas e; | |
| 17 | ||
| 18 | /** | |
| 19 | * @author
|
|
| 20 | * | |
| 21 | */ | |
| 22 | public cla ss Checked ByteChanne lTest exte nds TestCa se | |
| 23 | { | |
| 24 | ||
| 25 | /* (non-Java doc) | |
| 26 | * @see juni t.framewor k.TestCase #setUp() | |
| 27 | * / | |
| 28 | pr otected vo id setUp() | |
| 29 | th rows Excep tion | |
| 30 | { | |
| 31 | supe r.setUp(); | |
| 32 | } | |
| 33 | ||
| 34 | pu blic Reada bleByteCha nnel getTe stDataAsRe adableByte Channel() | |
| 35 | { | |
| 36 | retu rn Channel s.newChann el( | |
| 37 | getCla ss().getCl assLoader( ).getResou rceAsStrea m("edvard_ munch.gif" ) | |
| 38 | ); | |
| 39 | } | |
| 40 | ||
| 41 | pu blic Writa bleByteCha nnel getDr ain() | |
| 42 | th rows IOExc eption | |
| 43 | { | |
| 44 | File tempFile = File.cre ateTempFil e("sink", ".tmp"); | |
| 45 | File OutputStre am outStre am = new F ileOutputS tream(temp File); | |
| 46 | ||
| 47 | temp File.delet eOnExit(); | |
| 48 | ||
| 49 | retu rn outStre am.getChan nel(); | |
| 50 | } | |
| 51 | ||
| 52 | pu blic void testChecke dByteChann els() | |
| 53 | th rows IOExc eption | |
| 54 | { | |
| 55 | Byte Buffer buf fy = ByteB uffer.allo cate(1024) ; | |
| 56 | Chec kedReadabl eByteChann el readCha nnel = new CheckedRe adableByte Channel(ge tTestDataA sReadableB yteChannel (), new Ad ler32()); | |
| 57 | Chec kedWritabl eByteChann el writeCh annel = ne w CheckedW ritableByt eChannel(g etDrain(), new Adler 32()); | |
| 58 | whil e( readCha nnel.read( buffy) >= 0 ) | |
| 59 | { | |
| 60 | buffy. flip(); | |
| 61 | writeC hannel.wri te(buffy); | |
| 62 | buffy. clear(); | |
| 63 | } | |
| 64 | ||
| 65 | asse rtTrue(rea dChannel.g etChecksum ().getValu e() != 0); | |
| 66 | asse rtTrue(wri teChannel. getChecksu m().getVal ue() != 0) ; | |
| 67 | ||
| 68 | asse rtEquals( readChanne l.getCheck sum().getV alue(), wr iteChannel .getChecks um().getVa lue() ); | |
| 69 | ||
| 70 | read Channel.cl ose(); | |
| 71 | writ eChannel.c lose(); | |
| 72 | } | |
| 73 | ||
| 74 | pr otected vo id tearDow n() | |
| 75 | th rows Excep tion | |
| 76 | { | |
| 77 | supe r.tearDown (); | |
| 78 | } | |
| 79 | ||
| 80 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.