Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix test and migrate pom to Central #75

Merged
merged 2 commits into from
Oct 14, 2024
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
52 changes: 20 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>org.sonatype.oss</groupId>
Expand All @@ -12,7 +11,7 @@
<packaging>jar</packaging>
<groupId>com.falkordb</groupId>
<artifactId>jfalkordb</artifactId>
<version>0.3.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>

<name>JFalkorDB</name>
<description>Official client for falkordb</description>
Expand Down Expand Up @@ -50,9 +49,9 @@
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.11.0</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -66,36 +65,25 @@
<version>2.0.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencies>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.test.source>8</maven.test.source>
<maven.test.target>8</maven.test.target>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand All @@ -118,14 +106,14 @@
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.6.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>
</plugins>
Expand All @@ -139,7 +127,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -152,7 +140,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
34 changes: 23 additions & 11 deletions src/test/java/com/falkordb/GraphAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public void testRecord() {
+ "doubleValue=Property{name='doubleValue', value=3.14}, "
+ "age=Property{name='age', value=32}}}",
expectedNode.toString());
Assert.assertEquals( 4, expectedNode.getNumberOfProperties());
Assert.assertEquals(4, expectedNode.getNumberOfProperties());

Edge expectedEdge = new Edge();
expectedEdge.setId(0);
Expand All @@ -238,7 +238,7 @@ public void testRecord() {
+ "place=Property{name='place', value=TLV}, "
+ "doubleValue=Property{name='doubleValue', value=3.14}, "
+ "since=Property{name='since', value=2000}}}", expectedEdge.toString());
Assert.assertEquals( 4, expectedEdge.getNumberOfProperties());
Assert.assertEquals(4, expectedEdge.getNumberOfProperties());

Map<String, Object> params = new HashMap<>();
params.put("name", name);
Expand Down Expand Up @@ -799,16 +799,28 @@ public void test64bitnumber() {
}

@Test
public void testVecf32() {
public void testVecf32() {
ResultSet resultSet = client.query("RETURN vecf32([2.1, -0.82, 1.3, 4.5]) AS vector");
Assert.assertEquals(1, resultSet.size());
Record r = resultSet.iterator().next();
List<Float> vector = r.getValue(0);
List<Object> vector = r.getValue(0);
Assert.assertEquals(4, vector.size());
Assert.assertEquals(2.1f, vector.get(0), 0.01);
Assert.assertEquals(-0.82f, vector.get(1), 0.01);
Assert.assertEquals(1.3f, vector.get(2), 0.01);
Assert.assertEquals(4.5f, vector.get(3), 0.01);
Object res = vector.get(0);

// The result can be either Double or Float depending on the server version
if ( res instanceof Double) {
List<Double> v = r.getValue(0);
Assert.assertEquals(2.1, v.get(0), 0.01);
Assert.assertEquals(-0.82, v.get(1), 0.01);
Assert.assertEquals(1.3, v.get(2), 0.01);
Assert.assertEquals(4.5, v.get(3), 0.01);
} else {
List<Float> v = r.getValue(0);
Assert.assertEquals(2.1f, v.get(0), 0.01);
Assert.assertEquals(-0.82f, v.get(1), 0.01);
Assert.assertEquals(1.3f, v.get(2), 0.01);
Assert.assertEquals(4.5f, v.get(3), 0.01);
}
}

@Test
Expand Down Expand Up @@ -886,7 +898,7 @@ private void assertTestGeoPoint() {
Assert.assertEquals(Collections.singletonList("restaurant"), record.keys());
Node node = record.getValue(0);
Property<?> property = node.getProperty("location");
Point result = (Point)property.getValue();
Point result = (Point) property.getValue();

Point point = new Point(30.27822306, -97.75134723);
Assert.assertEquals(point, result);
Expand Down Expand Up @@ -942,8 +954,8 @@ public void testSimpleReadOnlyWithTimeOut() {
client.query("CREATE (:person{name:'filipe',age:30})");
try {
client.readOnlyQuery(
"WITH 1000000 as n RETURN reduce(f = 1, x IN range(1, n) | f * x) AS result",
1L);
"WITH 1000000 as n RETURN reduce(f = 1, x IN range(1, n) | f * x) AS result",
1L);

fail("Expected Timeout Exception was not thrown.");
} catch (GraphException e) {
Expand Down