-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove proto, switch to JSON (MappingJackson2HttpMessageConverter) fo…
…r NodeInfo; add NodeAction; add test stubs for implementation
- Loading branch information
alesavin
committed
Feb 14, 2018
1 parent
c6d154a
commit fcf5ad8
Showing
13 changed files
with
186 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
bdse-integration-tests/src/test/java/ru/csc/bdse/kv/KeyValueApiHttpClientTest2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package ru.csc.bdse.kv; | ||
|
||
import org.junit.ClassRule; | ||
import org.junit.Test; | ||
import org.testcontainers.containers.GenericContainer; | ||
import org.testcontainers.images.builder.ImageFromDockerfile; | ||
import ru.csc.bdse.util.Env; | ||
|
||
import java.io.File; | ||
import java.time.Duration; | ||
|
||
import static java.time.temporal.ChronoUnit.SECONDS; | ||
|
||
/** | ||
* Test have to be implemented | ||
* | ||
* @author alesavin | ||
*/ | ||
public class KeyValueApiHttpClientTest2 { | ||
|
||
@ClassRule | ||
public static final GenericContainer node = new GenericContainer( | ||
new ImageFromDockerfile() | ||
.withFileFromFile("target/bdse-kvnode-0.0.1-SNAPSHOT.jar", new File | ||
("../bdse-kvnode/target/bdse-kvnode-0.0.1-SNAPSHOT.jar")) | ||
.withFileFromClasspath("Dockerfile", "kvnode/Dockerfile")) | ||
.withEnv(Env.KVNODE_NAME, "node-0") | ||
.withExposedPorts(8080) | ||
.withStartupTimeout(Duration.of(30, SECONDS)); | ||
|
||
private KeyValueApi api = newKeyValueApi(); | ||
|
||
private KeyValueApi newKeyValueApi() { | ||
final String baseUrl = "http://localhost:" + node.getMappedPort(8080); | ||
return new KeyValueApiHttpClient(baseUrl); | ||
} | ||
|
||
@Test | ||
public void deleteByKey() { | ||
// TODO use tombstones? | ||
} | ||
|
||
@Test | ||
public void concurrentPuts() { | ||
// TODO simultanious puts for the key value | ||
} | ||
|
||
@Test | ||
public void concurrentDeleteAndKeys() { | ||
//TODO simultanious delete by key and keys listing | ||
} | ||
|
||
@Test | ||
public void actionUpDown() { | ||
//TODO test up/down actions | ||
} | ||
|
||
@Test | ||
public void putWithStoppedNode() { | ||
//TODO test put if node/container was stopped | ||
} | ||
|
||
@Test | ||
public void getWithStoppedNode() { | ||
//TODO test get if node/container was stopped | ||
} | ||
|
||
@Test | ||
public void getKeysByPrefixWithStoppedNode() { | ||
//TODO test getKeysByPrefix if node/container was stopped | ||
} | ||
|
||
@Test | ||
public void loadMillionKeys() { | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package ru.csc.bdse.kv; | ||
|
||
/** | ||
* Action for node | ||
* | ||
* @author alesavin | ||
*/ | ||
public enum NodeAction { | ||
UP, | ||
DOWN | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package ru.csc.bdse.kv; | ||
|
||
/** | ||
* Represent node information | ||
* | ||
* @author alesavin | ||
*/ | ||
public class NodeInfo { | ||
|
||
private String name; | ||
private NodeStatus status; | ||
|
||
public NodeInfo(String name, NodeStatus status) { | ||
this.name = name; | ||
this.status = status; | ||
} | ||
|
||
public NodeInfo() { | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public void setStatus(NodeStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public NodeStatus getStatus() { | ||
return status; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package ru.csc.bdse.kv; | ||
|
||
/** | ||
* Status of the node | ||
* | ||
* @author alesavin | ||
*/ | ||
public enum NodeStatus { | ||
UP, | ||
DOWN | ||
} |
41 changes: 0 additions & 41 deletions
41
bdse-kvnode/src/main/java/ru/csc/bdse/util/Serializing.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.