use of edu.stanford.bmir.protege.web.client.primitive.PrimitiveDataParserImpl in project webprotege by protegeproject.
the class PrimitiveDataParserImpl_LiteralParsing_TestCase method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() {
primitiveTypes = Sets.newHashSet();
primitiveTypes.add(PrimitiveType.LITERAL);
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
AsyncCallback<Optional<OWLEntityData>> callback = (AsyncCallback<Optional<OWLEntityData>>) invocationOnMock.getArguments()[2];
callback.onSuccess(Optional.empty());
return null;
}
}).when(lookupHandler).lookupEntity(any(String.class), any(Set.class), any(AsyncCallback.class));
parser = new PrimitiveDataParserImpl(lookupHandler);
}
use of edu.stanford.bmir.protege.web.client.primitive.PrimitiveDataParserImpl in project webprotege by protegeproject.
the class PrimitiveDataParserImpl_EntityParsing_TestCase method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() {
primitiveTypes = Sets.newHashSet();
lookupMap = Maps.newHashMap();
doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
AsyncCallback<Optional<OWLEntityData>> callback = (AsyncCallback<Optional<OWLEntityData>>) invocationOnMock.getArguments()[2];
callback.onSuccess(Optional.of(lookupMap.get(invocationOnMock.getArguments()[0])));
return null;
}
}).when(lookupHandler).lookupEntity(any(String.class), any(Set.class), any(AsyncCallback.class));
parser = new PrimitiveDataParserImpl(lookupHandler);
}
Aggregations