Review comments++
This commit is contained in:
parent
ea7752c5e1
commit
4ff8fa3721
@ -33,8 +33,8 @@ import java.io.FileNotFoundException;
|
|||||||
*/
|
*/
|
||||||
public final class App {
|
public final class App {
|
||||||
|
|
||||||
public static FileLoggerModule fileLoggerModule = null;
|
public static FileLoggerModule fileLoggerModule;
|
||||||
public static ConsoleLoggerModule consoleLoggerModule = null;
|
public static ConsoleLoggerModule consoleLoggerModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Following method performs the initialization
|
* Following method performs the initialization
|
||||||
@ -44,6 +44,7 @@ public final class App {
|
|||||||
*/
|
*/
|
||||||
public static void prepare() throws FileNotFoundException {
|
public static void prepare() throws FileNotFoundException {
|
||||||
|
|
||||||
|
/* Create new singleton objects and prepare their modules */
|
||||||
fileLoggerModule = FileLoggerModule.getSingleton();
|
fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
consoleLoggerModule = ConsoleLoggerModule.getSingleton();
|
consoleLoggerModule = ConsoleLoggerModule.getSingleton();
|
||||||
|
|
||||||
|
@ -23,11 +23,7 @@ import java.io.PrintStream;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Module pattern can be considered a Creational pattern and a Structural pattern. It manages
|
* The ConsoleLoggerModule is responsible for showing logs on System Console
|
||||||
* the creation and organization of other elements, and groups them as the structural pattern does.
|
|
||||||
* An object that applies this pattern can provide the equivalent of a namespace, providing the
|
|
||||||
* initialization and finalization process of a static class or a class with static members with
|
|
||||||
* cleaner, more concise syntax and semantics.
|
|
||||||
* <p>
|
* <p>
|
||||||
* The below example demonstrates a Console logger module, which can print simple and error messages
|
* The below example demonstrates a Console logger module, which can print simple and error messages
|
||||||
* in two designated formats
|
* in two designated formats
|
||||||
|
@ -25,11 +25,7 @@ import java.io.PrintStream;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Module pattern can be considered a Creational pattern and a Structural pattern. It manages
|
* The FileLoggerModule is responsible for showing logs on File System
|
||||||
* the creation and organization of other elements, and groups them as the structural pattern does.
|
|
||||||
* An object that applies this pattern can provide the equivalent of a namespace, providing the
|
|
||||||
* initialization and finalization process of a static class or a class with static members with
|
|
||||||
* cleaner, more concise syntax and semantics.
|
|
||||||
* <p>
|
* <p>
|
||||||
* The below example demonstrates a File logger module, which can print simple and error messages in
|
* The below example demonstrates a File logger module, which can print simple and error messages in
|
||||||
* two designated files
|
* two designated files
|
||||||
|
@ -55,7 +55,7 @@ public final class FileLoggerModuleTest {
|
|||||||
* @throws IOException if program is not able to find log files (output.txt and error.txt)
|
* @throws IOException if program is not able to find log files (output.txt and error.txt)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void positiveTestFileMessage() throws IOException {
|
public void testFileMessage() throws IOException {
|
||||||
|
|
||||||
/* Get singletong instance of File Logger Module */
|
/* Get singletong instance of File Logger Module */
|
||||||
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
@ -79,7 +79,7 @@ public final class FileLoggerModuleTest {
|
|||||||
* @throws IOException if program is not able to find log files (output.txt and error.txt)
|
* @throws IOException if program is not able to find log files (output.txt and error.txt)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void negativeTestFileMessage() throws IOException {
|
public void testNoFileMessage() throws IOException {
|
||||||
|
|
||||||
/* Get singletong instance of File Logger Module */
|
/* Get singletong instance of File Logger Module */
|
||||||
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
@ -101,7 +101,7 @@ public final class FileLoggerModuleTest {
|
|||||||
* error.txt)
|
* error.txt)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void positiveTestFileErrorMessage() throws FileNotFoundException {
|
public void testFileErrorMessage() throws FileNotFoundException {
|
||||||
|
|
||||||
/* Get singletong instance of File Logger Module */
|
/* Get singletong instance of File Logger Module */
|
||||||
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
@ -126,7 +126,7 @@ public final class FileLoggerModuleTest {
|
|||||||
* error.txt)
|
* error.txt)
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void negativeTestFileErrorMessage() throws FileNotFoundException {
|
public void testNoFileErrorMessage() throws FileNotFoundException {
|
||||||
|
|
||||||
/* Get singletong instance of File Logger Module */
|
/* Get singletong instance of File Logger Module */
|
||||||
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
final FileLoggerModule fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user