-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRISOracleFactory.java
More file actions
50 lines (46 loc) · 1.81 KB
/
IRISOracleFactory.java
File metadata and controls
50 lines (46 loc) · 1.81 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
package sqlancer.iris;
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.iris.gen.IRISExpressionGenerator;
import sqlancer.iris.oracle.IRISFuzzer;
// import sqlancer.iris.oracle.IRISPivotedQuerySynthesisOracle;
// import java.sql.SQLException;
public enum IRISOracleFactory implements OracleFactory<IRISGlobalState> {
// PQS {
// @Override
// public TestOracle<IRISGlobalState> create(IRISGlobalState globalState) throws
// SQLException {
// return new IRISPivotedQuerySynthesisOracle(globalState);
// }
// @Override
// public boolean requiresAllTablesToContainRows() {
// return true;
// }
// },
WHERE {
@Override
public TestOracle<IRISGlobalState> create(IRISGlobalState globalState) throws Exception {
IRISExpressionGenerator gen = new IRISExpressionGenerator(globalState);
ExpectedErrors expectedErrors = ExpectedErrors.newErrors().with(IRISErrors.getExpressionErrors()).build();
return new TLPWhereOracle<>(globalState, gen, expectedErrors);
}
},
NOREC {
@Override
public TestOracle<IRISGlobalState> create(IRISGlobalState globalState)
throws Exception {
IRISExpressionGenerator gen = new IRISExpressionGenerator(globalState);
ExpectedErrors errors = ExpectedErrors.newErrors().with(IRISErrors.getExpressionErrors()).build();
return new NoRECOracle<>(globalState, gen, errors);
}
},
FUZZER {
@Override
public TestOracle<IRISGlobalState> create(IRISGlobalState globalState) throws Exception {
return new IRISFuzzer(globalState);
}
}
}