Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
K
key_value-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amir.yosef
key_value-server
Commits
cddb4a54
Commit
cddb4a54
authored
Aug 20, 2024
by
amir.yosef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding some tests ( first stage )
parent
b7615176
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
357 additions
and
15 deletions
+357
-15
io_quarkus_junit5_mockito.xml
.idea/libraries/io_quarkus_junit5_mockito.xml
+157
-0
junit.xml
.idea/libraries/junit.xml
+11
-0
Redis.iml
Redis.iml
+19
-0
Main.java
src/Main.java
+8
-8
EchoCommand.java
src/command/EchoCommand.java
+1
-1
FullRsyncCommand.java
src/command/FullRsyncCommand.java
+0
-1
ReplicaReplConfCommand.java
src/command/replica/ReplicaReplConfCommand.java
+0
-1
Director.java
src/director/Director.java
+1
-1
ConnectionHandler.java
src/handlers/replica/ConnectionHandler.java
+3
-3
Storage.java
src/storage/Storage.java
+2
-0
EchoCommandTest.java
test/command/EchoCommandTest.java
+44
-0
PingCommandSenderTest.java
test/command/PingCommandSenderTest.java
+33
-0
PingCommandTest.java
test/command/PingCommandTest.java
+25
-0
ReplConfCommandTest.java
test/command/ReplConfCommandTest.java
+29
-0
UnknownCommandTest.java
test/command/UnknownCommandTest.java
+24
-0
No files found.
.idea/libraries/io_quarkus_junit5_mockito.xml
0 → 100644
View file @
cddb4a54
<component
name=
"libraryTable"
>
<library
name=
"io.quarkus.junit5.mockito"
type=
"repository"
>
<properties
maven-id=
"io.quarkus:quarkus-junit5-mockito:3.13.2"
/>
<CLASSES>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-junit5-mockito/3.13.2/quarkus-junit5-mockito-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-junit5/3.13.2/quarkus-junit5-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-core/3.13.2/quarkus-bootstrap-core-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-classloader-commons/3.13.2/quarkus-classloader-commons-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-app-model/3.13.2/quarkus-bootstrap-app-model-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-io/2.5.0/smallrye-common-io-2.5.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/eclipse/sisu/org.eclipse.sisu.inject/0.9.0.M3/org.eclipse.sisu.inject-0.9.0.M3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-test-common/3.13.2/quarkus-test-common-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-maven-resolver/3.13.2/quarkus-bootstrap-maven-resolver-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/beanbag/smallrye-beanbag-maven/1.5.2/smallrye-beanbag-maven-1.5.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/beanbag/smallrye-beanbag-sisu/1.5.2/smallrye-beanbag-sisu-1.5.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/beanbag/smallrye-beanbag/1.5.2/smallrye-beanbag-1.5.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.17.0/commons-codec-1.17.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/javax/inject/javax.inject/1/javax.inject-1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-artifact/3.9.8/maven-artifact-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-builder-support/3.9.8/maven-builder-support-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-model/3.9.8/maven-model-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-model-builder/3.9.8/maven-model-builder-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-repository-metadata/3.9.8/maven-repository-metadata-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-settings/3.9.8/maven-settings-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-api/1.9.20/maven-resolver-api-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-impl/1.9.20/maven-resolver-impl-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-named-locks/1.9.20/maven-resolver-named-locks-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-spi/1.9.20/maven-resolver-spi-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-util/1.9.20/maven-resolver-util-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-transport-http/1.9.20/maven-resolver-transport-http-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/slf4j/jcl-over-slf4j/1.7.36/jcl-over-slf4j-1.7.36.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/wagon/wagon-provider-api/3.5.3/wagon-provider-api-3.5.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/wagon/wagon-http-shared/3.5.3/wagon-http-shared-3.5.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-interpolation/1.27/plexus-interpolation-1.27.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-utils/4.0.1/plexus-utils-4.0.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-xml/4.0.1/plexus-xml-4.0.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-xml-impl/4.0.0-alpha-5/maven-xml-impl-4.0.0-alpha-5.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-api-xml/4.0.0-alpha-5/maven-api-xml-4.0.0-alpha-5.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-api-meta/4.0.0-alpha-5/maven-api-meta-4.0.0-alpha-5.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-cipher/2.1.0/plexus-cipher-2.1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-embedder/3.9.8/maven-embedder-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-core/3.9.8/maven-core-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-plugin-api/3.9.8/maven-plugin-api-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/shared/maven-shared-utils/3.4.2/maven-shared-utils-3.4.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/com/google/inject/guice/5.1.0/guice-5.1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/aopalliance/aopalliance/1.0/aopalliance-1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/com/google/guava/guava/33.2.1-jre/guava-33.2.1-jre.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/com/google/guava/failureaccess/1.0.2/failureaccess-1.0.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/codehaus/plexus/plexus-classworlds/2.8.0/plexus-classworlds-2.8.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/commons-cli/commons-cli/1.8.0/commons-cli-1.8.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/eclipse/sisu/org.eclipse.sisu.plexus/0.9.0.M3/org.eclipse.sisu.plexus-0.9.0.M3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-settings-builder/3.9.8/maven-settings-builder-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/maven-resolver-provider/3.9.8/maven-resolver-provider-3.9.8.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-connector-basic/1.9.20/maven-resolver-connector-basic-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/resolver/maven-resolver-transport-wagon/1.9.20/maven-resolver-transport-wagon-1.9.20.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/wagon/wagon-http/3.5.3/wagon-http-3.5.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/maven/wagon/wagon-file/3.5.3/wagon-file-3.5.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-gradle-resolver/3.13.2/quarkus-bootstrap-gradle-resolver-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/jandex/3.2.1/jandex-3.2.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/commons-io/commons-io/2.16.1/commons-io-2.16.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/logging/commons-logging-jboss-logging/1.0.0.Final/commons-logging-jboss-logging-1.0.0.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-junit5-properties/3.13.2/quarkus-junit5-properties-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.10.3/junit-jupiter-5.10.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.10.3/junit-jupiter-params-5.10.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.10.3/junit-jupiter-engine-5.10.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.10.3/junit-platform-engine-1.10.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-core/3.13.2/quarkus-core-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/annotation/jakarta.annotation-api/3.0.0/jakarta.annotation-api-3.0.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/enterprise/jakarta.enterprise.cdi-api/4.1.0/jakarta.enterprise.cdi-api-4.1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/enterprise/jakarta.enterprise.lang-model/4.1.0/jakarta.enterprise.lang-model-4.1.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/el/jakarta.el-api/6.0.0/jakarta.el-api-6.0.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/interceptor/jakarta.interceptor-api/2.2.0/jakarta.interceptor-api-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-os/2.5.0/smallrye-common-os-2.5.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-ide-launcher/3.13.2/quarkus-ide-launcher-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-development-mode-spi/3.13.2/quarkus-development-mode-spi-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config/3.9.1/smallrye-config-3.9.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-core/3.9.1/smallrye-config-core-3.9.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-classloader/2.4.0/smallrye-common-classloader-2.4.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-common/3.9.1/smallrye-config-common-3.9.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.6.0.Final/jboss-logging-3.6.0.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/logmanager/jboss-logmanager/3.0.6.Final/jboss-logmanager-3.0.6.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-constraint/2.2.0/smallrye-common-constraint-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-cpu/2.2.0/smallrye-common-cpu-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-expression/2.2.0/smallrye-common-expression-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-function/2.2.0/smallrye-common-function-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-net/2.2.0/smallrye-common-net-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-ref/2.2.0/smallrye-common-ref-2.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/json/jakarta.json-api/2.1.3/jakarta.json-api-2.1.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/eclipse/parsson/parsson/1.1.6/parsson-1.1.6.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/3.0.0.Final/jboss-logging-annotations-3.0.0.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/threads/jboss-threads/3.6.1.Final/jboss-threads-3.6.1.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/slf4j/slf4j-jboss-logmanager/2.0.0.Final/slf4j-jboss-logmanager-2.0.0.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/wildfly/common/wildfly-common/1.7.0.Final/wildfly-common-1.7.0.Final.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-runner/3.13.2/quarkus-bootstrap-runner-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/github/crac/org-crac/0.1.3/org-crac-0.1.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-fs-util/0.0.10/quarkus-fs-util-0.0.10.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jboss/marshalling/jboss-marshalling/2.1.4.SP1/jboss-marshalling-2.1.4.SP1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/mockito/mockito-junit-jupiter/5.12.0/mockito-junit-jupiter-5.12.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/mockito/mockito-core/5.12.0/mockito-core-5.12.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy/1.14.15/byte-buddy-1.14.15.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.14.15/byte-buddy-agent-1.14.15.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/objenesis/objenesis/3.3/objenesis-3.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.10.2/junit-jupiter-api-5.10.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.10.2/junit-platform-commons-1.10.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-junit5-mockito-config/3.13.2/quarkus-junit5-mockito-config-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-arc-deployment/3.13.2/quarkus-arc-deployment-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-core-deployment/3.13.2/quarkus-core-deployment-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/aesh/readline/2.6/readline-2.6.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/fusesource/jansi/jansi/2.4.0/jansi-2.4.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/aesh/aesh/2.8.2/aesh-2.8.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apache/commons/commons-lang3/3.15.0/commons-lang3-3.15.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/gizmo/gizmo/1.8.0/gizmo-1.8.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-util/9.6/asm-util-9.6.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/9.7/asm-9.7.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-commons/9.7/asm-commons-9.7.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm-tree/9.7/asm-tree-9.7.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-hibernate-validator-spi/3.13.2/quarkus-hibernate-validator-spi-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-class-change-agent/3.13.2/quarkus-class-change-agent-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-devtools-utilities/3.13.2/quarkus-devtools-utilities-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-builder/3.13.2/quarkus-builder-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/graalvm/sdk/nativeimage/23.1.2/nativeimage-23.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/graalvm/sdk/word/23.1.2/word-23.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-launcher/1.10.3/junit-platform-launcher-1.10.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-smallrye-context-propagation-spi/3.13.2/quarkus-smallrye-context-propagation-spi-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/eclipse/microprofile/context-propagation/microprofile-context-propagation-api/1.3/microprofile-context-propagation-api-1.3.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-vertx-http-dev-ui-spi/3.13.2/quarkus-vertx-http-dev-ui-spi-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-arc/3.13.2/quarkus-arc-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/arc/arc/3.13.2/arc-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/2.0.1/jakarta.transaction-api-2.0.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/arc/arc-processor/3.13.2/arc-processor-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-arc-test-supplement/3.13.2/quarkus-arc-test-supplement-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/mockito/mockito-subclass/5.12.0/mockito-subclass-5.12.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-mutiny/3.13.2/quarkus-mutiny-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/reactive/mutiny/2.6.2/mutiny-2.6.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-annotation/2.5.0/smallrye-common-annotation-2.5.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/jctools/jctools-core/4.0.5/jctools-core-4.0.5.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-smallrye-context-propagation/3.13.2/quarkus-smallrye-context-propagation-3.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/smallrye-context-propagation/2.1.2/smallrye-context-propagation-2.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/eclipse/microprofile/config/microprofile-config-api/3.0.2/microprofile-config-api-3.0.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/smallrye-context-propagation-api/2.1.2/smallrye-context-propagation-api-2.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/smallrye-context-propagation-storage/2.1.2/smallrye-context-propagation-storage-2.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/io/smallrye/reactive/mutiny-smallrye-context-propagation/2.6.2/mutiny-smallrye-context-propagation-2.6.2.jar!/"
/>
</CLASSES>
<JAVADOC
/>
<SOURCES
/>
</library>
</component>
\ No newline at end of file
.idea/libraries/junit.xml
0 → 100644
View file @
cddb4a54
<component
name=
"libraryTable"
>
<library
name=
"junit"
type=
"repository"
>
<properties
maven-id=
"junit:junit:4.13.2"
/>
<CLASSES>
<root
url=
"jar://$MAVEN_REPOSITORY$/junit/junit/4.13.2/junit-4.13.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/"
/>
</CLASSES>
<JAVADOC
/>
<SOURCES
/>
</library>
</component>
\ No newline at end of file
Redis.iml
View file @
cddb4a54
...
@@ -4,9 +4,28 @@
...
@@ -4,9 +4,28 @@
<exclude-output
/>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/test"
isTestSource=
"true"
/>
</content>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"lib"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"lib"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"junit"
level=
"project"
/>
<orderEntry
type=
"module-library"
scope=
"TEST"
>
<library
name=
"JUnit5.8.1"
>
<CLASSES>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.8.1/junit-jupiter-5.8.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.8.1/junit-platform-commons-1.8.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.8.1/junit-jupiter-params-5.8.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.8.1/junit-jupiter-engine-5.8.1.jar!/"
/>
<root
url=
"jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.8.1/junit-platform-engine-1.8.1.jar!/"
/>
</CLASSES>
<JAVADOC
/>
<SOURCES
/>
</library>
</orderEntry>
<orderEntry
type=
"library"
name=
"io.quarkus.junit5.mockito"
level=
"project"
/>
</component>
</component>
</module>
</module>
\ No newline at end of file
src/Main.java
View file @
cddb4a54
...
@@ -18,14 +18,14 @@ public class Main {
...
@@ -18,14 +18,14 @@ public class Main {
// server.start();
// server.start();
// }
// }
// builder.setPort(16379);
// builder.setPort(16379);
executor
.
submit
(()
->
{
//
executor.submit(() -> {
ReplicaConnectionService
service
=
null
;
//
ReplicaConnectionService service = null;
try
{
//
try {
director
.
buildReplica
(
builder
,
service
);
//
director.buildReplica(builder, service);
}
catch
(
IOException
e
)
{
//
} catch (IOException e) {
throw
new
RuntimeException
(
e
);
//
throw new RuntimeException(e);
}
//
}
});
//
});
executor
.
submit
(()
->
{
executor
.
submit
(()
->
{
try
(
Server
server
=
builder
.
build
())
{
try
(
Server
server
=
builder
.
build
())
{
server
.
start
();
server
.
start
();
...
...
src/command/EchoCommand.java
View file @
cddb4a54
...
@@ -13,7 +13,7 @@ public class EchoCommand implements CommandExecutable<byte[]> {
...
@@ -13,7 +13,7 @@ public class EchoCommand implements CommandExecutable<byte[]> {
@Override
@Override
public
byte
[]
execute
()
{
public
byte
[]
execute
()
{
if
(!
args
.
isEmpty
())
{
if
(!
args
.
isEmpty
()
&&
args
.
getFirst
()
!=
null
)
{
return
(
Response
.
getResponse
(
args
.
getFirst
()));
return
(
Response
.
getResponse
(
args
.
getFirst
()));
}
else
{
}
else
{
return
""
.
getBytes
();
return
""
.
getBytes
();
...
...
src/command/FullRsyncCommand.java
View file @
cddb4a54
...
@@ -27,7 +27,6 @@ public class FullRsyncCommand implements CommandExecutable<byte[]> {
...
@@ -27,7 +27,6 @@ public class FullRsyncCommand implements CommandExecutable<byte[]> {
public
byte
[]
execute
()
{
public
byte
[]
execute
()
{
synchronized
(
this
)
{
synchronized
(
this
)
{
replicaSender
.
addConnection
(
outputStream
);
replicaSender
.
addConnection
(
outputStream
);
System
.
out
.
println
(
"hi"
);
byte
[]
decode
=
rdbFileInfo
.
getContent
();
byte
[]
decode
=
rdbFileInfo
.
getContent
();
try
{
try
{
return
createCommandBytes
(
Command
.
FULLRESYNC
,
decode
,
serverInfo
);
return
createCommandBytes
(
Command
.
FULLRESYNC
,
decode
,
serverInfo
);
...
...
src/command/replica/ReplicaReplConfCommand.java
View file @
cddb4a54
...
@@ -19,7 +19,6 @@ public class ReplicaReplConfCommand implements CommandExecutable<byte[]> {
...
@@ -19,7 +19,6 @@ public class ReplicaReplConfCommand implements CommandExecutable<byte[]> {
@Override
@Override
public
byte
[]
execute
()
{
public
byte
[]
execute
()
{
System
.
out
.
println
(
"ReplicaReplConfCommand processed command: "
);
return
commandParser
.
getResponseFromCommandArray
(
List
.
of
(
Command
.
REPLCONF
.
getValue
(),
"ACK"
,
commandByteCounter
.
getBytes
().
toString
())).
getBytes
();
return
commandParser
.
getResponseFromCommandArray
(
List
.
of
(
Command
.
REPLCONF
.
getValue
(),
"ACK"
,
commandByteCounter
.
getBytes
().
toString
())).
getBytes
();
}
}
...
...
src/director/Director.java
View file @
cddb4a54
...
@@ -12,7 +12,7 @@ public class Director {
...
@@ -12,7 +12,7 @@ public class Director {
}
}
public
void
buildReplica
(
ServerBuilder
builder
,
ReplicaConnectionService
replicaConnectionService
)
throws
IOException
{
public
void
buildReplica
(
ServerBuilder
builder
,
ReplicaConnectionService
replicaConnectionService
)
throws
IOException
{
replicaConnectionService
=
new
ReplicaConnectionService
(
builder
.
getMasterPortAndHost
(),
163
78
);
replicaConnectionService
=
new
ReplicaConnectionService
(
builder
.
getMasterPortAndHost
(),
163
80
);
replicaConnectionService
.
checkConnection
();
replicaConnectionService
.
checkConnection
();
}
}
}
}
src/handlers/replica/ConnectionHandler.java
View file @
cddb4a54
...
@@ -33,10 +33,10 @@ public class ConnectionHandler {
...
@@ -33,10 +33,10 @@ public class ConnectionHandler {
}
}
public
BufferedReader
handleConnection
()
{
public
BufferedReader
handleConnection
()
{
try
(
OutputStream
outputStream
=
socket
.
getOutputStream
();
try
{
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
InputStreamReader
(
socket
.
getInputStream
())))
{
OutputStream
outputStream
=
socket
.
getOutputStream
();
BufferedReader
bufferedReader
=
new
BufferedReader
(
new
InputStreamReader
(
socket
.
getInputStream
()));
commandSender
.
sendCommand
(
bufferedReader
,
outputStream
);
commandSender
.
sendCommand
(
bufferedReader
,
outputStream
);
String
line
;
String
line
;
while
((
line
=
bufferedReader
.
readLine
())
!=
null
)
{
while
((
line
=
bufferedReader
.
readLine
())
!=
null
)
{
if
(
line
.
isEmpty
())
{
if
(
line
.
isEmpty
())
{
...
...
src/storage/Storage.java
View file @
cddb4a54
package
storage
;
package
storage
;
import
model.RdbFile
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
test/command/EchoCommandTest.java
0 → 100644
View file @
cddb4a54
package
command
;
import
org.junit.Test
;
import
util.Response
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.
assertArrayEquals
;
public
class
EchoCommandTest
{
@Test
public
void
test_execute_with_non_empty_args
()
{
List
<
String
>
args
=
List
.
of
(
"hello"
);
EchoCommand
command
=
new
EchoCommand
(
args
);
byte
[]
result
=
command
.
execute
();
byte
[]
expected
=
Response
.
getResponse
(
"hello"
);
assertArrayEquals
(
expected
,
result
);
}
@Test
public
void
test_execute_with_null_args
()
{
List
<
String
>
args
=
Collections
.
singletonList
((
String
)
null
);
EchoCommand
command
=
new
EchoCommand
(
args
);
byte
[]
result
=
command
.
execute
();
byte
[]
expected
=
""
.
getBytes
();
assertArrayEquals
(
expected
,
result
);
}
@Test
public
void
test_execute_with_long_strings
()
{
List
<
String
>
longArgs
=
new
ArrayList
<>();
StringBuilder
longString
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
10000
;
i
++)
{
longString
.
append
(
"a"
);
}
longArgs
.
add
(
longString
.
toString
());
EchoCommand
command
=
new
EchoCommand
(
longArgs
);
byte
[]
result
=
command
.
execute
();
byte
[]
expected
=
Response
.
getResponse
(
longString
.
toString
());
assertArrayEquals
(
expected
,
result
);
}
}
\ No newline at end of file
test/command/PingCommandSenderTest.java
0 → 100644
View file @
cddb4a54
package
command
;
// Generated by CodiumAI
import
command.handshake.PingCommandSender
;
import
org.junit.Test
;
import
parser.CommandParser
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.List
;
import
static
org
.
junit
.
Assert
.
assertThrows
;
import
static
org
.
mockito
.
Mockito
.*;
public
class
PingCommandSenderTest
{
@Test
public
void
test_send_command_success
()
throws
IOException
{
CommandParser
commandParser
=
mock
(
CommandParser
.
class
);
PingCommandSender
pingCommandSender
=
new
PingCommandSender
(
commandParser
);
BufferedReader
bufferedReader
=
mock
(
BufferedReader
.
class
);
OutputStream
outputStream
=
mock
(
OutputStream
.
class
);
when
(
commandParser
.
getResponseFromCommandArray
(
List
.
of
(
"ping"
))).
thenReturn
(
"*1\r\n$4\r\nping\r\n"
);
pingCommandSender
.
sendCommand
(
bufferedReader
,
outputStream
);
verify
(
outputStream
).
write
(
"*1\r\n$4\r\nping\r\n"
.
getBytes
());
verify
(
outputStream
).
flush
();
}
}
\ No newline at end of file
test/command/PingCommandTest.java
0 → 100644
View file @
cddb4a54
package
command
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertArrayEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
public
class
PingCommandTest
{
@Test
public
void
test_execute_returns_correct_pong_response
()
{
PingCommand
pingCommand
=
new
PingCommand
();
byte
[]
expectedResponse
=
"+PONG\r\n"
.
getBytes
();
byte
[]
actualResponse
=
pingCommand
.
execute
();
assertArrayEquals
(
expectedResponse
,
actualResponse
);
}
@Test
public
void
test_execute_handles_null_values_gracefully
()
{
PingCommand
pingCommand
=
new
PingCommand
();
byte
[]
response
=
pingCommand
.
execute
();
assertNotNull
(
response
);
}
}
\ No newline at end of file
test/command/ReplConfCommandTest.java
0 → 100644
View file @
cddb4a54
package
command
;
import
org.junit.Test
;
import
java.util.List
;
import
java.util.NoSuchElementException
;
import
static
org
.
junit
.
Assert
.
assertNull
;
import
static
org
.
junit
.
Assert
.
assertThrows
;
public
class
ReplConfCommandTest
{
@Test
public
void
test_execute_returns_null_for_ack
()
{
List
<
String
>
args
=
List
.
of
(
"ACK"
);
ReplConfCommand
command
=
new
ReplConfCommand
(
args
);
byte
[]
result
=
command
.
execute
();
assertNull
(
result
);
}
@Test
public
void
test_execute_with_empty_args_list
()
{
List
<
String
>
args
=
List
.
of
();
ReplConfCommand
command
=
new
ReplConfCommand
(
args
);
assertThrows
(
NoSuchElementException
.
class
,
command:
:
execute
);
}
}
\ No newline at end of file
test/command/UnknownCommandTest.java
0 → 100644
View file @
cddb4a54
package
command
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertArrayEquals
;
public
class
UnknownCommandTest
{
@Test
public
void
test_execute_with_message
()
{
String
testMessage
=
"Test Message"
;
UnknownCommand
command
=
new
UnknownCommand
(
testMessage
);
byte
[]
result
=
command
.
execute
();
assertArrayEquals
(
testMessage
.
getBytes
(),
result
);
}
@Test
public
void
test_execute_with_null_message
()
{
UnknownCommand
command
=
new
UnknownCommand
();
byte
[]
result
=
command
.
execute
();
assertArrayEquals
(
"-Unknown Command\r\n"
.
getBytes
(),
result
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment