Skip to content

Commit

Permalink
added version enum
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalr1neo committed Apr 15, 2024
1 parent 6ca575b commit 3684c82
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 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_Dev;
return version == Neo4jVersion.V_5_19;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public enum Neo4jVersion {
V_5_16,
V_5_17,
V_5_18,
V_5_19,
V_Dev;

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

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_17;
case 18:
return Neo4jVersion.V_5_18;
case 19:
return Neo4jVersion.V_5_19;
default:
if (minorVersion >= MINOR_DEV_VERSION) {
return Neo4jVersion.V_Dev;
Expand Down Expand Up @@ -148,6 +151,8 @@ public String toString() {
return "5.17";
case V_5_18:
return "5.18";
case V_5_19:
return "5.19";
case V_Dev:
return "dev";
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class Neo4jVersionTest {
"5.16.0, V_5_16",
"5.17.0, V_5_17",
"5.18.1, V_5_18",
"5.19.0, V_Dev",
"5.19.0, V_5_19",
"5.20.0, V_Dev",
})
void testParse(String input, Neo4jVersion expected) {
assertEquals(expected.name(), Neo4jVersion.parse(input).name());
Expand Down Expand Up @@ -95,6 +96,7 @@ void shouldNotRespectVersionOverride() {
"5.16.0, 5, 16",
"5.17.0, 5, 17",
"5.18.1, 5, 18",
"5.19.0, 5, 19",
}
)
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.18",
"Neo4j 5.18 (placeholder)",

"Neo4j 5.19",
"Neo4j 5.19 (placeholder)",

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

Expand Down Expand Up @@ -195,6 +198,14 @@ void testSysInfoProc() throws IOException {
"Neo4j 5.18"
);
break;
case V_5_19:
expectedCompatibilities = Set.of(
"Neo4j Settings 5.x (placeholder)",
"Neo4j Settings 5.x",
"Neo4j 5.19 (placeholder)",
"Neo4j 5.19"
);
break;
case V_Dev:
expectedCompatibilities = Set.of(
"Neo4j Settings 5.x",
Expand Down

0 comments on commit 3684c82

Please sign in to comment.