use of com.orm.androrm.statement.AndStatement in project androrm by androrm.
the class AndStatementTest method testGetKey.
public void testGetKey() {
AndStatement and = new AndStatement(new Statement("foo", "bar"), new Statement("bar", "baz"));
Set<String> keys = and.getKeys();
assertEquals(2, keys.size());
assertTrue(keys.contains("foo"));
assertTrue(keys.contains("bar"));
}
use of com.orm.androrm.statement.AndStatement in project androrm by androrm.
the class AndStatementTest method testSimpleAnd.
public void testSimpleAnd() {
Statement left = new Statement("foo", "bar");
Statement right = new Statement("bar", "baz");
AndStatement and = new AndStatement(left, right);
assertEquals("foo = 'bar' AND bar = 'baz'", and.toString());
}
use of com.orm.androrm.statement.AndStatement in project androrm by androrm.
the class OrStatementTest method testParanthesis.
public void testParanthesis() {
OrStatement left = new OrStatement(new Statement("foo", "bar"), new Statement("bar", "baz"));
OrStatement right = new OrStatement(new Statement("baz", "foo"), new LikeStatement("baz", "bar"));
AndStatement and = new AndStatement(left, right);
assertEquals("(foo = 'bar' OR bar = 'baz') AND (baz = 'foo' OR baz LIKE '%bar%')", and.toString());
}
use of com.orm.androrm.statement.AndStatement in project androrm by androrm.
the class OrStatementTest method testParanthesisSurrounding.
public void testParanthesisSurrounding() {
AndStatement left = new AndStatement(new Statement("foo", "bar"), new Statement("bar", "baz"));
AndStatement right = new AndStatement(new Statement("baz", "foo"), new LikeStatement("baz", "bar"));
OrStatement or = new OrStatement(left, right);
assertEquals("(foo = 'bar' AND bar = 'baz' OR baz = 'foo' AND baz LIKE '%bar%')", or.toString());
}
Aggregations