forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestDBOptions.java
More file actions
55 lines (43 loc) · 1.84 KB
/
QuestDBOptions.java
File metadata and controls
55 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package sqlancer.questdb;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.List;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import sqlancer.DBMSSpecificOptions;
import sqlancer.OracleFactory;
import sqlancer.common.oracle.TestOracle;
import sqlancer.questdb.QuestDBOptions.QuestDBOracleFactory;
import sqlancer.questdb.QuestDBProvider.QuestDBGlobalState;
import sqlancer.questdb.test.QuestDBQueryPartitioningWhereTester;
@Parameters(separators = "=", commandDescription = "QuestDB (default port: " + QuestDBOptions.DEFAULT_PORT
+ " default host: " + QuestDBOptions.DEFAULT_HOST + ")")
public class QuestDBOptions implements DBMSSpecificOptions<QuestDBOracleFactory> {
public static final String DEFAULT_HOST = "localhost";
public static final int DEFAULT_PORT = 8812;
@Parameter(names = "--oracle")
public List<QuestDBOracleFactory> oracle = Arrays.asList(QuestDBOracleFactory.WHERE);
public enum QuestDBOracleFactory implements OracleFactory<QuestDBGlobalState> {
// TODO (anxing): implement test oracles
WHERE {
@Override
public TestOracle<QuestDBGlobalState> create(QuestDBGlobalState globalState) throws SQLException {
return new QuestDBQueryPartitioningWhereTester(globalState);
}
}
}
@Parameter(names = "--username", description = "The user name used to log into QuestDB")
private String userName = "admin"; // NOPMD
@Parameter(names = "--password", description = "The password used to log into QuestDB")
private String password = "quest"; // NOPMD
@Override
public List<QuestDBOracleFactory> getTestOracleFactory() {
return oracle;
}
public String getUserName() {
return userName;
}
public String getPassword() {
return password;
}
}