use of com.google.gwt.user.server.rpc.SerializationPolicyProvider in project pentaho-platform by pentaho.
the class GwtRpcSerializationPolicyCacheTest method testSerializationPolicyIsNewAndCreated.
// region Helpers
private static void testSerializationPolicyIsNewAndCreated(IGwtRpcSerializationPolicyCache cache, String moduleBaseURL, String strongName, SerializationPolicy policy) {
SerializationPolicyProvider sourceProviderMock = createProviderMock(moduleBaseURL, strongName, policy);
SerializationPolicy result = cache.getSerializationPolicy(moduleBaseURL, strongName, sourceProviderMock);
assertEquals(policy, result);
verify(sourceProviderMock, times(1)).getSerializationPolicy(moduleBaseURL, strongName);
}
use of com.google.gwt.user.server.rpc.SerializationPolicyProvider in project pentaho-platform by pentaho.
the class GwtRpcSerializationPolicyCacheTest method createProviderMock.
private static SerializationPolicyProvider createProviderMock(String moduleBaseURL, String strongName, SerializationPolicy policy) {
SerializationPolicyProvider sourceProviderMock = mock(SerializationPolicyProvider.class);
when(sourceProviderMock.getSerializationPolicy(moduleBaseURL, strongName)).thenReturn(policy);
return sourceProviderMock;
}
use of com.google.gwt.user.server.rpc.SerializationPolicyProvider in project pentaho-platform by pentaho.
the class GwtRpcSerializationPolicyCacheTest method testSerializationPolicyIsInCache.
private static void testSerializationPolicyIsInCache(IGwtRpcSerializationPolicyCache cache, String moduleBaseURL, String strongName, SerializationPolicy policy) {
SerializationPolicyProvider sourceProviderMock = createProviderMock(moduleBaseURL, strongName, policy);
SerializationPolicy result = cache.getSerializationPolicy(moduleBaseURL, strongName, sourceProviderMock);
assertEquals(policy, result);
verify(sourceProviderMock, times(0)).getSerializationPolicy(any(), any());
}
Aggregations