Produced by Araxis Merge on 7/13/2017 3:41:55 PM Eastern 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 | Genisis_v3.zip\Source Code\DataOps\src\test\java\gov\va\genisis2\DatabaseTableCopyTest | DatabaseTableCopyTest.java | Wed Jun 28 20:38:36 2017 UTC |
| 2 | Genisis_v3.zip\Source Code\DataOps\src\test\java\gov\va\genisis2\DatabaseTableCopyTest | DatabaseTableCopyTest.java | Wed Jul 12 16:45:51 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 7 | 264 |
| Changed | 6 | 24 |
| 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 go v.va.genis is2.Databa seTableCop y; | |
| 2 | ||
| 3 | import sta tic org.ju nit.Assert .assertEqu als; | |
| 4 | ||
| 5 | import jav a.io.ByteA rrayOutput Stream; | |
| 6 | import jav a.io.Print Stream; | |
| 7 | ||
| 8 | import org .junit.Aft er; | |
| 9 | import org .junit.Bef ore; | |
| 10 | import org .junit.Ign ore; | |
| 11 | import org .junit.Tes t; | |
| 12 | ||
| 13 | /** | |
| 14 | * @author Evan Clen denning | |
| 15 | * | |
| 16 | */ | |
| 17 | public cla ss Databas eTableCopy Test { | |
| 18 | /* * | |
| 19 | * Initializ e variable s to read the messag e output b y Database TableCopy. | |
| 20 | * / | |
| 21 | pr ivate fina l ByteArra yOutputStr eam outCon tent = new ByteArray OutputStre am(); | |
| 22 | pr ivate fina l ByteArra yOutputStr eam errCon tent = new ByteArray OutputStre am(); | |
| 23 | ||
| 24 | /* * | |
| 25 | * Set varia bles to ca tch the me ssages in both out a nd err pri nt streams . | |
| 26 | * / | |
| 27 | @B efore | |
| 28 | pu blic void setUpStrea ms() { | |
| 29 | Syst em.setOut( new PrintS tream(outC ontent)); | |
| 30 | Syst em.setErr( new PrintS tream(errC ontent)); | |
| 31 | ||
| 32 | } | |
| 33 | ||
| 34 | /* * | |
| 35 | * Clear var iables of the messag es in both out and e rr print s treams. | |
| 36 | * / | |
| 37 | @A fter | |
| 38 | pu blic void cleanUpStr eams() { | |
| 39 | Syst em.setOut( null); | |
| 40 | Syst em.setErr( null); | |
| 41 | } | |
| 42 | ||
| 43 | /* * | |
| 44 | * Test case with wron g amount o f argument s | |
| 45 | * / | |
| 46 | @T est | |
| 47 | @I gnore | |
| 48 | pu blic void testMainWi thWrongArg sAmount() { | |
| 49 | Data baseTableC opy.main(n ew String[ ] { "NaN" }); | |
| 50 | Stri ng expecte dMessage = "Wrong am ount of ar guments."; | |
| 51 | Syst em.err.pri ntln(expec tedMessage ); | |
| 52 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 53 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 54 | } | |
| 55 | ||
| 56 | /* * | |
| 57 | * Test case with mult iple table s which al so covers single tab le case du e to | |
| 58 | * nature of DatabaseT ableCopy. | |
| 59 | * / | |
| 60 | @T est | |
| 61 | @I gnore | |
| 62 | pu blic void testMainWi thCorrectT able() { | |
| 63 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "dflt" , " IP ", "data_o ps", | |
| 64 | "genisis20 !7", "GENI SISDATADES T", "dbo", " IP ", "data_o ps", "geni sis20!7", "Genisis_D b_Dev", | |
| 65 | "Genisis _ops_tempd ata", "dbo ", "vinciT able5" }); | |
| 66 | Stri ng expecte dMessage = "Successf ully copie d table: ' vinciTable 5' "; | |
| 67 | Syst em.err.pri ntln(expec tedMessage ); | |
| 68 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 69 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 70 | } | |
| 71 | ||
| 72 | /* * | |
| 73 | * Test case with wron g table na me to test table pat h correctn ess. | |
| 74 | * / | |
| 75 | @T est | |
| 76 | @I gnore | |
| 77 | pu blic void testMainWi thWrongTab le() { | |
| 78 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "dbo", " IP ", "data_o ps", | |
| 79 | "genisis20 !7", "GENI SISDATADES T", "dbo", " IP ", "data_o ps", "geni sis20!7", "Genisis_D b_Dev", | |
| 80 | "Genisis _ops_tempd ata", "dbo ", "wrongT able" }); | |
| 81 | Stri ng expecte dMessage = "wrongTab le cannot be found. Please ent er in a va lid table name for t he table t o be copie d."; | |
| 82 | Syst em.err.pri ntln(expec tedMessage ); | |
| 83 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 84 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 85 | } | |
| 86 | ||
| 87 | /* * | |
| 88 | * Test case with wron g source s chema to t est table path corre ctness. | |
| 89 | * / | |
| 90 | @T est | |
| 91 | @I gnore | |
| 92 | pu blic void testMainWi thWrongSou rceSchema( ) { | |
| 93 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "wrong ", " IP ", "data_o ps", | |
| 94 | "genisis20 !7", "GENI SISDATADES T", "dbo", " IP ", "data_o ps", "geni sis20!7", "Genisis_D b_Dev", | |
| 95 | "Genisis _ops_tempd ata", "dbo ", "vinciT able5" }); | |
| 96 | Stri ng expecte dMessage = "wrong ca nnot be fo und. Pleas e enter in a valid S ource sche ma name fo r the tabl e to be co pied."; | |
| 97 | Syst em.err.pri ntln(expec tedMessage ); | |
| 98 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 99 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 100 | } | |
| 101 | ||
| 102 | @T est | |
| 103 | @I gnore | |
| 104 | pu blic void testMainWi thWrongTab leSchema() { | |
| 105 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "dbo", " IP ", "data_o ps", | |
| 106 | "genisis20 !7", "GENI SISDATADES T", "Study Mart1", " IP ", "data_o ps", "geni sis20!7", | |
| 107 | "Genisis _Db_Dev", "Genisis_o ps_tempdat a", "dbo", "vincitab le1" }); | |
| 108 | Stri ng expecte dMessage = "vincitab le1 does n ot exist f or the Sch ema dbo."; | |
| 109 | Syst em.err.pri ntln(expec tedMessage ); | |
| 110 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 111 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 112 | } | |
| 113 | ||
| 114 | /* * | |
| 115 | * Test case with wron g destinat ion schema to test t able path correctnes s. | |
| 116 | * / | |
| 117 | @T est | |
| 118 | @I gnore | |
| 119 | pu blic void testMainWi thWrongDes tSchema() { | |
| 120 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "dflt" , " IP ", "data_o ps", | |
| 121 | "genisis20 !7", "GENI SISDATADES T", "wrong ", " IP ", "data_o ps", "geni sis20!7", "Genisis_D b_Dev", | |
| 122 | "Genisis _ops_tempd ata", "dbo ", "vinciT able5" }); | |
| 123 | Stri ng expecte dMessage = "wrong ca nnot be fo und. Pleas e enter in a valid D estination schema na me for the table to be copied. "; | |
| 124 | Syst em.err.pri ntln(expec tedMessage ); | |
| 125 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 126 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 127 | } | |
| 128 | ||
| 129 | /* * | |
| 130 | * Test case with wron g username s and pass words to t est access issues. | |
| 131 | * / | |
| 132 | @T est | |
| 133 | @I gnore | |
| 134 | pu blic void testMainWi thWrongLog ins() { | |
| 135 | DatabaseTa bleCopy.ma in(new Str ing[] { " IP ", "GENISI SDATASOURC E", "dbo", " IP ", "wrong" , | |
| 136 | "wrong", " GENISISDAT ADEST", "d bo", " IP ", "wrong" , "wrong", "Genisis_ Db_Dev", | |
| 137 | "Genisis _ops_tempd ata", "dbo ", "vinciT able5" }); | |
| 138 | Stri ng expecte dMessage = "An error occurred during tra nsfer. Ple ase contac t your sys tem admini strator."; | |
| 139 | Syst em.err.pri ntln(expec tedMessage ); | |
| 140 | asse rtEquals(e rrContent. toString() , outConte nt.toStrin g()); | |
| 141 | Syst em.out.pri ntln(outCo ntent.toSt ring()); | |
| 142 | } | |
| 143 | ||
| 144 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.