Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaruth committed Sep 19, 2024
1 parent 4c3a0f4 commit 6a374f6
Show file tree
Hide file tree
Showing 30 changed files with 336 additions and 314 deletions.
2 changes: 1 addition & 1 deletion client/src/main/kotlin/http/DevApi.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package http

import dto.DevCommandRequest
import http.dto.DevCommandRequest
import kong.unirest.HttpMethod

class DevApi(private val httpClient: HttpClient) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/kotlin/http/HealthCheckApi.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package http

import dto.HealthCheckResponse
import http.dto.HealthCheckResponse
import kong.unirest.HttpMethod

class HealthCheckApi(private val httpClient: HttpClient) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/kotlin/http/HttpClient.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package http

import dto.ClientErrorResponse
import http.dto.ClientErrorResponse
import java.util.*
import kong.unirest.HttpMethod
import kong.unirest.HttpResponse
Expand Down
2 changes: 1 addition & 1 deletion client/src/test/kotlin/http/HttpClientTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package http

import dto.ClientErrorResponse
import http.dto.ClientErrorResponse
import io.kotest.assertions.throwables.shouldNotThrowAny
import io.kotest.matchers.maps.shouldContain
import io.kotest.matchers.maps.shouldContainKeys
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package dto
package http.dto

data class ClientErrorResponse(val errorCode: String, val errorMessage: String)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package dto
package http.dto

data class DevCommandRequest(val command: String)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package dto
package http.dto

data class HealthCheckResponse(val version: String)
15 changes: 5 additions & 10 deletions server/src/main/java/object/Room.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
package object;

import auth.UserConnection;
import org.w3c.dom.Document;
import server.EntropyServer;
import util.*;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;

import org.w3c.dom.Document;

import server.EntropyServer;
import util.CardsUtil;
import util.Debug;
import util.EntropyUtil;
import util.StatisticsUtil;
import util.XmlBuilderServer;
import util.XmlConstants;

/**
* Server-side version of a Room
*/
Expand Down
2 changes: 2 additions & 0 deletions server/src/main/java/object/ServerRunnable.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package object;


import auth.UserConnection;

public interface ServerRunnable extends Runnable
{
public abstract String getDetails();
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/object/ServerThread.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package object;

import util.Debug;
import auth.UserConnection;

public class ServerThread extends Thread
{
Expand Down
216 changes: 0 additions & 216 deletions server/src/main/java/object/UserConnection.java

This file was deleted.

1 change: 1 addition & 0 deletions server/src/main/java/server/EntropyServer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package server;

import auth.UserConnection;
import logging.LoggerUncaughtExceptionHandler;
import object.*;
import org.w3c.dom.Document;
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/server/InactiveCheckRunnable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.util.List;

import auth.UserConnection;
import object.ServerRunnable;
import object.UserConnection;
import util.Debug;

import static utils.InjectedThings.logger;
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/server/ListenerRunnable.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package server;

import auth.UserConnection;
import object.ServerRunnable;
import object.UserConnection;
import util.Debug;

import java.net.ServerSocket;
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/server/MessageHandlerRunnable.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

import javax.crypto.SecretKey;

import auth.UserConnection;
import object.NotificationSocket;
import object.Room;
import object.ServerRunnable;
import object.UserConnection;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/server/NotificationRunnable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import java.net.SocketTimeoutException;
import java.util.concurrent.atomic.AtomicInteger;

import auth.UserConnection;
import object.NotificationSocket;
import object.ServerRunnable;
import object.UserConnection;

import org.w3c.dom.Document;

Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/util/EntropyThreadPoolExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

import auth.UserConnection;
import object.ServerRunnable;
import object.ServerThread;
import object.UserConnection;
import utils.InjectedThings;

/**
Expand Down
Loading

0 comments on commit 6a374f6

Please sign in to comment.