Selaa lähdekoodia

removed ignored files; updated file.txt location

Leon 6 vuotta sitten
vanhempi
commit
9ca7fc1363

+ 2
- 1
.gitignore Näytä tiedosto

@@ -3,4 +3,5 @@
3 3
 .classpath
4 4
 #.project
5 5
 .settings
6
-.idea
6
+.idea
7
+*.iml

+ 0
- 0
file.txt Näytä tiedosto


+ 0
- 16
readandwrite.iml Näytä tiedosto

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
-    <output url="file://$MODULE_DIR$/target/classes" />
5
-    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
-    <content url="file://$MODULE_DIR$">
7
-      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
-      <excludeFolder url="file://$MODULE_DIR$/target" />
10
-    </content>
11
-    <orderEntry type="inheritedJdk" />
12
-    <orderEntry type="sourceFolder" forTests="false" />
13
-    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
14
-    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15
-  </component>
16
-</module>

+ 3
- 3
src/test/java/rocks/zipcode/alphadocument/AlphaDocumentWriteTest.java Näytä tiedosto

@@ -15,7 +15,7 @@ public class AlphaDocumentWriteTest {
15 15
     @Test(expected = IllegalArgumentException.class)
16 16
     public void writeNumericValuesToFile() throws IOException {
17 17
         // given
18
-        String fileName = "file.txt";
18
+        String fileName = "target/file.txt";
19 19
         String contentToBeWritten = "123";
20 20
         Document documentWriter = new AlphaCharDocument(fileName);
21 21
 
@@ -26,7 +26,7 @@ public class AlphaDocumentWriteTest {
26 26
     @Test(expected = IllegalArgumentException.class)
27 27
     public void writeSpecialCharacter() throws IOException {
28 28
         // given
29
-        String fileName = "file.txt";
29
+        String fileName = "target/file.txt";
30 30
         String contentToBeWritten = "()";
31 31
         Document documentWriter = new AlphaCharDocument(fileName);
32 32
 
@@ -38,7 +38,7 @@ public class AlphaDocumentWriteTest {
38 38
     @Test
39 39
     public void writeAlphaValuesTest() throws IOException {
40 40
         // given
41
-        String fileName = "file.txt";
41
+        String fileName = "target/file.txt";
42 42
         String expected = "The quick brown foxy";
43 43
         Document documentWriter = new AlphaCharDocument(fileName);
44 44
 

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentOverwriteTest.java Näytä tiedosto

@@ -13,7 +13,7 @@ public class DocumentOverwriteTest {
13 13
     @Test
14 14
     public void writeTest1() throws IOException {
15 15
         // given
16
-        String fileName = "file.txt";
16
+        String fileName = "target/file.txt";
17 17
         String contentToBeOverwritten = "The quick brown fox";
18 18
         String expected = "The quick browner fox";
19 19
         Document documentWriter = new Document(fileName);
@@ -30,7 +30,7 @@ public class DocumentOverwriteTest {
30 30
     @Test
31 31
     public void writeTest2() throws IOException {
32 32
         // given
33
-        String fileName = "file.txt";
33
+        String fileName = "target/file.txt";
34 34
         String contentToBeOverwritten = "The quick brown fox";
35 35
         String expected = "The quick brownest fox";
36 36
         Document documentWriter = new Document(fileName);

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentReadLineTest.java Näytä tiedosto

@@ -14,7 +14,7 @@ public class DocumentReadLineTest {
14 14
     public void testReadFirstLine() throws IOException {
15 15
         // given
16 16
         String expected = "The";
17
-        String fileName = "file.txt";
17
+        String fileName = "target/file.txt";
18 18
         Document documentWriter = new Document(fileName);
19 19
         String contentToBeWritten = "The\nquick\nbrown\nfox";
20 20
         documentWriter.write(contentToBeWritten);
@@ -31,7 +31,7 @@ public class DocumentReadLineTest {
31 31
     public void testReadSecondLine() throws IOException {
32 32
         // given
33 33
         String expected = "quick";
34
-        String fileName = "file.txt";
34
+        String fileName = "target/file.txt";
35 35
         Document documentWriter = new Document(fileName);
36 36
         String contentToBeWritten = "The\nquick\nbrown\nfox";
37 37
         documentWriter.write(contentToBeWritten);

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentReadTest.java Näytä tiedosto

@@ -13,7 +13,7 @@ public class DocumentReadTest {
13 13
     @Test
14 14
     public void testRead1() throws IOException {
15 15
         // given
16
-        String fileName = "file.txt";
16
+        String fileName = "target/file.txt";
17 17
         Document documentWriter = new Document(fileName);
18 18
         String expected = "The\nquick\nbrown\nfox";
19 19
         documentWriter.write(expected);
@@ -28,7 +28,7 @@ public class DocumentReadTest {
28 28
     @Test
29 29
     public void testRead2() throws IOException {
30 30
         // given
31
-        String fileName = "file.txt";
31
+        String fileName = "target/file.txt";
32 32
         Document documentWriter = new Document(fileName);
33 33
         String expected = "The\nquicker\nbrown\nfox";
34 34
         documentWriter.write(expected);

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentReplaceAllTest.java Näytä tiedosto

@@ -13,7 +13,7 @@ public class DocumentReplaceAllTest {
13 13
     @Test
14 14
     public void testReplace_e_withUnderscore() throws IOException {
15 15
         // given
16
-        String fileName = "file.txt";
16
+        String fileName = "target/file.txt";
17 17
         Document documentWriter = new Document(fileName);
18 18
         String contentToBeWritten = "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit,\nsed do eiusmod tempor incididunt\nut labore et dolore\nmagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\nnisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate\nvelit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat\nnon proident, sunt in culpa qui officia deserunt mollit anim id est laborum";
19 19
         String valueToReplace = "e";
@@ -32,7 +32,7 @@ public class DocumentReplaceAllTest {
32 32
     @Test
33 33
     public void testReplace_newLine_withEmptyString() throws IOException {
34 34
         // given
35
-        String fileName = "file.txt";
35
+        String fileName = "target/file.txt";
36 36
         Document documentWriter = new Document(fileName);
37 37
         String contentToBeWritten = "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit,\nsed do eiusmod tempor incididunt\nut labore et dolore\nmagna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\nnisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate\nvelit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat\nnon proident, sunt in culpa qui officia deserunt mollit anim id est laborum";
38 38
         String valueToReplace = "\n";

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentToStringTest.java Näytä tiedosto

@@ -13,7 +13,7 @@ public class DocumentToStringTest {
13 13
     @Test
14 14
     public void toStringTest1() throws IOException {
15 15
         // given
16
-        String fileName = "file.txt";
16
+        String fileName = "target/file.txt";
17 17
         String contentToBeWritten = "The quick brown fox";
18 18
         Document documentWriter = new Document(fileName);
19 19
         String expected = new StringBuilder(fileName)
@@ -33,7 +33,7 @@ public class DocumentToStringTest {
33 33
     @Test
34 34
     public void toStringTest2() throws IOException {
35 35
         // given
36
-        String fileName = "file.txt";
36
+        String fileName = "target/file.txt";
37 37
         String contentToBeWritten = "The quicker browner fox";
38 38
         Document documentWriter = new Document(fileName);
39 39
         String expected = new StringBuilder(fileName)

+ 3
- 3
src/test/java/rocks/zipcode/document/DocumentWriteTest.java Näytä tiedosto

@@ -14,7 +14,7 @@ public class DocumentWriteTest {
14 14
     @Test
15 15
     public void writeAlphaValuesTest() throws IOException {
16 16
         // given
17
-        String fileName = "file.txt";
17
+        String fileName = "target/file.txt";
18 18
         String expected = "The quick brown fox";
19 19
         Document documentWriter = new Document(fileName);
20 20
 
@@ -29,7 +29,7 @@ public class DocumentWriteTest {
29 29
     @Test
30 30
     public void writeSpecialCharactersTest() throws IOException {
31 31
         // given
32
-        String fileName = "file.txt";
32
+        String fileName = "target/file.txt";
33 33
         String expected = "()";
34 34
         Document documentWriter = new Document(fileName);
35 35
 
@@ -44,7 +44,7 @@ public class DocumentWriteTest {
44 44
     @Test
45 45
     public void writeNumericValuesTest() throws IOException {
46 46
         // given
47
-        String fileName = "file.txt";
47
+        String fileName = "target/file.txt";
48 48
         String expected = "123";
49 49
         Document documentWriter = new Document(fileName);
50 50
 

+ 2
- 2
src/test/java/rocks/zipcode/document/DocumentWriteToLineTest.java Näytä tiedosto

@@ -13,7 +13,7 @@ public class DocumentWriteToLineTest {
13 13
     @Test
14 14
     public void writeToLineTest1() throws IOException {
15 15
         // given
16
-        String fileName = "file.txt";
16
+        String fileName = "target/file.txt";
17 17
         String contentToBeWritten = "The\nquick\nbrown\nfox";
18 18
         String replacement = "quicker";
19 19
         String expected = contentToBeWritten.replaceAll("quick", replacement);
@@ -31,7 +31,7 @@ public class DocumentWriteToLineTest {
31 31
     @Test
32 32
     public void writeToLineTest2() throws IOException {
33 33
         // given
34
-        String fileName = "file.txt";
34
+        String fileName = "target/file.txt";
35 35
         String contentToBeWritten = "The\nquick\nbrown\nfox";
36 36
         String replacement = "quickest";
37 37
         String expected = contentToBeWritten.replaceAll("The", replacement);

+ 3
- 3
src/test/java/rocks/zipcode/numericdocument/NumericDocumentWriteTest.java Näytä tiedosto

@@ -15,7 +15,7 @@ public class NumericDocumentWriteTest {
15 15
     @Test
16 16
     public void writeNumericValuesToFile() throws IOException {
17 17
         // given
18
-        String fileName = "file.txt";
18
+        String fileName = "target/file.txt";
19 19
         String contentToBeWritten = "123";
20 20
         Document documentWriter = new NumericCharDocument(fileName);
21 21
 
@@ -26,7 +26,7 @@ public class NumericDocumentWriteTest {
26 26
     @Test(expected = IllegalArgumentException.class)
27 27
     public void writeSpecialCharacter() throws IOException {
28 28
         // given
29
-        String fileName = "file.txt";
29
+        String fileName = "target/file.txt";
30 30
         String contentToBeWritten = "()";
31 31
         Document documentWriter = new NumericCharDocument(fileName);
32 32
 
@@ -37,7 +37,7 @@ public class NumericDocumentWriteTest {
37 37
     @Test(expected = IllegalArgumentException.class)
38 38
     public void writeAlphaValuesTest() throws IOException {
39 39
         // given
40
-        String fileName = "file.txt";
40
+        String fileName = "target/file.txt";
41 41
         String expected = "The quick brown foxy";
42 42
         Document documentWriter = new NumericCharDocument(fileName);
43 43
 

+ 4
- 4
src/test/java/rocks/zipcode/specialdocument/SpecialCharDocumentTest.java Näytä tiedosto

@@ -15,7 +15,7 @@ public class SpecialCharDocumentTest {
15 15
     @Test(expected = IllegalArgumentException.class)
16 16
     public void writeNumericValuesToFile() throws IOException {
17 17
         // given
18
-        String fileName = "file.txt";
18
+        String fileName = "target/file.txt";
19 19
         String contentToBeWritten = "123";
20 20
         Document documentWriter = new SpecialCharDocument(fileName);
21 21
 
@@ -26,7 +26,7 @@ public class SpecialCharDocumentTest {
26 26
     @Test
27 27
     public void writeSpecialCharacter1() throws IOException {
28 28
         // given
29
-        String fileName = "file.txt";
29
+        String fileName = "target/file.txt";
30 30
         String contentToBeWritten = "()";
31 31
         Document documentWriter = new SpecialCharDocument(fileName);
32 32
 
@@ -38,7 +38,7 @@ public class SpecialCharDocumentTest {
38 38
     @Test
39 39
     public void writeSpecialCharacter2() throws IOException {
40 40
         // given
41
-        String fileName = "file.txt";
41
+        String fileName = "target/file.txt";
42 42
         String contentToBeWritten = "()_*";
43 43
         Document documentWriter = new SpecialCharDocument(fileName);
44 44
 
@@ -50,7 +50,7 @@ public class SpecialCharDocumentTest {
50 50
     @Test(expected = IllegalArgumentException.class)
51 51
     public void writeAlphaValuesTest() throws IOException {
52 52
         // given
53
-        String fileName = "file.txt";
53
+        String fileName = "target/file.txt";
54 54
         String expected = "The quick brown foxy";
55 55
         Document documentWriter = new SpecialCharDocument(fileName);
56 56