Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Update Versions for trunk as 4.1 and new release branch cassandra-4.0
Includes VersionsTest, version regexp fix, and handling non-existant build directory. patch by Mick Semb Wever; reviewed by Alex Petrov for CASSANDRA-16649
- Loading branch information
1 parent
d5174b1
commit 8b17c8dfe3fa0d062af1e861b8b204c7bbeb275b
Showing
4 changed files
with
117 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -79,3 +79,4 @@ doc/source/tools/nodetool | ||
|
||
# Python virtual environment | ||
venv/ | ||
/nbproject/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,95 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.cassandra.distributed.shared; | ||
|
||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class VersionsTest | ||
{ | ||
public static final String[] VERSIONS = new String[] | ||
{ | ||
"2.2.12", | ||
"2.2.2", | ||
"3.0.0", | ||
"3.0.10", | ||
"3.11.10", | ||
"3.11.9", | ||
"4.0-alpha1", | ||
"4.0-beta1", | ||
"4.0-rc1", | ||
"4.0.0", | ||
"4.1.0" | ||
}; | ||
|
||
@BeforeAll | ||
public static void beforeAll() throws IOException | ||
{ | ||
Path root = Files.createTempDirectory("versions"); | ||
System.setProperty(Versions.PROPERTY_PREFIX + "test.dtest_jar_path", root.toAbsolutePath().toString()); | ||
|
||
for (String version : VERSIONS) | ||
Files.createFile(Paths.get(root.toAbsolutePath().toString(), "dtest-" + version + ".jar")); | ||
} | ||
|
||
@AfterAll | ||
public static void afterAll() throws IOException | ||
{ | ||
System.clearProperty(Versions.PROPERTY_PREFIX + "test.dtest_jar_path"); | ||
} | ||
|
||
@Test | ||
public void testVersions() throws IOException | ||
{ | ||
Versions versions = Versions.find(); | ||
for (String version : VERSIONS) | ||
assertThat(versions.get(version)).isNotNull(); | ||
} | ||
|
||
@Test | ||
public void testGet() | ||
{ | ||
assertThat(Versions.find().get("2.2.2")).isNotNull(); | ||
} | ||
|
||
@Test | ||
public void testGetLatest() | ||
{ | ||
Versions.find().getLatest(Versions.Major.v22); | ||
} | ||
|
||
@Test | ||
public void testFind() | ||
{ | ||
Versions versions = Versions.find(); | ||
assertThat(versions).isNotNull(); | ||
|
||
} | ||
|
||
@Test | ||
public void testToURL() | ||
{ | ||
assertThat(Versions.getClassPath()).isNotEmpty(); | ||
} | ||
|
||
} |