// Path: dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/sql/SqlCompileable.java
// public interface SqlCompileable {
// 
//   class CompileableStatement {
//     public String sql;
//     public Set<String> tables;
// 
//     public CompileableStatement(String sql, Set<String> tables) {
//       this.sql = sql;
//       this.tables = tables;
//     }
//   }
// 
//   CompileableStatement asCompileableStatement();
// }
// 
// Path: dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/sql/SqlFinishedStatement.java
// public interface SqlFinishedStatement extends SqlCompileable {
// 
// }


import com.hannesdorfmann.sqlbrite.dao.sql.SqlCompileable;
import com.hannesdorfmann.sqlbrite.dao.sql.SqlFinishedStatement;
import com.squareup.sqlbrite.BriteDatabase;
import com.squareup.sqlbrite.QueryObservable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import junit.framework.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
    Assert.assertEquals(argsList, varArgs.getAllValues());
  }

  @Test public void runRawStatementQueryNoTablesSpecified() {
    BriteDatabase db = PowerMockito.mock(BriteDatabase.class);
    userDao.setSqlBriteDb(db);

    String arg1 = "arg1", arg2 = "arg2";
    String table = "Table";
    String sql = "SELECT * FROM " + table;
    List<String> argsList = Arrays.asList(arg1, arg2);
    Set<String> emptySet = Collections.emptySet();

    userDao.rawQuery(sql).args(arg1, arg2).run();

    ArgumentCaptor<String> varArgs = ArgumentCaptor.forClass(String.class);

    QueryObservable query = Mockito.verify(db, Mockito.times(1))
        .createQuery(Mockito.eq(emptySet), Mockito.eq(sql), varArgs.capture());

    Assert.assertEquals(argsList, varArgs.getAllValues());
  }

  @Test public void runRawStatementQueryWithTables() {
    BriteDatabase db = PowerMockito.mock(BriteDatabase.class);
    userDao.setSqlBriteDb(db);

    String arg1 = "arg1", arg2 = "arg2";
    String table = "Table";
    String sql = "SELECT * FROM " + table;
// Path: dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/sql/SqlCompileable.java
// public interface SqlCompileable {
// 
//   class CompileableStatement {
//     public String sql;
//     public Set<String> tables;
// 
//     public CompileableStatement(String sql, Set<String> tables) {
//       this.sql = sql;
//       this.tables = tables;
//     }
//   }
// 
//   CompileableStatement asCompileableStatement();
// }
// 
// Path: dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/sql/SqlFinishedStatement.java
// public interface SqlFinishedStatement extends SqlCompileable {
// 
// }


// Path: dao/src/test/java/com/hannesdorfmann/sqlbrite/dao/DaoSqlBriteIntegrationTest.java
import com.hannesdorfmann.sqlbrite.dao.sql.SqlCompileable;
import com.hannesdorfmann.sqlbrite.dao.sql.SqlFinishedStatement;
import com.squareup.sqlbrite.BriteDatabase;
import com.squareup.sqlbrite.QueryObservable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import junit.framework.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

    Assert.assertEquals(argsList, varArgs.getAllValues());
  }

  @Test public void runRawStatementQueryNoTablesSpecified() {
    BriteDatabase db = PowerMockito.mock(BriteDatabase.class);
    userDao.setSqlBriteDb(db);

    String arg1 = "arg1", arg2 = "arg2";
    String table = "Table";
    String sql = "SELECT * FROM " + table;
    List<String> argsList = Arrays.asList(arg1, arg2);
    Set<String> emptySet = Collections.emptySet();

    userDao.rawQuery(sql).args(arg1, arg2).run();

    ArgumentCaptor<String> varArgs = ArgumentCaptor.forClass(String.class);

    QueryObservable query = Mockito.verify(db, Mockito.times(1))
        .createQuery(Mockito.eq(emptySet), Mockito.eq(sql), varArgs.capture());

    Assert.assertEquals(argsList, varArgs.getAllValues());
  }

  @Test public void runRawStatementQueryWithTables() {
    BriteDatabase db = PowerMockito.mock(BriteDatabase.class);
    userDao.setSqlBriteDb(db);

    String arg1 = "arg1", arg2 = "arg2";
    String table = "Table";
    String sql = "SELECT * FROM " + table;
    List<String> argsList = Arrays.asList(arg1, arg2);