Skip to content

Commit

Permalink
Add Neo4jVersion for 5.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats-SX committed Mar 5, 2024
1 parent 9942caf commit 18ac737
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public final class Neo4jProxyFactoryImpl implements Neo4jProxyFactory {

@Override
public boolean canLoad(Neo4jVersion version) {
return version == Neo4jVersion.V_RC;
return version == Neo4jVersion.V_5_18;
}

@Override
Expand All @@ -39,6 +39,6 @@ public Neo4jProxyApi load() {

@Override
public String description() {
return "Neo4j RC";
return "Neo4j 5.18";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public class InMemoryStorageEngineFactory implements StorageEngineFactory {
static final String IN_MEMORY_STORAGE_ENGINE_NAME = "in-memory-518";

public InMemoryStorageEngineFactory() {
StorageEngineProxyApi.requireNeo4jVersion(Neo4jVersion.V_RC, StorageEngineFactory.class);
StorageEngineProxyApi.requireNeo4jVersion(Neo4jVersion.V_5_18, StorageEngineFactory.class);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class StorageEngineProxyFactoryImpl implements StorageEngineProxyFactory

@Override
public boolean canLoad(Neo4jVersion version) {
return version == Neo4jVersion.V_RC;
return version == Neo4jVersion.V_5_18;
}

@Override
Expand All @@ -39,6 +39,6 @@ public StorageEngineProxyApi load() {

@Override
public String description() {
return "Storage Engine RC";
return "Storage Engine 5.18";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public enum Neo4jVersion {
V_5_15,
V_5_16,
V_5_17,
V_5_18,
V_RC;

private static final int MINOR_DEV_VERSION = 18;
private static final int MINOR_DEV_VERSION = 19;

static Neo4jVersion parse(String version) {
var versionSegments = Pattern.compile("[.-]")
Expand Down Expand Up @@ -76,6 +77,8 @@ static Neo4jVersion parse(String version) {
return Neo4jVersion.V_5_16;
case 17:
return Neo4jVersion.V_5_17;
case 18:
return Neo4jVersion.V_5_18;
default:
if (minorVersion >= MINOR_DEV_VERSION) {
return Neo4jVersion.V_RC;
Expand Down Expand Up @@ -148,6 +151,8 @@ public String toString() {
return "5.16";
case V_5_17:
return "5.17";
case V_5_18:
return "5.18";
case V_RC:
return "dev";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Neo4jVersionTest {
"5.15.0, V_5_15",
"5.16.0, V_5_16",
"5.17.0, V_5_17",
"5.18.0, V_RC",
"5.18.0, V_5_18",
"5.19.0, V_RC",
})
void testParse(String input, Neo4jVersion expected) {
assertEquals(expected.name(), Neo4jVersion.parse(input).name());
Expand Down Expand Up @@ -93,6 +94,7 @@ void shouldNotRespectVersionOverride() {
"5.15.0, 5, 15",
"5.16.0, 5, 16",
"5.17.0, 5, 17",
"5.18.0, 5, 18",
}
)
void semanticVersion(String input, int expectedMajor, int expectedMinor) {
Expand Down
11 changes: 11 additions & 0 deletions proc/sysinfo/src/test/java/org/neo4j/gds/SysInfoProcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class SysInfoProcTest extends BaseProcTest {
"Neo4j 5.17",
"Neo4j 5.17 (placeholder)",

"Neo4j 5.18",
"Neo4j 5.18 (placeholder)",

"Neo4j DEV",
"Neo4j DEV (placeholder)",

Expand Down Expand Up @@ -190,6 +193,14 @@ void testSysInfoProc() throws IOException {
"Neo4j 5.17"
);
break;
case V_5_18:
expectedCompatibilities = Set.of(
"Neo4j Settings 5.x (placeholder)",
"Neo4j Settings 5.x",
"Neo4j 5.18 (placeholder)",
"Neo4j 5.18"
);
break;
case V_RC:
expectedCompatibilities = Set.of(
"Neo4j Settings 5.x",
Expand Down

0 comments on commit 18ac737

Please sign in to comment.