-
Notifications
You must be signed in to change notification settings - Fork 397
Expand file tree
/
Copy pathHSQLDBOracleFactory.java
More file actions
32 lines (28 loc) · 1.32 KB
/
HSQLDBOracleFactory.java
File metadata and controls
32 lines (28 loc) · 1.32 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
package sqlancer.hsqldb;
import java.sql.SQLException;
import sqlancer.OracleFactory;
import sqlancer.common.oracle.NoRECOracle;
import sqlancer.common.oracle.TLPWhereOracle;
import sqlancer.common.oracle.TestOracle;
import sqlancer.common.query.ExpectedErrors;
import sqlancer.hsqldb.gen.HSQLDBExpressionGenerator;
public enum HSQLDBOracleFactory implements OracleFactory<HSQLDBProvider.HSQLDBGlobalState> {
WHERE {
@Override
public TestOracle<HSQLDBProvider.HSQLDBGlobalState> create(HSQLDBProvider.HSQLDBGlobalState globalState)
throws SQLException {
HSQLDBExpressionGenerator gen = new HSQLDBExpressionGenerator(globalState);
ExpectedErrors expectedErrors = ExpectedErrors.newErrors().with(HSQLDBErrors.getExpressionErrors()).build();
return new TLPWhereOracle<>(globalState, gen, expectedErrors);
}
},
NOREC {
@Override
public TestOracle<HSQLDBProvider.HSQLDBGlobalState> create(HSQLDBProvider.HSQLDBGlobalState globalState)
throws Exception {
HSQLDBExpressionGenerator gen = new HSQLDBExpressionGenerator(globalState);
ExpectedErrors errors = ExpectedErrors.newErrors().with(HSQLDBErrors.getExpressionErrors()).build();
return new NoRECOracle<>(globalState, gen, errors);
}
}
}