use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testMultiBinaryColumn.
@Test
public void testMultiBinaryColumn() {
Blob first = mock(Blob.class);
Blob second = mock(Blob.class);
ContentRemoteBinaries binaries = mock(ContentRemoteBinaries.class);
doReturn("first").when(binaries).put(first);
doReturn("second").when(binaries).put(second);
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.BINARIES).when(value).getType();
doReturn(asList(first, second)).when(value).getValue(Type.BINARIES);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(binaries, row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(asList("first", "second"), remoteValue.asMultiBinaryId());
}
use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testBooleanColumn.
@Test
public void testBooleanColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.BOOLEAN).when(value).getType();
doReturn(true).when(value).getValue(Type.BOOLEAN);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(true, remoteValue.asBoolean());
}
Aggregations