use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testMultiReferenceColumn.
@Test
public void testMultiReferenceColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.REFERENCES).when(value).getType();
doReturn(asList("a", "b")).when(value).getValue(Type.REFERENCES);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(asList("a", "b"), remoteValue.asMultiReference());
}
use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testPathColumn.
@Test
public void testPathColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.PATH).when(value).getType();
doReturn("value").when(value).getValue(Type.PATH);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals("value", remoteValue.asPath());
}
use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testUriColumn.
@Test
public void testUriColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.URI).when(value).getType();
doReturn("value").when(value).getValue(Type.URI);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals("value", remoteValue.asUri());
}
use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testMultiDoubleColumn.
@Test
public void testMultiDoubleColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.DOUBLES).when(value).getType();
doReturn(asList(4.0, 2.0)).when(value).getValue(Type.DOUBLES);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(asList(4.0, 2.0), remoteValue.asMultiDouble());
}
use of org.apache.jackrabbit.oak.api.PropertyValue in project jackrabbit-oak by apache.
the class ContentRemoteResultTest method testMultiWeakReferenceColumn.
@Test
public void testMultiWeakReferenceColumn() {
PropertyValue value = mock(PropertyValue.class);
doReturn(Type.WEAKREFERENCES).when(value).getType();
doReturn(asList("a", "b")).when(value).getValue(Type.WEAKREFERENCES);
ResultRow row = mock(ResultRow.class);
doReturn(value).when(row).getValue("column");
ContentRemoteResult result = createResult(row);
RemoteValue remoteValue = result.getColumnValue("column");
assertEquals(asList("a", "b"), remoteValue.asMultiWeakReference());
}
Aggregations