diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dfa1b27 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: java +script: mvn test -f ./source/pom.xml +jdk: + - oraclejdk8 + - oraclejdk7 + - openjdk7 \ No newline at end of file diff --git a/README.md b/README.md index 2a580ec..e627674 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,11 @@ You can purchase the book on leanpub: https://leanpub.com/javaForTesters * Twitter: @eviltester ### Note: -This code is an extract from the actual source used to create the book. The actual source has embedded macros to allow the book to be automatically generated. While the extraction process has been tested, it may still contain errors. If you find differences from the book, or discover errors in this code, please let the author know. All tests have been run prior to the source release. +This code is an extract from the actual source used to create the book. The actual source has embedded macros to allow the book to be automatically generated. While the extraction process has been tested, it may still contain errors. If you find differences from the book, or discover errors in this code, please let the author know. All @Test code has been run prior to the source release. + +You can see a cloud build of the code provided by [travis-ci.orgtravis-ci.org/eviltester/javaForTestersCode](https://travis-ci.org/eviltester/javaForTestersCode). + +![Build Status](https://travis-ci.org/eviltester/javaForTestersCode.svg) License ------- diff --git a/source/reportingpom.xml b/source/reportingpom.xml index ce11c2f..4c4ca97 100644 --- a/source/reportingpom.xml +++ b/source/reportingpom.xml @@ -15,7 +15,7 @@ http://maven.apache.org/surefire/maven-surefire-plugin/usage.html http://maven.apache.org/surefire/maven-surefire-report-plugin/report-mojo.html - mvn clean test -Dmaven.source=reportingpom.xml + mvn clean surefire-report:report -Dmaven.source=reportingpom.xml --> diff --git a/source/src/test/java/com/javafortesters/chap014junit/examples/ASysOutJunitTest.java b/source/src/test/java/com/javafortesters/chap001basicsofjava/examples/classes/ASysOutJunitTest.java similarity index 62% rename from source/src/test/java/com/javafortesters/chap014junit/examples/ASysOutJunitTest.java rename to source/src/test/java/com/javafortesters/chap001basicsofjava/examples/classes/ASysOutJunitTest.java index 6d13835..2b1f564 100644 --- a/source/src/test/java/com/javafortesters/chap014junit/examples/ASysOutJunitTest.java +++ b/source/src/test/java/com/javafortesters/chap001basicsofjava/examples/classes/ASysOutJunitTest.java @@ -1,6 +1,5 @@ -package com.javafortesters.chap014junit.examples; +package com.javafortesters.chap001basicsofjava.examples.classes; -import com.javafortesters.chap001basicsofjava.examples.classes.AClassWithAMethod; import org.junit.Test; public class ASysOutJunitTest { diff --git a/source/src/test/java/com/javafortesters/chap004testswithotherclasses/examples/IntegerExamplesTest.java b/source/src/test/java/com/javafortesters/chap004testswithotherclasses/examples/IntegerExamplesTest.java index c1d0932..dd452a1 100644 --- a/source/src/test/java/com/javafortesters/chap004testswithotherclasses/examples/IntegerExamplesTest.java +++ b/source/src/test/java/com/javafortesters/chap004testswithotherclasses/examples/IntegerExamplesTest.java @@ -1,26 +1,20 @@ package com.javafortesters.chap004testswithotherclasses.examples; import org.junit.Test; - import static org.junit.Assert.assertEquals; public class IntegerExamplesTest { @Test public void integerExploration(){ - Integer four = new Integer(4); assertEquals("intValue returns int 4", 4, four.intValue()); - Integer five = new Integer("5"); assertEquals("intValue returns int 5", 5, five.intValue()); - Integer six = 6; assertEquals("autoboxing assignment for 6", 6, six.intValue()); } - - -} \ No newline at end of file +} diff --git a/source/src/test/java/com/javafortesters/chap004testswithotherclasses/exercises/IntegerExercisesTest.java b/source/src/test/java/com/javafortesters/chap004testswithotherclasses/exercises/IntegerExercisesTest.java index 80a954c..d43e721 100644 --- a/source/src/test/java/com/javafortesters/chap004testswithotherclasses/exercises/IntegerExercisesTest.java +++ b/source/src/test/java/com/javafortesters/chap004testswithotherclasses/exercises/IntegerExercisesTest.java @@ -20,11 +20,11 @@ public void canConfirmIntMinAndMaxLimits(){ public void canConvertIntToHex(){ assertEquals("hex 11 is b", "b", Integer.toHexString(11)); - assertEquals("hex 10 is b", "a", + assertEquals("hex 10 is a", "a", Integer.toHexString(10)); - assertEquals("hex 3 is b", "3", + assertEquals("hex 3 is 3", "3", Integer.toHexString(3)); - assertEquals("hex 21 is b", "15", + assertEquals("hex 21 is 15", "15", Integer.toHexString(21)); } } \ No newline at end of file diff --git a/source/src/test/java/com/javafortesters/chap005testwithourownclasses/domainobject/examples/TestAppEnvironmentTest.java b/source/src/test/java/com/javafortesters/chap005testwithourownclasses/domainobject/examples/TestAppEnvironmentTest.java index 2c0a821..6a8f64a 100644 --- a/source/src/test/java/com/javafortesters/chap005testwithourownclasses/domainobject/examples/TestAppEnvironmentTest.java +++ b/source/src/test/java/com/javafortesters/chap005testwithourownclasses/domainobject/examples/TestAppEnvironmentTest.java @@ -8,9 +8,11 @@ public class TestAppEnvironmentTest { @Test public void canGetUrlStatically(){ + assertEquals("Returns Hard Coded URL", "http://192.123.0.3:67", - TestAppEnv.getUrl()); + TestAppEnv.getUrl() + ); } @Test diff --git a/source/src/test/java/com/javafortesters/chap007basicsofjavarevisited/examples/StatementsTest.java b/source/src/test/java/com/javafortesters/chap007basicsofjavarevisited/examples/StatementsTest.java index 5df6fc1..26a9df0 100644 --- a/source/src/test/java/com/javafortesters/chap007basicsofjavarevisited/examples/StatementsTest.java +++ b/source/src/test/java/com/javafortesters/chap007basicsofjavarevisited/examples/StatementsTest.java @@ -12,8 +12,8 @@ public void statements(){ assertEquals(4, 2+2); assertEquals("2+2 always = 4", - 4, - 2+2); + 4, + 2+2); } } \ No newline at end of file diff --git a/source/src/test/java/com/javafortesters/chap014junit/exercises/JunitExercisesTest.java b/source/src/test/java/com/javafortesters/chap014junit/exercises/JunitExercisesTest.java index b95ddce..49c4875 100644 --- a/source/src/test/java/com/javafortesters/chap014junit/exercises/JunitExercisesTest.java +++ b/source/src/test/java/com/javafortesters/chap014junit/exercises/JunitExercisesTest.java @@ -46,8 +46,17 @@ public void junitHasAssertions(){ public void assertThatWithHamcrestMatchers(){ assertThat(3 + 3, is(6)); + + /* failing assert used to generate message in book + assertThat(3 + 3, is(7)); + */ + assertThat("3 + 3 = 6", 3 + 3, is(6)); + /* failing assert used to generate message in book + assertThat("3 + 3 = 6", 3 + 3, is(7)); + */ + assertThat("false is false", false, equalTo(false)); assertThat(false, is(false)); diff --git a/source/src/test/java/com/javafortesters/chap015stringsrevisited/examples/StringComparisonsTest.java b/source/src/test/java/com/javafortesters/chap015stringsrevisited/examples/StringComparisonsTest.java index 117342d..ede29bb 100644 --- a/source/src/test/java/com/javafortesters/chap015stringsrevisited/examples/StringComparisonsTest.java +++ b/source/src/test/java/com/javafortesters/chap015stringsrevisited/examples/StringComparisonsTest.java @@ -33,7 +33,7 @@ public void canCheckContainsOnString(){ assertThat(hello.contains("He"), is(true)); assertThat(hello.contains("Hello"), is(true)); - assertThat(hello.contains("he"), is(false)); + assertThat(hello.contains("LL"), is(false)); assertThat(hello.contains("z"), is(false)); assertThat(hello.contains("world"), is(false)); @@ -107,6 +107,22 @@ public void checkRegionMatches(){ hello.regionMatches(true, 6, "fez", 0, 2), is(true)); + // case insensitive search + assertThat( + hello.regionMatches(true, 0, "he", 0, 2), + is(true)); + + // case sensitive search + assertThat( + hello.regionMatches(false, 0, "hE", 0, 2), + is(false)); + assertThat( + hello.regionMatches(0, "hE", 0, 2), + is(false)); + assertThat( + hello.regionMatches(0, "He", 0, 2), + is(true)); + assertFalse( hello.regionMatches(true, 3, "lady", 0, 2)); assertFalse( diff --git a/source/src/test/java/com/javafortesters/chap017_datestimes/examples/SimpleDateFormatTest.java b/source/src/test/java/com/javafortesters/chap017_datestimes/examples/SimpleDateFormatTest.java index edaba7b..f155c3f 100644 --- a/source/src/test/java/com/javafortesters/chap017_datestimes/examples/SimpleDateFormatTest.java +++ b/source/src/test/java/com/javafortesters/chap017_datestimes/examples/SimpleDateFormatTest.java @@ -113,6 +113,7 @@ public void unusualDateFormatPatterns() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("y M d HH:mm:ss.SSS"); Date date = sdf.parse("2013 12 15 23:39:54.123"); + String[][] formatElement = { {"w", "Week in the year"}, {"www", "Week in the year"}, diff --git a/source/src/test/java/com/javafortesters/chap017_datestimes/exercises/DateTimeExercisesTest.java b/source/src/test/java/com/javafortesters/chap017_datestimes/exercises/DateTimeExercisesTest.java index bc91848..0bdb95f 100644 --- a/source/src/test/java/com/javafortesters/chap017_datestimes/exercises/DateTimeExercisesTest.java +++ b/source/src/test/java/com/javafortesters/chap017_datestimes/exercises/DateTimeExercisesTest.java @@ -75,13 +75,24 @@ public void useOtherCalendarConstants(){ @Test public void experimentWithCalendarConstants(){ Calendar cal = Calendar.getInstance(); - cal.set(2013, Calendar.DECEMBER, 15, 23,39, 54); + cal.set(2013, Calendar.DECEMBER, 15, 23, 39, 54); + assertThat(cal.get(Calendar.DAY_OF_WEEK), is(1)); assertThat(cal.get(Calendar.DAY_OF_WEEK), is(Calendar.SUNDAY)); + assertThat(cal.get(Calendar.DAY_OF_YEAR), is(349)); + + // week of month depends on first day of week + // some places use SUNDAY as first day + // set to MONDAY for our calculation + // and control Minimal Days in First Week + cal.setFirstDayOfWeek(Calendar.MONDAY); + cal.setMinimalDaysInFirstWeek(6); assertThat(cal.get(Calendar.WEEK_OF_MONTH), is(2)); + + // Week of the year, similarly requires the + // config to control first day assertThat(cal.get(Calendar.WEEK_OF_YEAR), is(50)); - assertThat(cal.get(Calendar.DAY_OF_YEAR), is(349)); } @Test diff --git a/source/src/test/java/com/javafortesters/chap018properties/examples/PropertiesTest.java b/source/src/test/java/com/javafortesters/chap018properties/examples/PropertiesTest.java index 733b8e4..85b5f7c 100644 --- a/source/src/test/java/com/javafortesters/chap018properties/examples/PropertiesTest.java +++ b/source/src/test/java/com/javafortesters/chap018properties/examples/PropertiesTest.java @@ -84,8 +84,9 @@ public void simpleSaveLoadPropertiesFile() throws IOException { String tempDirectory = System.getProperty("java.io.tmpdir"); String tempResourceFilePath = - tempDirectory + - "tempFileForPropertiesStoreTest.properties"; + new File(tempDirectory, + "tempFileForPropertiesStoreTest.properties") + .getAbsolutePath(); Properties saved = new Properties(); saved.setProperty("prop1", "Hello"); diff --git a/source/src/test/java/com/javafortesters/chap018properties/exercises/PropertyExercisesTest.java b/source/src/test/java/com/javafortesters/chap018properties/exercises/PropertyExercisesTest.java index c53de31..57eb000 100644 --- a/source/src/test/java/com/javafortesters/chap018properties/exercises/PropertyExercisesTest.java +++ b/source/src/test/java/com/javafortesters/chap018properties/exercises/PropertyExercisesTest.java @@ -52,10 +52,10 @@ public void canAccessSystemProperties(){ public void canSaveAndLoadAPropertiesFile() throws IOException { String tempDirectory = System.getProperty("java.io.tmpdir"); - String tempResourceFilePath = tempDirectory + - System.currentTimeMillis() + - System.nanoTime() + - ".properties"; + String tempResourceFilePath = new File(tempDirectory, + System.currentTimeMillis() + + System.nanoTime() + + ".properties").getAbsolutePath(); Properties saved = new Properties(); diff --git a/source/src/test/java/com/javafortesters/chap019files/examples/FileTest.java b/source/src/test/java/com/javafortesters/chap019files/examples/FileTest.java index 98d5435..33623a0 100644 --- a/source/src/test/java/com/javafortesters/chap019files/examples/FileTest.java +++ b/source/src/test/java/com/javafortesters/chap019files/examples/FileTest.java @@ -1,18 +1,32 @@ package com.javafortesters.chap019files.examples; -import org.junit.Assert; import org.junit.Test; import java.io.File; import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.StringEndsWith.endsWith; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class FileTest { + // when running cross platform there are differences to be aware of + // the system properties may not have a / at the end + // and building file paths by hand can be problematic requiring + // lots of care + // so we use the Paths.get instead + // http://docs.oracle.com/javase/7/docs/api/java/nio/file/Paths.html + // Then use the returned Path object toFile to create the file object + // Both Path and Paths have been available since Java 1.7 + // https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html + @Test public void aNewFileDoesNotCreateAFile() throws IOException { @@ -20,7 +34,29 @@ public void aNewFileDoesNotCreateAFile() throws IOException { assertThat(aTempFile.exists(), is(false)); } + @Test + public void pathsGetExampleForCrossPlatform() throws IOException { + + String tempDir = System.getProperty("java.io.tmpdir"); + + // you would probably just use File for this one + File theFile = Paths.get(tempDir, "file.txt").toFile(); + assertThat(theFile.getAbsolutePath(), + endsWith(File.separator + "file.txt")); + + theFile = Paths.get(tempDir, "temp1", "file.txt").toFile(); + assertThat(theFile.getAbsolutePath(), + endsWith(String.format("%s%s%1$s%s", + File.separator, "temp1", "file.txt"))); + theFile = Paths.get(tempDir, "temp1","temp2", "temp3", "file.txt").toFile(); + assertThat(theFile.getAbsolutePath(), + endsWith(String.format("%s%s%1$s%s%1$s%s%1$s%s", + File.separator, "temp1", "temp2", "temp3", "file.txt"))); + } + + +/* @Test public void createAFileAndDeleteIt() throws IOException { File aTempFile = new File("d:/tempJavaForTesters.txt"); @@ -32,11 +68,36 @@ public void createAFileAndDeleteIt() throws IOException { aTempFile.delete(); assertThat(aTempFile.exists(), is(false)); } +*/ + + // since the above example is commented out + // this checks that the basic code works + // in a platform independent way using Paths + @Test + public void createAFileAndDeleteItCodeCheck() throws IOException { + + /* for documentation of simple path + File aTempFile = Paths.get("d:", "tempJavaForTesters.txt").toFile(); + */ + + String tempDir = System.getProperty("java.io.tmpdir"); + File aTempFile = Paths.get(tempDir, "tempJavaForTesters.txt").toFile(); + + assertThat(aTempFile.exists(), is(false)); + + aTempFile.createNewFile(); + assertThat(aTempFile.exists(), is(true)); + + aTempFile.delete(); + assertThat(aTempFile.exists(), is(false)); + } + @Test public void createAFileAndDeleteItAlternativeConstructor() throws IOException { - File aTempFile = new File("d:", "tempJavaForTesters.txt"); + String tempDir = System.getProperty("java.io.tmpdir"); + File aTempFile = new File(tempDir, "tempJavaForTesters.txt"); assertThat(aTempFile.exists(), is(false)); aTempFile.createNewFile(); @@ -46,6 +107,26 @@ public void createAFileAndDeleteItAlternativeConstructor() throws IOException { assertThat(aTempFile.exists(), is(false)); } + @Test + public void createLongerPathExample(){ + + String tempDirectory = System.getProperty("java.io.tmpdir"); + File aFile = new File(tempDirectory); + aFile = new File(aFile, "1"); + aFile = new File(aFile, "2"); + aFile = new File(aFile, "3"); + aFile = new File(aFile, "4"); + + // make it an easy cross platform comparison + String filePathWithDots = aFile.getAbsolutePath().replace(File.separator, "."); + assertTrue(filePathWithDots.endsWith(".1.2.3.4")); + + Path aPath = Paths.get(tempDirectory, "1", "2", "3", "4"); + assertEquals(aFile.getAbsolutePath(), + aPath.toFile().getAbsolutePath()); + } + + @Test public void canonicalVsAbsolute() throws IOException { @@ -73,9 +154,10 @@ public void canonicalVsAbsolute() throws IOException { aFile.mkdirs(); System.out.println(oneDirectory.getAbsolutePath()); + System.out.println(oneDirectory.getCanonicalPath()); System.out.println(aFile.getAbsolutePath()); - assertThat(oneDirectory.getAbsolutePath(), is(oneDirectory.getCanonicalPath())); + assertTrue(oneDirectory.getCanonicalPath().endsWith(oneDirectory.getAbsolutePath())); File relative = new File(tempDirectory, currentMillis); relative = new File(relative, "1"); @@ -88,7 +170,7 @@ public void canonicalVsAbsolute() throws IOException { System.out.println(relative.getAbsolutePath()); - assertThat(oneDirectory.getAbsolutePath(), is(relative.getCanonicalPath())); + assertTrue(relative.getCanonicalPath().endsWith(oneDirectory.getAbsolutePath())); relative = new File(tempDirectory, currentMillis); relative = new File(relative, "1"); @@ -99,7 +181,7 @@ public void canonicalVsAbsolute() throws IOException { System.out.println(relative.getAbsolutePath()); - assertThat(oneDirectory.getAbsolutePath(), is(relative.getCanonicalPath())); + assertTrue(relative.getCanonicalPath().endsWith(oneDirectory.getAbsolutePath())); } @@ -107,11 +189,11 @@ public void canonicalVsAbsolute() throws IOException { public void mkdirsCreatesIntermediateDirs(){ String tempDirectory = System.getProperty("java.io.tmpdir"); - String newDirectoryStructure = tempDirectory + - System.currentTimeMillis() + - File.separator + - System.currentTimeMillis(); - File aDirectory = new File(newDirectoryStructure); + + File aDirectory = Paths.get(tempDirectory, + Long.toString(System.currentTimeMillis()), + Long.toString(System.currentTimeMillis())) + .toFile(); System.out.println(aDirectory.getAbsolutePath()); @@ -125,32 +207,35 @@ public void mkdirsCreatesDirectories(){ String tempDirectory = System.getProperty("java.io.tmpdir"); - String newDirectoryStructure = tempDirectory + - System.currentTimeMillis(); - //File.separator + - //System.currentTimeMillis(); + File aFilePath = Paths.get(tempDirectory, + Long.toString(System.currentTimeMillis()), + "test.tmp") + .toFile(); - System.out.println(newDirectoryStructure); + System.out.println(aFilePath.getAbsolutePath()); // mkdir won't create this because it is temp/millis/test.tmp - File aDirectory = new File(newDirectoryStructure, "test.tmp"); - assertThat(aDirectory.mkdir(), is(false)); - assertThat(aDirectory.exists(), is(false)); - // will create because it is just the temp/millis - aDirectory = new File(newDirectoryStructure); - assertThat(aDirectory.mkdir(), is(true)); + assertThat(aFilePath.mkdir(), is(false)); + assertThat(aFilePath.exists(), is(false)); + + // mkdir will create because it is just the temp/millis + File aDirectoryPath = Paths.get(tempDirectory, + Long.toString(System.currentTimeMillis())) + .toFile(); + + assertThat(aDirectoryPath.mkdir(), is(true)); } @Test public void fileAndPathSeparator(){ - Assert.assertTrue("Unrecognised OS file separator", - File.separator.equals("\\") || - File.separator.equals("/") ); - Assert.assertTrue("Unrecognised OS path separator", - File.pathSeparator.equals(";") || - File.pathSeparator.equals(":") ); + assertTrue("Unrecognised OS file separator", + File.separator.equals("\\") || + File.separator.equals("/")); + assertTrue("Unrecognised OS path separator", + File.pathSeparator.equals(";") || + File.pathSeparator.equals(":")); } @Test @@ -167,8 +252,8 @@ public void createATempFileAndDeleteOnExit(){ assertThat( aTempFile.getName().startsWith("prefix"), is(true)); assertThat( aTempFile.getName().endsWith("suffix"), is(true)); - assertThat( aTempFile.getParent() + File.separator, - is(System.getProperty("java.io.tmpdir"))); + assertTrue(System.getProperty("java.io.tmpdir"). + startsWith(aTempFile.getParent())); assertThat(aTempFile.getAbsolutePath().endsWith("suffix"), is(true)); @@ -177,8 +262,8 @@ public void createATempFileAndDeleteOnExit(){ assertThat(aTempFile.getCanonicalPath().endsWith("suffix"), is(true)); - assertThat(aTempFile.getCanonicalPath().startsWith( - System.getProperty("java.io.tmpdir")), is(true)); + assertThat(aTempFile.getCanonicalPath().contains( + System.getProperty("java.io.tmpdir")), is(true)); assertThat(aTempFile.exists(), is(true)); diff --git a/source/src/test/java/com/javafortesters/chap019files/exercises/FileExercisesTest.java b/source/src/test/java/com/javafortesters/chap019files/exercises/FileExercisesTest.java index b53dcaf..f333f5b 100644 --- a/source/src/test/java/com/javafortesters/chap019files/exercises/FileExercisesTest.java +++ b/source/src/test/java/com/javafortesters/chap019files/exercises/FileExercisesTest.java @@ -14,7 +14,8 @@ public class FileExercisesTest { @Test public void createTempFileVaryTheParameters() throws IOException { - // on windows these files are in %TEMP% + // on Windows these files are in %TEMP% + // on Mac these files are in $TMPDIR File temp1 = File.createTempFile("temp1", null); File temp2 = File.createTempFile("temp2OutFile", ".out"); @@ -62,17 +63,37 @@ public void writeATestToCheckCanonicalConversion() throws IOException { File absolute2 = new File("C:/1/2/../../1"); File canonical = new File("C:/1"); - assertThat(canonical.getAbsolutePath(), - is(canonical.getCanonicalPath())); - assertThat(canonical.getAbsolutePath(), - is(absolute1.getCanonicalPath())); - assertThat(canonical.getAbsolutePath(), - is(absolute2.getCanonicalPath())); + assertThat(trimOsStuff( + canonical.getAbsolutePath()), + is(trimOsStuff( + canonical.getCanonicalPath()))); + assertThat(trimOsStuff( + canonical.getAbsolutePath()), + is(trimOsStuff( + absolute1.getCanonicalPath()))); + assertThat(trimOsStuff( + canonical.getAbsolutePath()), + is(trimOsStuff( + absolute2.getCanonicalPath()))); assertThat(absolute1.getAbsolutePath().contains(".."), is(true)); assertThat(absolute2.getAbsolutePath().contains(".."), is(true)); } + // The above code runs fine on a Mac and Windows without needing + // trimOsStuff + // but on Linux, it seems to add a ./ in the middle of the absolute path + // e.g. /home/travis/build/eviltester/javaForTestersCode/./source/C:/1 + // So I add the following method to trim out the operating system addition to + // the path e.g. anything before the C: + private String trimOsStuff(String absolutePath) { + int posOfDrive = absolutePath.indexOf("C:"); + String pathWithoutOsPrefixes = absolutePath.substring(posOfDrive); + System.out.println(String.format( + "trimOsStuff: %s became %s",absolutePath, pathWithoutOsPrefixes)); + return pathWithoutOsPrefixes; + } + @Test public void checkThatTheTempDirectoryIsADirectory(){