use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class ExpressionEvaluatorTest method shouldReturnTrueIfNotZero.
@Test
public void shouldReturnTrueIfNotZero() {
boolean value = evaluator.evaluateBoolean("id", new Author(1, "cbegin", null, "cbegin@apache.org", "N/A", Section.NEWS));
assertEquals(true, value);
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class ExpressionEvaluatorTest method shouldReturnFalseIfZero.
@Test
public void shouldReturnFalseIfZero() {
boolean value = evaluator.evaluateBoolean("id", new Author(0, "cbegin", null, "cbegin@apache.org", "N/A", Section.NEWS));
assertEquals(false, value);
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class ExpressionEvaluatorTest method shouldReturnFalseIfNull.
@Test
public void shouldReturnFalseIfNull() {
boolean value = evaluator.evaluateBoolean("password", new Author(1, "cbegin", null, "cbegin@apache.org", "N/A", Section.NEWS));
assertEquals(false, value);
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class JavassistProxyTest method shouldCreateAProxyForAPartiallyLoadedBean.
@Test
public void shouldCreateAProxyForAPartiallyLoadedBean() throws Exception {
ResultLoaderMap loader = new ResultLoaderMap();
loader.addLoader("id", null, null);
Object proxy = proxyFactory.createProxy(author, loader, new Configuration(), new DefaultObjectFactory(), new ArrayList<Class<?>>(), new ArrayList<Object>());
Author author2 = (Author) deserialize(serialize((Serializable) proxy));
assertTrue(author2 instanceof Proxy);
}
use of org.apache.ibatis.domain.blog.Author in project mybatis-3 by mybatis.
the class SerializableProxyTest method shouldLetReadALoadedPropertyAfterSerialization.
@Test
public void shouldLetReadALoadedPropertyAfterSerialization() throws Exception {
Object proxy = proxyFactory.createProxy(author, new ResultLoaderMap(), new Configuration(), new DefaultObjectFactory(), new ArrayList<Class<?>>(), new ArrayList<Object>());
byte[] ser = serialize((Serializable) proxy);
Author author2 = (Author) deserialize(ser);
assertEquals(999, author2.getId());
}
Aggregations