Package com.google.gwt.user.client.rpc

Examples of com.google.gwt.user.client.rpc.SerializationStreamFactory


    this.channelKey = channelKey;
    channelListeners = new ArrayList<ChannelListener>();
  }

  private void onMessage(String encoded) {
    SerializationStreamFactory ssf = GWT.create(ChannelService.class);
    try {
      Message message = (Message) ssf.createStreamReader(encoded)
          .readObject();
      for (int i = 0; i < channelListeners.size(); i++) {
        channelListeners.get(i).onReceive(message);
      }
    } catch (SerializationException e) {
View Full Code Here


        return theRootPanelMock;
    }

    private static SerializationStreamFactory mockInitSerializationStreamFactory(SerializationStreamReader aSerializationStreamReader, String aSerializedEvent) throws Exception {
        SerializationStreamFactory theSerializationStreamFactoryMock = mock(SerializationStreamFactory.class);
        when(theSerializationStreamFactoryMock.createStreamReader(aSerializedEvent)).thenReturn(aSerializationStreamReader);

        PowerMockito.mockStatic(GWT.class);
        when(GWT.create(EventService.class)).thenReturn(theSerializationStreamFactoryMock);

        return theSerializationStreamFactoryMock;
View Full Code Here

        return theRootPanelMock;
    }

    private static SerializationStreamFactory mockInitSerializationStreamFactory(SerializationStreamReader aSerializationStreamReader, String aSerializedEvent) throws Exception {
        SerializationStreamFactory theSerializationStreamFactoryMock = mock(SerializationStreamFactory.class);
        when(theSerializationStreamFactoryMock.createStreamReader(aSerializedEvent)).thenReturn(aSerializationStreamReader);

        PowerMockito.mockStatic(GWT.class);
        when(GWT.create(EventService.class)).thenReturn(theSerializationStreamFactoryMock);

        return theSerializationStreamFactoryMock;
View Full Code Here

     * @param anEvent event to de-serialize
     * @return de-serialized event
     */
    protected DomainEvent deserializeEvent(String anEvent) {
        try {
            SerializationStreamFactory theSerializationStreamFactory = GWT.create(EventService.class);
            SerializationStreamReader theSerializationStreamReader = theSerializationStreamFactory.createStreamReader(anEvent);
            return (DomainEvent)theSerializationStreamReader.readObject();
        } catch(SerializationException e) {
            throw new RemoteEventServiceRuntimeException("Error on de-serializing event \"" + anEvent + "\"!", e);
        }
    }
View Full Code Here

    }
    if (result != null && failureMessage != null) {
      RuntimeException ex = new RuntimeException(failureMessage);
      result.setException(ex);
    } else if (!GWT.isProdMode() && result.exceptionWrapper != null) {
      SerializationStreamFactory fac = (SerializationStreamFactory) junitHost;
      SerializationStreamWriter writer = fac.createStreamWriter();
      ensureSerializable(result.exceptionWrapper, writer);
    }
    TestInfo currentTest = getCurrentTest();
    currentResults.put(currentTest, result);
    ++currentTestIndex;
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.rpc.SerializationStreamFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.