Search in sources :

Example 1 with SerializationPolicyProvider

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);
}
Also used : SerializationPolicy(com.google.gwt.user.server.rpc.SerializationPolicy) SerializationPolicyProvider(com.google.gwt.user.server.rpc.SerializationPolicyProvider)

Example 2 with SerializationPolicyProvider

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;
}
Also used : SerializationPolicyProvider(com.google.gwt.user.server.rpc.SerializationPolicyProvider)

Example 3 with SerializationPolicyProvider

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());
}
Also used : SerializationPolicy(com.google.gwt.user.server.rpc.SerializationPolicy) SerializationPolicyProvider(com.google.gwt.user.server.rpc.SerializationPolicyProvider)

Aggregations

SerializationPolicyProvider (com.google.gwt.user.server.rpc.SerializationPolicyProvider)3 SerializationPolicy (com.google.gwt.user.server.rpc.SerializationPolicy)2