From 003be8a5972d309df54c6e2990b3a83d23125709 Mon Sep 17 00:00:00 2001 From: Bruce Eckel Date: Tue, 9 Aug 2016 13:34:35 -0600 Subject: [PATCH] Added "Verifying Your Code" Chapter Incorporated/Removed associated appendices --- unittesting/build.gradle | 3 --- {assertions => verifying}/Assert1.java | 2 +- {assertions => verifying}/Assert2.java | 2 +- {logging => verifying}/ConfigureLogging.java | 2 +- {logging => verifying}/CustomHandler.java | 2 +- {logging => verifying}/InfoLogging.java | 2 +- {logging => verifying}/InfoLogging2.java | 2 +- {unittesting => verifying}/JUnitDemo.java | 3 +-- {assertions => verifying}/LoaderAssertions.java | 2 +- {logging => verifying}/LogToFile.java | 2 +- {logging => verifying}/LogToFile2.java | 2 +- {logging => verifying}/LoggingLevelManipulation.java | 2 +- {logging => verifying}/LoggingLevels.java | 2 +- {logging => verifying}/MultipleHandlers.java | 2 +- {logging => verifying}/MultipleHandlers2.java | 2 +- {logging => verifying}/PrintableLogRecord.java | 2 +- {assertions => verifying}/Queue.java | 3 +-- {debugging => verifying}/SimpleDebugging.java | 2 +- {logging => verifying}/SimpleFilter.java | 2 +- {logging => verifying}/SimpleFormatterExample.java | 2 +- {assertions => verifying}/build.gradle | 0 {logging => verifying}/log.prop | 2 +- 22 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 unittesting/build.gradle rename {assertions => verifying}/Assert1.java (94%) rename {assertions => verifying}/Assert2.java (95%) rename {logging => verifying}/ConfigureLogging.java (98%) rename {logging => verifying}/CustomHandler.java (97%) rename {logging => verifying}/InfoLogging.java (94%) rename {logging => verifying}/InfoLogging2.java (95%) rename {unittesting => verifying}/JUnitDemo.java (97%) rename {assertions => verifying}/LoaderAssertions.java (95%) rename {logging => verifying}/LogToFile.java (95%) rename {logging => verifying}/LogToFile2.java (96%) rename {logging => verifying}/LoggingLevelManipulation.java (99%) rename {logging => verifying}/LoggingLevels.java (98%) rename {logging => verifying}/MultipleHandlers.java (95%) rename {logging => verifying}/MultipleHandlers2.java (95%) rename {logging => verifying}/PrintableLogRecord.java (97%) rename {assertions => verifying}/Queue.java (98%) rename {debugging => verifying}/SimpleDebugging.java (96%) rename {logging => verifying}/SimpleFilter.java (97%) rename {logging => verifying}/SimpleFormatterExample.java (96%) rename {assertions => verifying}/build.gradle (100%) rename {logging => verifying}/log.prop (97%) diff --git a/unittesting/build.gradle b/unittesting/build.gradle deleted file mode 100644 index 7b6876d6..00000000 --- a/unittesting/build.gradle +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - compile 'junit:junit:4.12' -} diff --git a/assertions/Assert1.java b/verifying/Assert1.java similarity index 94% rename from assertions/Assert1.java rename to verifying/Assert1.java index a0e0a8c5..3ccef65e 100644 --- a/assertions/Assert1.java +++ b/verifying/Assert1.java @@ -1,4 +1,4 @@ -// assertions/Assert1.java +// verifying/Assert1.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/assertions/Assert2.java b/verifying/Assert2.java similarity index 95% rename from assertions/Assert2.java rename to verifying/Assert2.java index 7d5cddcd..e8475ea2 100644 --- a/assertions/Assert2.java +++ b/verifying/Assert2.java @@ -1,4 +1,4 @@ -// assertions/Assert2.java +// verifying/Assert2.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/ConfigureLogging.java b/verifying/ConfigureLogging.java similarity index 98% rename from logging/ConfigureLogging.java rename to verifying/ConfigureLogging.java index 1e1f6bf3..5d174299 100644 --- a/logging/ConfigureLogging.java +++ b/verifying/ConfigureLogging.java @@ -1,4 +1,4 @@ -// logging/ConfigureLogging.java +// verifying/ConfigureLogging.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/CustomHandler.java b/verifying/CustomHandler.java similarity index 97% rename from logging/CustomHandler.java rename to verifying/CustomHandler.java index 823e092c..e52b705c 100644 --- a/logging/CustomHandler.java +++ b/verifying/CustomHandler.java @@ -1,4 +1,4 @@ -// logging/CustomHandler.java +// verifying/CustomHandler.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/InfoLogging.java b/verifying/InfoLogging.java similarity index 94% rename from logging/InfoLogging.java rename to verifying/InfoLogging.java index 7fa19444..352eeab4 100644 --- a/logging/InfoLogging.java +++ b/verifying/InfoLogging.java @@ -1,4 +1,4 @@ -// logging/InfoLogging.java +// verifying/InfoLogging.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/InfoLogging2.java b/verifying/InfoLogging2.java similarity index 95% rename from logging/InfoLogging2.java rename to verifying/InfoLogging2.java index dd4c93d3..5c422b3f 100644 --- a/logging/InfoLogging2.java +++ b/verifying/InfoLogging2.java @@ -1,4 +1,4 @@ -// logging/InfoLogging2.java +// verifying/InfoLogging2.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/unittesting/JUnitDemo.java b/verifying/JUnitDemo.java similarity index 97% rename from unittesting/JUnitDemo.java rename to verifying/JUnitDemo.java index 8ad0a846..59aa70bf 100644 --- a/unittesting/JUnitDemo.java +++ b/verifying/JUnitDemo.java @@ -1,9 +1,8 @@ -// unittesting/JUnitDemo.java +// verifying/JUnitDemo.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Simple use of JUnit to test ArrayList -// (Install libraries from junit.org) import java.util.*; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/assertions/LoaderAssertions.java b/verifying/LoaderAssertions.java similarity index 95% rename from assertions/LoaderAssertions.java rename to verifying/LoaderAssertions.java index 28b640ff..e9414d94 100644 --- a/assertions/LoaderAssertions.java +++ b/verifying/LoaderAssertions.java @@ -1,4 +1,4 @@ -// assertions/LoaderAssertions.java +// verifying/LoaderAssertions.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/LogToFile.java b/verifying/LogToFile.java similarity index 95% rename from logging/LogToFile.java rename to verifying/LogToFile.java index 22b40861..81bb5813 100644 --- a/logging/LogToFile.java +++ b/verifying/LogToFile.java @@ -1,4 +1,4 @@ -// logging/LogToFile.java +// verifying/LogToFile.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/LogToFile2.java b/verifying/LogToFile2.java similarity index 96% rename from logging/LogToFile2.java rename to verifying/LogToFile2.java index b561e298..39e6d685 100644 --- a/logging/LogToFile2.java +++ b/verifying/LogToFile2.java @@ -1,4 +1,4 @@ -// logging/LogToFile2.java +// verifying/LogToFile2.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/LoggingLevelManipulation.java b/verifying/LoggingLevelManipulation.java similarity index 99% rename from logging/LoggingLevelManipulation.java rename to verifying/LoggingLevelManipulation.java index ec00a485..157590d8 100644 --- a/logging/LoggingLevelManipulation.java +++ b/verifying/LoggingLevelManipulation.java @@ -1,4 +1,4 @@ -// logging/LoggingLevelManipulation.java +// verifying/LoggingLevelManipulation.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/LoggingLevels.java b/verifying/LoggingLevels.java similarity index 98% rename from logging/LoggingLevels.java rename to verifying/LoggingLevels.java index 362c8133..552b7b63 100644 --- a/logging/LoggingLevels.java +++ b/verifying/LoggingLevels.java @@ -1,4 +1,4 @@ -// logging/LoggingLevels.java +// verifying/LoggingLevels.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/MultipleHandlers.java b/verifying/MultipleHandlers.java similarity index 95% rename from logging/MultipleHandlers.java rename to verifying/MultipleHandlers.java index 1c5335dc..6be245cf 100644 --- a/logging/MultipleHandlers.java +++ b/verifying/MultipleHandlers.java @@ -1,4 +1,4 @@ -// logging/MultipleHandlers.java +// verifying/MultipleHandlers.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/MultipleHandlers2.java b/verifying/MultipleHandlers2.java similarity index 95% rename from logging/MultipleHandlers2.java rename to verifying/MultipleHandlers2.java index 8177a1aa..d4098a9e 100644 --- a/logging/MultipleHandlers2.java +++ b/verifying/MultipleHandlers2.java @@ -1,4 +1,4 @@ -// logging/MultipleHandlers2.java +// verifying/MultipleHandlers2.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/PrintableLogRecord.java b/verifying/PrintableLogRecord.java similarity index 97% rename from logging/PrintableLogRecord.java rename to verifying/PrintableLogRecord.java index 3de032b2..06d8f4fe 100644 --- a/logging/PrintableLogRecord.java +++ b/verifying/PrintableLogRecord.java @@ -1,4 +1,4 @@ -// logging/PrintableLogRecord.java +// verifying/PrintableLogRecord.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/assertions/Queue.java b/verifying/Queue.java similarity index 98% rename from assertions/Queue.java rename to verifying/Queue.java index 8d6b4356..6138dc44 100644 --- a/assertions/Queue.java +++ b/verifying/Queue.java @@ -1,10 +1,9 @@ -// assertions/Queue.java +// verifying/Queue.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. // Demonstration of Design by Contract (DbC) // combined with white-box unit testing -// (Install libraries from www.junit.org) import java.util.*; import org.junit.Test; import static org.junit.Assert.assertEquals; diff --git a/debugging/SimpleDebugging.java b/verifying/SimpleDebugging.java similarity index 96% rename from debugging/SimpleDebugging.java rename to verifying/SimpleDebugging.java index 4a78dc95..f5568d8b 100644 --- a/debugging/SimpleDebugging.java +++ b/verifying/SimpleDebugging.java @@ -1,4 +1,4 @@ -// debugging/SimpleDebugging.java +// verifying/SimpleDebugging.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/SimpleFilter.java b/verifying/SimpleFilter.java similarity index 97% rename from logging/SimpleFilter.java rename to verifying/SimpleFilter.java index 106008f7..eb461933 100644 --- a/logging/SimpleFilter.java +++ b/verifying/SimpleFilter.java @@ -1,4 +1,4 @@ -// logging/SimpleFilter.java +// verifying/SimpleFilter.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/logging/SimpleFormatterExample.java b/verifying/SimpleFormatterExample.java similarity index 96% rename from logging/SimpleFormatterExample.java rename to verifying/SimpleFormatterExample.java index cfbb7a99..3c8a1dfd 100644 --- a/logging/SimpleFormatterExample.java +++ b/verifying/SimpleFormatterExample.java @@ -1,4 +1,4 @@ -// logging/SimpleFormatterExample.java +// verifying/SimpleFormatterExample.java // (c)2016 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://mindviewinc.com/Books/OnJava/ for more book information. diff --git a/assertions/build.gradle b/verifying/build.gradle similarity index 100% rename from assertions/build.gradle rename to verifying/build.gradle diff --git a/logging/log.prop b/verifying/log.prop similarity index 97% rename from logging/log.prop rename to verifying/log.prop index 59f2f7ff..aa3556a6 100644 --- a/logging/log.prop +++ b/verifying/log.prop @@ -1,4 +1,4 @@ -// logging/log.prop +// verifying/log.prop #### Configuration File #### # Global Params # Handlers installed for the root logger