Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adnan Ahmad
YCSB
Commits
1aa8c33b
Commit
1aa8c33b
authored
9 years ago
by
Muhammed Uluyol
Browse files
Options
Downloads
Patches
Plain Diff
[cassandra2] Only test on Java 8+
parent
0965558a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java
+15
-10
15 additions, 10 deletions
...c/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java
with
15 additions
and
10 deletions
cassandra2/src/test/java/com/yahoo/ycsb/db/CassandraCQLClientTest.java
+
15
−
10
View file @
1aa8c33b
...
...
@@ -41,6 +41,7 @@ import com.yahoo.ycsb.workloads.CoreWorkload;
import
org.cassandraunit.CassandraCQLUnit
;
import
org.cassandraunit.dataset.cql.ClassPathCQLDataSet
;
import
org.junit.After
;
import
org.junit.Assume
;
import
org.junit.Before
;
import
org.junit.ClassRule
;
import
org.junit.Test
;
...
...
@@ -63,11 +64,16 @@ public class CassandraCQLClientTest {
private
Session
session
;
@ClassRule
public
static
CassandraCQLUnit
cassandraUnit
=
new
CassandraCQLUnit
(
new
ClassPathCQLDataSet
(
"ycsb.cql"
,
"ycsb"
));
public
static
CassandraCQLUnit
cassandraUnit
=
new
CassandraCQLUnit
(
new
ClassPathCQLDataSet
(
"ycsb.cql"
,
"ycsb"
));
@Before
public
void
setUpClient
()
throws
Exception
{
public
void
setUp
()
throws
Exception
{
// check that this is Java 8+
int
javaVersion
=
Integer
.
parseInt
(
System
.
getProperty
(
"java.version"
).
split
(
"\\."
)[
1
]);
Assume
.
assumeTrue
(
javaVersion
>=
8
);
session
=
cassandraUnit
.
getSession
();
Properties
p
=
new
Properties
();
p
.
setProperty
(
"hosts"
,
HOST
);
p
.
setProperty
(
"port"
,
Integer
.
toString
(
PORT
));
...
...
@@ -81,14 +87,11 @@ public class CassandraCQLClientTest {
client
.
init
();
}
@Before
public
void
setSession
()
{
session
=
cassandraUnit
.
getSession
();
}
@After
public
void
tearDownClient
()
throws
Exception
{
client
.
cleanup
();
if
(
client
!=
null
)
{
client
.
cleanup
();
}
client
=
null
;
}
...
...
@@ -96,7 +99,9 @@ public class CassandraCQLClientTest {
public
void
clearTable
()
throws
Exception
{
// Clear the table so that each test starts fresh.
final
Statement
truncate
=
QueryBuilder
.
truncate
(
TABLE
);
cassandraUnit
.
getSession
().
execute
(
truncate
);
if
(
cassandraUnit
!=
null
)
{
cassandraUnit
.
getSession
().
execute
(
truncate
);
}
}
@Test
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment