Added Java 11 support and created constants in App.java (#1238)
Co-authored-by: cherukumilliv <VenkatRamaSubbarago.Cherukumilli@Cevalogistics.com>
This commit is contained in:
parent
1c26bd7416
commit
a3c4d36c3d
@ -37,6 +37,8 @@ import java.io.FileNotFoundException;
|
|||||||
*/
|
*/
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
|
private static final String ERROR = "Error";
|
||||||
|
private static final String MESSAGE = "Message";
|
||||||
public static FileLoggerModule fileLoggerModule;
|
public static FileLoggerModule fileLoggerModule;
|
||||||
public static ConsoleLoggerModule consoleLoggerModule;
|
public static ConsoleLoggerModule consoleLoggerModule;
|
||||||
|
|
||||||
@ -71,12 +73,12 @@ public class App {
|
|||||||
public static void execute(final String... args) {
|
public static void execute(final String... args) {
|
||||||
|
|
||||||
/* Send logs on file system */
|
/* Send logs on file system */
|
||||||
fileLoggerModule.printString("Message");
|
fileLoggerModule.printString(MESSAGE);
|
||||||
fileLoggerModule.printErrorString("Error");
|
fileLoggerModule.printErrorString(ERROR);
|
||||||
|
|
||||||
/* Send logs on console */
|
/* Send logs on console */
|
||||||
consoleLoggerModule.printString("Message");
|
consoleLoggerModule.printString(MESSAGE);
|
||||||
consoleLoggerModule.printErrorString("Error");
|
consoleLoggerModule.printErrorString(ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ public final class FileLoggerModuleTest {
|
|||||||
public void testFileMessage() 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 var fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
|
|
||||||
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
||||||
fileLoggerModule.prepare();
|
fileLoggerModule.prepare();
|
||||||
@ -89,7 +89,7 @@ public final class FileLoggerModuleTest {
|
|||||||
public void testNoFileMessage() 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 var fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
|
|
||||||
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
||||||
fileLoggerModule.prepare();
|
fileLoggerModule.prepare();
|
||||||
@ -111,7 +111,7 @@ public final class FileLoggerModuleTest {
|
|||||||
public void testFileErrorMessage() 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 var fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
|
|
||||||
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
||||||
fileLoggerModule.prepare();
|
fileLoggerModule.prepare();
|
||||||
@ -136,7 +136,7 @@ public final class FileLoggerModuleTest {
|
|||||||
public void testNoFileErrorMessage() 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 var fileLoggerModule = FileLoggerModule.getSingleton();
|
||||||
|
|
||||||
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
/* Prepare the essential sub modules, to perform the sequence of jobs */
|
||||||
fileLoggerModule.prepare();
|
fileLoggerModule.prepare();
|
||||||
@ -157,7 +157,7 @@ public final class FileLoggerModuleTest {
|
|||||||
private static final String readFirstLine(final String file) {
|
private static final String readFirstLine(final String file) {
|
||||||
|
|
||||||
String firstLine = null;
|
String firstLine = null;
|
||||||
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
|
try (var bufferedReader = new BufferedReader(new FileReader(file))) {
|
||||||
|
|
||||||
while (bufferedReader.ready()) {
|
while (bufferedReader.ready()) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user