Skip to content

Commit e3c700a

Browse files
committed
Merged conflict fix
Squash comments
1 parent 9814f0b commit e3c700a

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/main/java/org/fungover/haze/Main.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
import java.net.Socket;
1212
import java.util.ArrayList;
1313

14+
import java.util.Arrays;
1415
import java.util.List;
1516

16-
import static org.fungover.haze.RespInputParser.readInputStream;
17+
1718

1819
public class Main {
1920
static boolean serverOpen = true;
@@ -83,8 +84,8 @@ private static void shutdown(HazeDatabase hazeDatabase) {
8384

8485

8586
public static void printThreadDebug() {
86-
Log4j2.debug("ThreadID " + Thread.currentThread().threadId()); // Only for Debug
87-
Log4j2.debug("Is virtual Thread " + Thread.currentThread().isVirtual()); // Only for Debug
87+
logger.debug("ThreadID " + Thread.currentThread().threadId()); // Only for Debug
88+
logger.debug("Is virtual Thread " + Thread.currentThread().isVirtual()); // Only for Debug
8889

8990
}
9091

src/main/java/org/fungover/haze/RespInputParser.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
package org.fungover.haze;
22

3+
import org.apache.logging.log4j.LogManager;
4+
import org.apache.logging.log4j.Logger;
5+
36
import java.io.BufferedReader;
47
import java.io.IOException;
58
import java.util.Arrays;
69
import java.util.List;
710

811
public class RespInputParser {
9-
public static void readInputStream(BufferedReader input, List<String> inputList, String firstReading) throws IOException {
12+
13+
RespInputParser() {
14+
}
15+
private static final Logger logger = LogManager.getLogger(RespInputParser.class);
16+
17+
public static void readInputStream(BufferedReader input, List<String> inputList, String firstReading) throws IOException {
1018
if (firstReading.startsWith("*")) {
1119

12-
Log4j2.debug("readInputStream: " + input + " " + inputList + " " + firstReading);
20+
logger.debug("readInputStream: {} {} {}", input, inputList, firstReading);
1321
int size = Integer.parseInt(firstReading.substring(1)) * 2;
1422
for (int i = 0; i < size; i++) {
1523
String temp = input.readLine();

src/test/java/org/fungover/haze/MainTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,6 @@ void callExecuteCommandWithLMOVEShouldReturnErrorMessageWhenListIsEmpty() {
107107
void callExecuteCommandWithLTRIMShouldReturnErrorMessageWhenKeyDoesNotExist() {
108108
assertThat(Main.executeCommand(database, List.of("LTRIM", "key", "2", "3"), hazeList)).isEqualTo("-The key is not present in the database.\r\n");
109109
}
110-
@Test
111-
void callExecuteCommandWithDelAndMessageShouldReturnNull (){
112-
inputList = new ArrayList<>();
113-
inputList.add("DEL");
114-
inputList.add("key1");
115-
assertThat(Main.executeCommand(database,inputList)).isEqualTo(":0\r\n");
116-
}
117110

118111
@Test
119112
void testPrintThreadDebug() {

0 commit comments

Comments
 (0)