Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timowest authored and johnktims committed Dec 24, 2015
1 parent 7fc4c6b commit 16888d8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions querydsl-sql/src/test/java/com/querydsl/sql/SQLQueryTest.java
@@ -0,0 +1,15 @@
package com.querydsl.sql;

import org.junit.Test;

import com.querydsl.sql.domain.QSurvey;

public class SQLQueryTest {

@Test(expected = IllegalStateException.class)
public void noConnection() {
QSurvey survey = QSurvey.survey;
SQLExpressions.select(survey.id).from(survey).fetch();
}

}
Expand Up @@ -12,6 +12,14 @@

public class SQLDeleteClauseTest {

@Test(expected = IllegalStateException.class)
public void noConnection() {
QEmployee emp1 = new QEmployee("emp1");
SQLDeleteClause delete = new SQLDeleteClause(null, SQLTemplates.DEFAULT, emp1);
delete.where(emp1.id.eq(1));
delete.execute();
}

@Test(expected = IllegalArgumentException.class)
@Ignore
public void error() {
Expand Down
Expand Up @@ -11,6 +11,14 @@

public class SQLInsertClauseTest {

@Test(expected = IllegalStateException.class)
public void noConnection() {
QEmployee emp1 = new QEmployee("emp1");
SQLInsertClause insert = new SQLInsertClause(null, SQLTemplates.DEFAULT, emp1);
insert.set(emp1.id, 1);
insert.execute();
}

@Test
public void getSQL() {
QEmployee emp1 = new QEmployee("emp1");
Expand Down
Expand Up @@ -12,6 +12,14 @@

public class SQLUpdateClauseTest {

@Test(expected = IllegalStateException.class)
public void noConnection() {
QEmployee emp1 = new QEmployee("emp1");
SQLUpdateClause update = new SQLUpdateClause(null, SQLTemplates.DEFAULT, emp1);
update.set(emp1.id, 1);
update.execute();
}

@Test
public void getSQL() {
QEmployee emp1 = new QEmployee("emp1");
Expand Down

0 comments on commit 16888d8

Please sign in to comment.