Skip to content

Commit

Permalink
remove unwanted test code (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-kharse authored Aug 6, 2024
1 parent c4350f9 commit 201227b
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/test/java/io/dgraph/ExceptionTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package io.dgraph;

import com.google.protobuf.ByteString;
import io.dgraph.DgraphProto.Mutation;
import io.dgraph.DgraphProto.NQuad;
import io.dgraph.DgraphProto.Response;
import io.dgraph.DgraphProto.Value;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -39,42 +37,4 @@ public void testReadOnlyException() {
Transaction txn = dgraphClient.newReadOnlyTransaction();
txn.mutate(mu);
}

@Test
public void testVectorSupport() {
String vect = "[1, 2, 3, 4, 5]";
NQuad quad1 =
NQuad.newBuilder()
.setSubject("0x1000")
.setPredicate("productV")
.setObjectValue(
Value.newBuilder().setVfloat32Val(ByteString.copyFromUtf8(vect)).build())
.build();

System.out.println("quad1: " + quad1.toString());
Mutation mu1 = Mutation.newBuilder().addSet(quad1).build();
Transaction txn = dgraphClient.newTransaction();
Response response1 = txn.mutate(mu1);
System.out.printf("response:---------------------------> " + response1.toString());
try {
txn.commit();
} catch (Exception e) {
System.out.printf("response------------exe: " + e.toString());
}

String query =
"{\n" + " q(func: has(productV)) {\n" + " uid\n" + " productV\n" + " }\n" + "}";

// Create a transaction
Transaction txn1 = dgraphClient.newTransaction();
try {
// Run the query
DgraphProto.Response response = txn1.query(query);

// Print the response JSON
System.out.println(response.getJson().toStringUtf8());
} catch (Exception e) {
System.out.println(e.toString());
}
}
}

0 comments on commit 201227b

Please sign in to comment.