Skip to content

Commit

Permalink
update scripts to run clients
Browse files Browse the repository at this point in the history
  • Loading branch information
lubux committed Jul 2, 2020
1 parent 76055f1 commit 517e21a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ To use the driver, add the following library to your project.
</dependency>
```
Example of how to use the library.
```
timecrypt-examples/scripts/run_example1.sh
```
Runs the example.
Create a `TimeCryptClient` object to interact with a TimeCrypt server.
```java
TimeCryptProfile profile = new LocalTimeCryptProfile(null, "myUser", "..", SERVER_ADDRESS, SERVER_PORT);
Expand Down
2 changes: 1 addition & 1 deletion timecrypt-client/scripts/run_cli_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ LOCAL_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
CUR_PATH=$(pwd)
cd ${LOCAL_PATH}/../

java -Xmx${memusage} -cp target/timecrypt-client-jar-with-dependencies.jar
java -jar target/timecrypt-client-jar-with-dependencies.jar

cd ${CUR_PATH}
2 changes: 1 addition & 1 deletion timecrypt-client/scripts/run_testbed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ LOCAL_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
CUR_PATH=$(pwd)
cd ${LOCAL_PATH}/../

java -Xmx${memusage} -cp target//timecrypt-testbed-jar-with-dependencies.jar
java -jar target//timecrypt-testbed-jar-with-dependencies.jar

cd ${CUR_PATH}
11 changes: 11 additions & 0 deletions timecrypt-examples/scripts/run_example1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

LOCAL_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
CUR_PATH=$(pwd)
cd ${LOCAL_PATH}/../

IP="127.0.0.1"

java -jar target/timecrypt-example-usage-jar-with-dependencies.jar $IP

cd ${CUR_PATH}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class BasicTCUsage {

private static final String DUMMY_PASSWORD = "asdfghjklasdfghjkl";
private static final String SERVER_ADDRESS = "172.17.0.1";
private static String SERVER_ADDRESS = "172.17.0.1";
private static final int SERVER_PORT = 15000;
private static final int TIME_MINUTES_BEFORE_NOW = 10;
private static final int MIN_TO_MS = 60 * 1000;
Expand Down Expand Up @@ -115,6 +115,8 @@ public static void basicDemo() throws Exception {

public static void main(String[] args) {
try {
if (args.length > 0)
SERVER_ADDRESS = args[0];
basicDemo();
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 517e21a

Please sign in to comment.