Skip to content

Commit

Permalink
update space name
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 committed Nov 2, 2021
1 parent 1b99039 commit d2b3bc6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ public static String createSpace() {
return exec;
}

public static String createSpaceCA() {
String exec = "CREATE SPACE IF NOT EXISTS testMetaCA(partition_num=10, "
+ "vid_type=fixed_string(8));"
+ "USE testMetaCA;"
+ "CREATE TAG IF NOT EXISTS person(name string, age int);"
+ "CREATE EDGE IF NOT EXISTS friend(likeness double);";
return exec;
}

public static String createSpaceSelf() {
String exec = "CREATE SPACE IF NOT EXISTS testMetaSelf(partition_num=10, "
+ "vid_type=fixed_string(8));"
+ "USE testMetaSelf;"
+ "CREATE TAG IF NOT EXISTS person(name string, age int);"
+ "CREATE EDGE IF NOT EXISTS friend(likeness double);";
return exec;
}

public static void createMultiVersionTagAndEdge() {
NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
nebulaPoolConfig.setMaxConnSize(100);
Expand Down Expand Up @@ -117,7 +135,7 @@ public static void createSpaceWithCASSL() {
pool.init(addresses, nebulaPoolConfig);
session = pool.getSession("root", "nebula", true);

ResultSet resp = session.execute(createSpace());
ResultSet resp = session.execute(createSpaceCA());
if (!resp.isSucceeded()) {
LOGGER.error("create space failed, {}", resp.getErrorMessage());
assert (false);
Expand Down Expand Up @@ -149,7 +167,7 @@ public static void createSpaceWithSelfSSL() {
try {
pool.init(addresses, nebulaPoolConfig);
session = pool.getSession("root", "nebula", true);
ResultSet resp = session.execute(createSpace());
ResultSet resp = session.execute(createSpaceSelf());
if (!resp.isSucceeded()) {
LOGGER.error("create space failed, {}", resp.getErrorMessage());
assert (false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ public void testCASignedSSLMetaClient() {
3000, 1, 1, true, sslParam);
metaClient.connect();

List<TagItem> tags = metaClient.getTags("testMeta");
List<TagItem> tags = metaClient.getTags("testMetaCA");
Assert.assertTrue(tags.size() >= 1);
assert (metaClient.getTag("testMeta", "person") != null);
assert (metaClient.getTag("testMetaCA", "person") != null);
} catch (Exception e) {
LOGGER.error("test CA signed ssl meta client failed, ", e);
assert (false);
Expand Down Expand Up @@ -200,9 +200,9 @@ public void testSelfSignedSSLMetaClient() {
3000, 1, 1, true, sslParam);
metaClient.connect();

List<TagItem> tags = metaClient.getTags("testMeta");
List<TagItem> tags = metaClient.getTags("testMetaSelf");
Assert.assertTrue(tags.size() >= 1);
assert (metaClient.getTag("testMeta", "person") != null);
assert (metaClient.getTag("testMetaSelf", "person") != null);
} catch (Exception e) {
LOGGER.error("test Self signed ssl meta client failed, ", e);
assert (false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ public static String createSpace() {
return exec;
}

public static String createSpaceCa() {
String exec = "CREATE SPACE IF NOT EXISTS testStorageCA(partition_num=10,"
+ "vid_type=fixed_string(8));"
+ "USE testStorageCA;"
+ "CREATE TAG IF NOT EXISTS person(name string, age int);"
+ "CREATE EDGE IF NOT EXISTS friend(likeness double);";
return exec;
}

public static String createSpaceSelf() {
String exec = "CREATE SPACE IF NOT EXISTS testStorageSelf(partition_num=10,"
+ "vid_type=fixed_string(8));"
+ "USE testStorageSelf;"
+ "CREATE TAG IF NOT EXISTS person(name string, age int);"
+ "CREATE EDGE IF NOT EXISTS friend(likeness double);";
return exec;
}

public static String insertData() {
String exec = "INSERT VERTEX person(name, age) VALUES "
+ "\"1\":(\"Tom\", 18), "
Expand Down Expand Up @@ -100,7 +118,7 @@ public static void mockCASslData() {
pool.init(addresses, nebulaPoolConfig);
session = pool.getSession("root", "nebula", true);

ResultSet resp = session.execute(createSpace());
ResultSet resp = session.execute(createSpaceCa());
try {
Thread.sleep(6000);
} catch (InterruptedException e) {
Expand Down Expand Up @@ -140,7 +158,7 @@ public static void mockSelfSslData() {
pool.init(addresses, nebulaPoolConfig);
session = pool.getSession("root", "nebula", true);

ResultSet resp = session.execute(createSpace());
ResultSet resp = session.execute(createSpaceSelf());

try {
Thread.sleep(5000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public void testCASignedSSL() {
sslClient.connect();

ScanVertexResultIterator resultIterator = sslClient.scanVertex(
"testStorage",
"testStorageCA",
"person");
while (resultIterator.hasNext()) {
ScanVertexResult result = null;
Expand Down Expand Up @@ -476,7 +476,7 @@ public void testSelfSignedSSL() {
sslClient.connect();

ScanVertexResultIterator resultIterator = sslClient.scanVertex(
"testStorage",
"testStorageSelf",
"person");
assertIterator(resultIterator);
} catch (Exception e) {
Expand Down

0 comments on commit d2b3bc6

Please sign in to comment.