Skip to content

Commit f9d2b6a

Browse files
committed
Edits for better integration testing
1 parent 51f3def commit f9d2b6a

File tree

6 files changed

+61
-10
lines changed

6 files changed

+61
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
2-
* Text and String handling utilties, primarily involving the {@link convex.core.data.Astring} type
2+
* Text and String handling utilities, primarily involving the {@link convex.core.data.AString} type
33
*/
44
package convex.core.text;

convex-integration/src/test/java/convex/java/RemoteRESTClientIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.concurrent.ExecutionException;
1010
import java.util.concurrent.Future;
1111

12-
import org.junit.Assume;
12+
import org.junit.jupiter.api.Assumptions;
1313
import org.junit.jupiter.api.Test;
1414

1515
import convex.core.crypto.AKeyPair;
@@ -111,7 +111,7 @@ public ConvexJSON getNewConvex() {
111111
protected void checkValid(ConvexJSON convex) {
112112
if (convex==null) {
113113
skip=true;
114-
Assume.assumeTrue(false);
114+
Assumptions.assumeTrue(false);
115115
} else {
116116
// OK?
117117
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package convex.live;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertThrows;
5+
6+
import java.net.URI;
7+
import java.net.URISyntaxException;
8+
9+
import org.junit.jupiter.api.Test;
10+
11+
import convex.core.Result;
12+
import convex.core.crypto.AKeyPair;
13+
import convex.core.cvm.Address;
14+
import convex.core.cvm.Keywords;
15+
import convex.core.data.ACell;
16+
import convex.core.data.AMap;
17+
import convex.core.data.AccountKey;
18+
import convex.core.data.Blob;
19+
import convex.core.data.Keyword;
20+
import convex.core.util.JSON;
21+
import convex.core.util.Utils;
22+
import convex.java.ConvexHTTP;
23+
24+
@SuppressWarnings("unused")
25+
public class ConvexLiveIT {
26+
27+
AKeyPair kp=AKeyPair.createSeeded(5657558);
28+
AccountKey key=kp.getAccountKey();
29+
Blob seed = kp.getSeed();
30+
31+
@Test public void testProtonet() throws URISyntaxException, InterruptedException {
32+
ConvexHTTP convex=ConvexHTTP.connect(new URI("https://peer.convex.live"));
33+
34+
// Smoke test query
35+
assertEquals(Address.ZERO,convex.querySync("#0").getValue());
36+
37+
// Create-account should fail here (invalid address)
38+
assertThrows(IllegalArgumentException.class,()->convex.createAccount(key));
39+
40+
}
41+
42+
@Test
43+
public void testProtonetStatus() throws URISyntaxException, InterruptedException {
44+
ConvexHTTP convex=ConvexHTTP.connect(new URI("https://peer.convex.live"));
45+
46+
// TODO: fix status endpoint
47+
Result r = convex.requestStatusSync();
48+
//System.out.println(r+ " : "+Utils.getClassName(r.getValue()));
49+
//AMap<Keyword,ACell> status=JSON.parse(r.getValue());
50+
//assertEquals("0xb0e44f2a645abfa539f5b96b7a0eabb0f902866feaff0f7c12d1213e02333f13",status.get(Keywords.GENESIS));
51+
52+
}
53+
}

convex-java/src/main/java/convex/java/ConvexHTTP.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ public static ConvexHTTP connect(URI uri,Address address, AKeyPair keyPair) {
5757
return new ConvexHTTP(address,keyPair,uri);
5858
}
5959

60+
public static ConvexHTTP connect(URI uri) {
61+
return new ConvexHTTP(null,null,uri);
62+
}
63+
6064

6165
private String getAPIPath() {
6266
int port=uri.getPort();

convex-restapi/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@
6464
<artifactId>convex-core</artifactId>
6565
<version>${convex.version}</version>
6666
</dependency>
67-
<dependency>
68-
<groupId>com.googlecode.json-simple</groupId>
69-
<artifactId>json-simple</artifactId>
70-
<version>${json.simple.version}</version>
71-
</dependency>
7267
<dependency>
7368
<groupId>org.slf4j</groupId>
7469
<artifactId>slf4j-api</artifactId>

convex-restapi/src/main/java/convex/restapi/web/AWebSite.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ protected DomContent makePaginationInfo(long offset, long limit, long total) {
253253
* Build Prev/Next navigation for detail pages with compact info label.
254254
* Example: "Block 3 / 678" next to buttons.
255255
*
256-
* @param ctx Request context
257256
* @param basePath Base path without trailing index (e.g. "/explorer/blocks")
258257
* @param index Current zero-based index
259258
* @param total Total count
@@ -298,7 +297,7 @@ protected static PreTag preCode(DomContent ...content) {
298297

299298
/**
300299
* Format a UNIX timestamp (ms) as UTC like "2025-03-15 18:23:56.345"
301-
* @param tsa Timestamp
300+
* @param ts Timestamp
302301
*/
303302
protected DomContent timestamp(long ts) {
304303
String s=TS_FMT.format(Instant.ofEpochMilli(ts));

0 commit comments

Comments
 (0)