Skip to content

Commit

Permalink
Remove ExpectedException usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
alesj committed Mar 31, 2014
1 parent 81bccf8 commit a2f7c07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Expand Up @@ -37,10 +37,8 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.test.capedwarf.common.support.All;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;

import static com.google.appengine.api.datastore.Query.FilterOperator.EQUAL;
Expand All @@ -57,10 +55,6 @@
@RunWith(Arquillian.class)
@Category(All.class)
public class PreparedQueryTest extends QueryTestBase {

@Rule
public ExpectedException thrown = ExpectedException.none();

private Entity john;
private PreparedQuery preparedQuery;

Expand Down Expand Up @@ -103,13 +97,11 @@ public void testAsIteratorWithOptions() throws Exception {
assertEquals(john, iterator.next());
}

@Test
@Test(expected = NoSuchElementException.class)
public void testIteratorThrowsNoSuchElementException() throws Exception {
Iterator<Entity> iterator = preparedQuery.asIterator();
iterator.next();
assertFalse(iterator.hasNext());

thrown.expect(NoSuchElementException.class);
iterator.next();
}

Expand Down
Expand Up @@ -52,9 +52,7 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.test.capedwarf.common.support.All;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;

import static com.google.appengine.api.datastore.Query.FilterOperator.GREATER_THAN;
Expand All @@ -73,10 +71,6 @@
@RunWith(Arquillian.class)
@org.junit.experimental.categories.Category(All.class)
public class QueryOptimizationsTest extends QueryTestBase {

@Rule
public ExpectedException thrown = ExpectedException.none();

@Test
public void testKeysOnly() throws Exception {
Entity john = createEntity("Person", 1)
Expand Down Expand Up @@ -429,7 +423,7 @@ private void assertIAEThrownByAsStrictType(RawValue rawValue, Class<?> type) {
}
}

@Test
@Test(expected = IllegalArgumentException.class)
public void testProjectionTypeMismatch() throws Exception {
Entity e = createEntity("foo", 1)
.withProperty("stringProperty", "foo")
Expand All @@ -439,8 +433,6 @@ public void testProjectionTypeMismatch() throws Exception {
.addProjection(new PropertyProjection("stringProperty", Integer.class));

PreparedQuery preparedQuery = service.prepare(query);

thrown.expect(IllegalArgumentException.class);
preparedQuery.asSingleEntity();
}

Expand Down

0 comments on commit a2f7c07

Please sign in to comment.