Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,7 @@ public void testFromSqlUnionSelectOrderbyLimitOffset() {
jacksonHandle.setMimetype("application/json");

JsonNode result = rowManager.resultDoc(plan1, new JacksonHandle()).get();
assertNotNull(result, "result is unexpectedly null.");
JsonNode rows = result.path("rows");

assertEquals(2, rows.size());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 MarkLogic Corporation
* Copyright (c) 2023 MarkLogic Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -106,7 +106,7 @@ public void testFnAbs1Exec() {

@Test
public void testFnAdjustDateTimeToTimezone1Exec() {
executeTester("testFnAdjustDateTimeToTimezone1", p.fn.adjustDateTimeToTimezone(p.col("1")), true, "xs:dateTime", null, null, "2016-01-02T03:09:08-07:00", new ServerExpression[]{ p.xs.dateTime("2016-01-02T10:09:08Z") });
executeTester("testFnAdjustDateTimeToTimezone1", p.fn.adjustDateTimeToTimezone(p.col("1")), true, "xs:dateTime", null, null, "2016-01-02T10:09:08Z", new ServerExpression[]{ p.xs.dateTime("2016-01-02T10:09:08Z") });
}

@Test
Expand All @@ -116,7 +116,7 @@ public void testFnAdjustDateTimeToTimezone2Exec() {

@Test
public void testFnAdjustDateToTimezone1Exec() {
executeTester("testFnAdjustDateToTimezone1", p.fn.adjustDateToTimezone(p.col("1")), true, "xs:date", null, null, "2016-01-02-07:00", new ServerExpression[]{ p.xs.date("2016-01-02") });
executeTester("testFnAdjustDateToTimezone1", p.fn.adjustDateToTimezone(p.col("1")), true, "xs:date", null, null, "2016-01-02Z", new ServerExpression[]{ p.xs.date("2016-01-02") });
}

@Test
Expand All @@ -126,7 +126,7 @@ public void testFnAdjustDateToTimezone2Exec() {

@Test
public void testFnAdjustTimeToTimezone1Exec() {
executeTester("testFnAdjustTimeToTimezone1", p.fn.adjustTimeToTimezone(p.col("1")), true, "xs:time", null, null, "03:09:08-07:00", new ServerExpression[]{ p.xs.time("10:09:08Z") });
executeTester("testFnAdjustTimeToTimezone1", p.fn.adjustTimeToTimezone(p.col("1")), true, "xs:time", null, null, "10:09:08Z", new ServerExpression[]{ p.xs.time("10:09:08Z") });
}

@Test
Expand Down Expand Up @@ -211,17 +211,17 @@ public void testFnCount2Exec() {

@Test
public void testFnCurrentDate0Exec() {
executeTester("testFnCurrentDate0", p.fn.currentDate(), true, "xs:date", null, null, "2024-07-24-07:00", new ServerExpression[]{ });
executeTester("testFnCurrentDate0", p.fn.currentDate(), true, "xs:date", null, null, "2023-10-24Z", new ServerExpression[]{ });
}

@Test
public void testFnCurrentDateTime0Exec() {
executeTester("testFnCurrentDateTime0", p.fn.currentDateTime(), true, "xs:dateTime", null, null, "2024-07-24T12:52:41.506375-07:00", new ServerExpression[]{ });
executeTester("testFnCurrentDateTime0", p.fn.currentDateTime(), true, "xs:dateTime", null, null, "2023-10-24T15:21:06.255777Z", new ServerExpression[]{ });
}

@Test
public void testFnCurrentTime0Exec() {
executeTester("testFnCurrentTime0", p.fn.currentTime(), true, "xs:time", null, null, "12:52:41-07:00", new ServerExpression[]{ });
executeTester("testFnCurrentTime0", p.fn.currentTime(), true, "xs:time", null, null, "15:21:06Z", new ServerExpression[]{ });
}

@Test
Expand Down Expand Up @@ -332,7 +332,7 @@ public void testFnFormatTime2Exec() {
@ExtendWith(RequiresML11OrLower.class)
@Test
public void testFnHead1Exec() {
executeTester("testFnHead1", p.fn.head(p.col("1")), false, null, null, Format.JSON, null, new ServerExpression[]{ p.xs.stringSeq(p.xs.string("a"), p.xs.string("b"), p.xs.string("c")) });
executeTester("testFnHead1", p.fn.head(p.col("1")), false, null, null, null, "a", new ServerExpression[]{ p.xs.stringSeq(p.xs.string("a"), p.xs.string("b"), p.xs.string("c")) });
}

@Test
Expand All @@ -352,7 +352,7 @@ public void testFnHoursFromTime1Exec() {

@Test
public void testFnImplicitTimezone0Exec() {
executeTester("testFnImplicitTimezone0", p.fn.implicitTimezone(), true, "xs:dayTimeDuration", null, null, "-PT7H", new ServerExpression[]{ });
executeTester("testFnImplicitTimezone0", p.fn.implicitTimezone(), true, "xs:dayTimeDuration", null, null, "PT0S", new ServerExpression[]{ });
}

@Test
Expand All @@ -377,7 +377,7 @@ public void testFnIriToUri1Exec() {

@Test
public void testFnLocalNameFromQName1Exec() {
executeTester("testFnLocalNameFromQName1", p.fn.localNameFromQName(p.col("1")), false, null, null, null, "abc", new ServerExpression[]{ p.xs.QName("abc") });
executeTester("testFnLocalNameFromQName1", p.fn.localNameFromQName(p.col("1")), false, "xs:NCName", null, null, "abc", new ServerExpression[]{ p.xs.QName("abc") });
}

@Test
Expand Down Expand Up @@ -478,7 +478,7 @@ public void testFnNumber1Exec() {
@ExtendWith(RequiresML11OrLower.class)
@Test
public void testFnPrefixFromQName1Exec() {
executeTester("testFnPrefixFromQName1", p.fn.prefixFromQName(p.col("1")), false, null, null, null, "", new ServerExpression[]{ p.xs.QName("abc") });
executeTester("testFnPrefixFromQName1", p.fn.prefixFromQName(p.col("1")), false, null, null, Format.JSON, null, new ServerExpression[]{ p.xs.QName("abc") });
}

@Test
Expand Down Expand Up @@ -734,7 +734,7 @@ public void testGeoEllipsePolygon6Exec() {
@Test
@ExtendWith(RequiresML11.class)
public void testGeoGeohashDecode1Exec() {
executeTester("testGeoGeohashDecode1", p.geo.geohashDecode(p.col("1")), false, "cts:box", null, null, "[-90, -180, 90, 180]", new ServerExpression[]{ p.xs.string("abc") });
executeTester("testGeoGeohashDecode1", p.geo.geohashDecode(p.col("1")), false, "cts:box", null, null, "[-90, -180, 90, 180]", new ServerExpression[]{p.xs.string("abc")});
}

@Test
Expand All @@ -744,7 +744,7 @@ public void testGeoGeohashDecodePoint1Exec() {

@Test
public void testGeoGeohashNeighbors1Exec() {
executeTester("testGeoGeohashNeighbors1", p.geo.geohashNeighbors(p.col("1")), false, null, null, Format.JSON, "{\"NE\":\"s01mtz\", \"S\":\"s01mtt\", \"E\":\"s01mty\", \"W\":\"s01mtq\", \"SW\":\"s01mtm\", \"N\":\"s01mtx\", \"SE\":\"s01mtv\", \"NW\":\"s01mtr\"}", new ServerExpression[]{ p.xs.string("s01mtw") });
executeTester("testGeoGeohashNeighbors1", p.geo.geohashNeighbors(p.col("1")), false, null, null, Format.JSON, "{\"NE\":\"s01mtz\", \"S\":\"s01mtt\", \"E\":\"s01mty\", \"W\":\"s01mtq\", \"N\":\"s01mtx\", \"SW\":\"s01mtm\", \"SE\":\"s01mtv\", \"NW\":\"s01mtr\"}", new ServerExpression[]{ p.xs.string("s01mtw") });
}

@Test
Expand Down Expand Up @@ -1011,7 +1011,7 @@ public void testRdfLangStringLanguage1Exec() {

@Test
public void testSemBnode0Exec() {
executeTester("testSemBnode0", p.sem.bnode(), true, "sem:blank", null, null, "_:bnode8347318410939529127", new ServerExpression[]{ });
executeTester("testSemBnode0", p.sem.bnode(), true, "sem:blank", null, null, "_:bnode801272998575329659", new ServerExpression[]{ });
}

@Test
Expand Down Expand Up @@ -1046,7 +1046,7 @@ public void testSemInvalid2Exec() {

@Test
public void testSemIri1Exec() {
executeTester("testSemIri1", p.sem.iri(p.col("1")), false, "sem:iri", null, null, "http://a/b", new ServerExpression[]{ p.xs.string("http://a/b") });
executeTester("testSemIri1", p.sem.iri(p.col("1")), false, null, null, null, "http://a/b", new ServerExpression[]{ p.xs.string("http://a/b") });
}

@Test
Expand Down Expand Up @@ -1091,7 +1091,7 @@ public void testSemQNameToIri1Exec() {

@Test
public void testSemRandom0Exec() {
executeTester("testSemRandom0", p.sem.random(), true, null, null, null, "0.877559767806847", new ServerExpression[]{ });
executeTester("testSemRandom0", p.sem.random(), true, null, null, null, "0.996817928554708", new ServerExpression[]{ });
}

@Test
Expand All @@ -1116,12 +1116,12 @@ public void testSemUnknown2Exec() {

@Test
public void testSemUuid0Exec() {
executeTester("testSemUuid0", p.sem.uuid(), true, "sem:iri", null, null, "urn:uuid:7f6d7218-3a58-4315-ad88-ca0083d2183c", new ServerExpression[]{ });
executeTester("testSemUuid0", p.sem.uuid(), true, "sem:iri", null, null, "urn:uuid:c04549cf-e759-4190-bb96-8a0efaa4fcff", new ServerExpression[]{ });
}

@Test
public void testSemUuidString0Exec() {
executeTester("testSemUuidString0", p.sem.uuidString(), true, null, null, null, "8f364842-402f-4acf-bcc3-3148abf812c5", new ServerExpression[]{ });
executeTester("testSemUuidString0", p.sem.uuidString(), true, null, null, null, "32351923-7f22-4a3f-9e92-884151190ee8", new ServerExpression[]{ });
}

@Test
Expand Down Expand Up @@ -1256,7 +1256,7 @@ public void testSqlQuarter1Exec() {

@Test
public void testSqlRand1Exec() {
executeTester("testSqlRand1", p.sql.rand(p.col("1")), true, "xs:unsignedLong", null, null, "10013855825609952141", new ServerExpression[]{ p.xs.unsignedLong(1) });
executeTester("testSqlRand1", p.sql.rand(p.col("1")), true, "xs:unsignedLong", null, null, "1308547733197903283", new ServerExpression[]{ p.xs.unsignedLong(1) });
}

@Test
Expand Down Expand Up @@ -1361,7 +1361,7 @@ public void testXdmpCrypt2Exec() {

@Test
public void testXdmpCrypt21Exec() {
executeTester("testXdmpCrypt21", p.xdmp.crypt2(p.col("1")), true, null, null, null, "$256$UY3SnW6XAL..km7Iaiv/f1$256$fa8YOAkETMWtAaJf", new ServerExpression[]{ p.xs.string("abc") });
executeTester("testXdmpCrypt21", p.xdmp.crypt2(p.col("1")), true, null, null, null, "$256$Byph9.Mc3xqzhgeH.IAJh/$256$nAr3j1jWo/Wf2yN7", new ServerExpression[]{ p.xs.string("abc") });
}

@Test
Expand Down Expand Up @@ -1561,12 +1561,12 @@ public void testXdmpOr642Exec() {

@Test
public void testXdmpParseDateTime2Exec() {
executeTester("testXdmpParseDateTime2", p.xdmp.parseDateTime(p.col("1"), p.col("2")), true, "xs:dateTime", null, null, "2016-01-06T18:13:50.873-07:00", new ServerExpression[]{ p.xs.string("[Y0001]-[M01]-[D01]T[h01]:[m01]:[s01].[f1][Z]"), p.xs.string("2016-01-06T17:13:50.873594-08:00") });
executeTester("testXdmpParseDateTime2", p.xdmp.parseDateTime(p.col("1"), p.col("2")), true, "xs:dateTime", null, null, "2016-01-07T01:13:50.873Z", new ServerExpression[]{ p.xs.string("[Y0001]-[M01]-[D01]T[h01]:[m01]:[s01].[f1][Z]"), p.xs.string("2016-01-06T17:13:50.873594-08:00") });
}

@Test
public void testXdmpParseYymmdd2Exec() {
executeTester("testXdmpParseYymmdd2", p.xdmp.parseYymmdd(p.col("1"), p.col("2")), true, "xs:dateTime", null, null, "2016-01-06T18:13:50.873-07:00", new ServerExpression[]{ p.xs.string("yyyy-MM-ddThh:mm:ss.Sz"), p.xs.string("2016-01-06T17:13:50.873594-8.00") });
executeTester("testXdmpParseYymmdd2", p.xdmp.parseYymmdd(p.col("1"), p.col("2")), true, "xs:dateTime", null, null, "2016-01-07T01:13:50.873Z", new ServerExpression[]{ p.xs.string("yyyy-MM-ddThh:mm:ss.Sz"), p.xs.string("2016-01-06T17:13:50.873594-8.00") });
}

@Test
Expand All @@ -1591,12 +1591,12 @@ public void testXdmpQuarterFromDate1Exec() {

@Test
public void testXdmpRandom0Exec() {
executeTester("testXdmpRandom0", p.xdmp.random(), true, "xs:unsignedLong", null, null, "5081519083065291336", new ServerExpression[]{ });
executeTester("testXdmpRandom0", p.xdmp.random(), true, "xs:unsignedLong", null, null, "7692759001122562087", new ServerExpression[]{ });
}

@Test
public void testXdmpRandom1Exec() {
executeTester("testXdmpRandom1", p.xdmp.random(p.col("1")), true, null, null, null, "1", new ServerExpression[]{ p.xs.unsignedLong(1) });
executeTester("testXdmpRandom1", p.xdmp.random(p.col("1")), true, null, null, null, "0", new ServerExpression[]{ p.xs.unsignedLong(1) });
}

@Test
Expand Down Expand Up @@ -1656,12 +1656,12 @@ public void testXdmpStep642Exec() {

@Test
public void testXdmpStrftime2Exec() {
executeTester("testXdmpStrftime2", p.xdmp.strftime(p.col("1"), p.col("2")), true, null, null, null, "Wed, 06 Jan 2016 17:13:50", new ServerExpression[]{ p.xs.string("%a, %d %b %Y %H:%M:%S"), p.xs.dateTime("2016-01-06T17:13:50.873594-08:00") });
executeTester("testXdmpStrftime2", p.xdmp.strftime(p.col("1"), p.col("2")), true, null, null, null, "Thu, 07 Jan 2016 01:13:50", new ServerExpression[]{ p.xs.string("%a, %d %b %Y %H:%M:%S"), p.xs.dateTime("2016-01-06T17:13:50.873594-08:00") });
}

@Test
public void testXdmpTimestampToWallclock1Exec() {
executeTester("testXdmpTimestampToWallclock1", p.xdmp.timestampToWallclock(p.col("1")), true, "xs:dateTime", null, null, "1969-12-31T16:00:00.0000001", new ServerExpression[]{ p.xs.unsignedLong(1) });
executeTester("testXdmpTimestampToWallclock1", p.xdmp.timestampToWallclock(p.col("1")), true, "xs:dateTime", null, null, "1970-01-01T00:00:00.0000001", new ServerExpression[]{ p.xs.unsignedLong(1) });
}

@Test
Expand All @@ -1672,7 +1672,7 @@ public void testXdmpType1Exec() {
@Test
@ExtendWith(RequiresML11.class)
public void testXdmpUnquote1Exec() {
executeTester("testXdmpUnquote1", p.xdmp.unquote(p.col("1")), false, null, "array", Format.JSON, "[123]", new ServerExpression[]{ p.xs.string("[123]") });
executeTester("testXdmpUnquote1", p.xdmp.unquote(p.col("1")), false, null, "array", Format.JSON, "[123]", new ServerExpression[]{p.xs.string("[123]")});
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ void joinDocAndUri() {
@ExtendWith(RequiresML12.class)
void documentRootQuery() {
List<RowRecord> rows = resultRows(op
.fromDocUris(op.cts.documentRootQuery("suggest"))
.fromDocUris(op.cts.documentRootQuery("musician"))
);

assertEquals(2, rows.size());
assertEquals("/sample/suggestion.xml", ((TextNode) rows.get(0).get("uri")).asText());
assertEquals("/sample2/suggestion.xml", ((TextNode) rows.get(1).get("uri")).asText());
assertEquals(4, rows.size());
}

@Test
Expand Down