package sqlancer.arangodb;

import static sqlancer.arangodb.ArangoDBOptions.ArangoDBOracleFactory.QUERY_PARTITIONING;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.beust.jcommander.Parameter;

import sqlancer.DBMSSpecificOptions;
import sqlancer.OracleFactory;
import sqlancer.arangodb.test.ArangoDBQueryPartitioningWhereTester;
import sqlancer.arangodb.ArangoDBProvider.ArangoDBGlobalState;
import sqlancer.common.oracle.CompositeTestOracle;
import sqlancer.common.oracle.TestOracle;

public class ArangoDBOptions implements DBMSSpecificOptions<ArangoDBOptions.ArangoDBOracleFactory> {

    @Parameter(names = "--oracle")
    public List<ArangoDBOracleFactory> oracles = Arrays.asList(QUERY_PARTITIONING);

    @Parameter(names = "--test-random-type-inserts", description = "Insert random types instead of schema types.")
    public boolean testRandomTypeInserts;

    @Parameter(names = "--max-number-indexes", description = "The maximum number of indexes used.", arity = 1)
    public int maxNumberIndexes = 15;

    @Parameter(names = "--with-optimizer-rule-tests", description = "Adds an additional query, where a random set"
            + "of optimizer rules are disabled.", arity = 1)
    public boolean withOptimizerRuleTests;

    @Override
    public List<ArangoDBOracleFactory> getTestOracleFactory() {
        return oracles;
    }

    public enum ArangoDBOracleFactory implements OracleFactory<ArangoDBGlobalState> {
        QUERY_PARTITIONING {
            @Override
            public TestOracle create(ArangoDBGlobalState globalState) throws Exception {
                List<TestOracle> oracles = new ArrayList<>();
                oracles.add(new ArangoDBQueryPartitioningWhereTester(globalState));
                return new CompositeTestOracle(oracles, globalState);
            }
        }
    }
}

@@ -326,21 +326,16 @@
 odb.
-test.
 ArangoDB
 Quer
@@ -334,36 +334,36 @@
 goDB
-QueryPartitioningWhereTes
+Provider.ArangoDBGlobalSta
 te
-r
 ;%0Aim
@@ -381,32 +381,37 @@
 er.arangodb.
+test.
 ArangoDB
 Provider.Ara
@@ -402,36 +402,36 @@
 goDB
-Provider.ArangoDBGlobalSta
+QueryPartitioningWhereTes
 te
+r
 ;%0Aim

reorder import packages