本文整理汇总了Java中com.google.gwt.dev.util.collect.Lists类的典型用法代码示例。如果您正苦于以下问题:Java Lists类的具体用法?Java Lists怎么用?Java Lists使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lists类属于com.google.gwt.dev.util.collect包,在下文中一共展示了Lists类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreatingWave
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
/**
* Create a wave, send Op which is unacked and expect unsaved data.
*/
public void testCreatingWave() throws ChannelException {
// Connect to the server
mux.setChannelsPresenceListener(muxListener);
mux.open(Lists.create(NEW_WAVELET), Collections.EMPTY_MAP, muxListener);
OperationChannel channel = muxListener.verifyOperationChannelCreated(NEW_SNAPSHOT,
Accessibility.READ_WRITE);
muxListener.verifyNoMoreInteractions();
channel.send(createAddParticipantOp());
// Expect the delta channel to not be ready, so we expect an open call, but
// no success on open and no submit call going through.
assertEquals(1, waveViewService.opens.size());
assertEquals(0, waveViewService.submits.size());
muxListener.verifyNoMoreInteractions();
// We do expect unsaved data.
assertUnsavedDataInfo(1, 1, 0, 0, 0);
// Now bail out of the connection with an op pending, should close.
mux.close();
assertEquals(1, fakeUnsavedDataListener.closeCalls);
}
示例2: testMuxCloseClosesAllUnsavedDataUpdaters
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
public void testMuxCloseClosesAllUnsavedDataUpdaters() {
mux.setChannelsPresenceListener(muxListener);
mux.open(Lists.create(KNOWN_WAVELET1, KNOWN_WAVELET2), Collections.EMPTY_MAP, muxListener);
OperationChannel ch1 = muxListener.verifyOperationChannelCreated(SNAPSHOT1,
Accessibility.READ_WRITE);
OperationChannel ch2 = muxListener.verifyOperationChannelCreated(SNAPSHOT2,
Accessibility.READ_WRITE);
muxListener.verifyNoMoreInteractions();
MockOperationChannelListener listener1 = new MockOperationChannelListener();
MockOperationChannelListener listener2 = new MockOperationChannelListener();
ch1.setListener(listener1);
ch2.setListener(listener2);
mux.close();
assertEquals(2, fakeUnsavedDataListener.closeCalls);
}
示例3: testOnConnectedCalledAfterAllWaveletsIsOpened
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
public void testOnConnectedCalledAfterAllWaveletsIsOpened() {
Map<WaveletId, List<HashedVersion>> knownWavelets = new HashMap<>();
knownWavelets.put(WAVELET_ID1, Lists.create(HASHED_VERSION1));
knownWavelets.put(WAVELET_ID2, Lists.create(HASHED_VERSION1));
Map<WaveletId, WaveletDelta> unacknowledgedDeltas = new HashMap<>();
channel.open(knownWavelets, Collections.EMPTY_MAP, unacknowledgedDeltas, viewListener);
waveViewService.opens.get(waveViewService.opens.size()-1).callback.onWaveletOpen(CHANNEL_ID1,
HASHED_VERSION1, HASHED_VERSION1, 0, HASHED_VERSION1, null, null);
viewListener.expectedWaveletOpenCall(WAVELET_ID1,
HASHED_VERSION1, HASHED_VERSION1, HASHED_VERSION1, null, null);
viewListener.expectedNothing();
waveViewService.opens.get(waveViewService.opens.size()-2).callback.onWaveletOpen(CHANNEL_ID2,
HASHED_VERSION1, HASHED_VERSION1, 0, HASHED_VERSION1, null, null);
viewListener.expectedWaveletOpenCall(WAVELET_ID2,
HASHED_VERSION1, HASHED_VERSION1, HASHED_VERSION1, null, null);
viewListener.expectedConnectedCall();
}
示例4: init
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
@Before
public void init() {
String editorId = "testEditorInputId";
when(textEditor.getEditorInput().getFile().getPath()).thenReturn(editorId);
when(editorDatasourceOracle.getSelectedDatasourceId(editorId)).thenReturn("datasourceId");
when(databaseInfoOracle.getSchemasFor("datasourceId")).thenReturn(Lists.create("public", "meta"));
when(databaseInfoOracle.getTablesFor("datasourceId", "public")).thenReturn(Lists.create("table", "atable"));
when(databaseInfoOracle.getTablesFor("datasourceId", "meta")).thenReturn(Lists.create("metaTable", "aMetaTable"));
when(databaseInfoOracle.getColumnsFor("datasourceId", "public", "atable")).thenReturn(Lists.create("column11", "column12"));
when(databaseInfoOracle.getColumnsFor("datasourceId", "public", "table")).thenReturn(Lists.create("column21", "column22", "coumn23"));
when(databaseInfoOracle.getColumnsFor("datasourceId", "meta", "metaTable")).thenReturn(Lists.create("column11", "column12",
"column222"));
when(databaseInfoOracle.getColumnsFor("datasourceId", "meta", "aMetaTable")).thenReturn(Lists.create("column11", "column12",
"column234"));
codeAssistProcessor = new SqlCodeAssistProcessor(textEditor, resources, databaseInfoOracle, editorDatasourceOracle);
}
示例5: halfOpen
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
/**
* Opens the channel from the client side only.
*/
private void halfOpen() {
Map<WaveletId, List<HashedVersion>> knownWavelets = new HashMap<>();
Map<WaveletId, WaveletDelta> unacknowledgedDeltas = new HashMap<>();
knownWavelets.put(WAVELET_ID1, Lists.create(HASHED_VERSION1));
channel.open(knownWavelets, Collections.EMPTY_MAP, unacknowledgedDeltas, viewListener);
}
示例6: testOldUpdatesBeforeOpenFinishedSkipped
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
/**
* Tests that old updates that arrive before the open finished are skipped.
*/
public void testOldUpdatesBeforeOpenFinishedSkipped() {
halfOpen();
List<TransformedWaveletDelta> deltas =
Lists.addAll(respondWithUpdate(HASHED_VERSION1), respondWithUpdate(HASHED_VERSION2));
respondWithWaveletOpen();
viewListener.expectedWaveletOpenCall(WAVELET_ID1,
HASHED_VERSION1, HASHED_VERSION1, HASHED_VERSION1, null, null);
viewListener.expectedUpdateCall(WAVELET_ID1, deltas, HASHED_VERSION1);
viewListener.expectedConnectedCall();
}
示例7: testCommitNotification
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
/**
* Open a wave; send an Op; wait for the ack; wait for the commit with no outstanding ops.
*/
public void testCommitNotification() throws ChannelException {
// Connect to the server
mux.setChannelsPresenceListener(muxListener);
mux.open(Lists.create(KNOWN_WAVELET1), Collections.EMPTY_MAP, muxListener);
OperationChannel channel = muxListener.verifyOperationChannelCreated(SNAPSHOT1,
Accessibility.READ_WRITE);
assertEquals(1, waveViewService.opens.size());
WaveViewService.OpenChannelStreamCallback openCallback = waveViewService.lastOpen().callback;
// Pretend we got the initial snapshot at version 1 signature1.
muxListener.verifyNoMoreInteractions();
openCallback.onWaveletOpen(CHANNEL_ID, HashedVersion.of(1L, SIGNATURE1),
HashedVersion.of(1L, SIGNATURE1), 0, HashedVersion.unsigned(0), null, Collections.EMPTY_MAP);
muxListener.verifyConnected();
channel.send(createAddParticipantOp());
assertEquals(1, waveViewService.submits.size());
assertUnsavedDataInfo(1, 1, 1, 0, 0);
// Server ack's the previous add participant op.
HashedVersion v2 = HashedVersion.of(2, SIGNATURE2);
WaveViewService.SubmitCallback submitCallback = waveViewService.lastSubmit().callback;
submitCallback.onResponse(1, v2, TIMESTAMP, new ReturnStatus(ReturnCode.OK));
assertUnsavedDataInfo(0, 1, 0, 2, 0);
// Server sends commit for the add participant op.
openCallback.onUpdate(null, v2);
// Now we expect to be told everything is committed.
assertUnsavedDataInfo(0, 0, 0, 2, 2);
// Send another op, now it should be uncommitted.
channel.send(createAddParticipantOp());
assertEquals(2, waveViewService.submits.size());
assertUnsavedDataInfo(1, 1, 1, 2, 2);
// Now bail out of the connection with an op pending, should close.
mux.close();
assertEquals(1, waveViewService.closes.size());
waveViewService.lastClose().callback.onSuccess();
assertEquals(1, fakeUnsavedDataListener.closeCalls);
}
示例8: testLastCommittedVersionUpdate
import com.google.gwt.dev.util.collect.Lists; //导入依赖的package包/类
/**
* Open a wave; send an Op; wait for the ack; send another Op; get ack; get LCV for first ack;
* get a LCV for second ack.
*/
public void testLastCommittedVersionUpdate() throws ChannelException {
// Connect to the server
mux.setChannelsPresenceListener(muxListener);
mux.open(Lists.create(KNOWN_WAVELET1), Collections.EMPTY_MAP, muxListener);
OperationChannel channel = muxListener.verifyOperationChannelCreated(SNAPSHOT1,
Accessibility.READ_WRITE);
muxListener.verifyNoMoreInteractions();
assertEquals(1, waveViewService.opens.size());
WaveViewService.OpenChannelStreamCallback openCallback = waveViewService.lastOpen().callback;
// Pretend we got the initial snapshot at version 1 signature1.
openCallback.onWaveletOpen(CHANNEL_ID, HashedVersion.of(1L, SIGNATURE1),
HashedVersion.of(1L, SIGNATURE1), 0, HashedVersion.unsigned(0), null, Collections.EMPTY_MAP);
muxListener.verifyConnected();
// Send Op, get ack.
channel.send(createAddParticipantOp());
assertEquals(1, waveViewService.submits.size());
WaveViewService.SubmitCallback submitCallback1 = waveViewService.lastSubmit().callback;
HashedVersion v2 = HashedVersion.of(2, SIGNATURE2);
submitCallback1.onResponse(1, v2, TIMESTAMP, new ReturnStatus(ReturnCode.OK));
assertUnsavedDataInfo(0, 1, 0, 2, 0);
// Send another Op, get ack.
channel.send(createAddParticipantOp());
assertEquals(2, waveViewService.submits.size());
WaveViewService.SubmitCallback submitCallback2 = waveViewService.lastSubmit().callback;
HashedVersion v3 = HashedVersion.of(3, SIGNATURE3);
submitCallback2.onResponse(1, v3, TIMESTAMP, new ReturnStatus(ReturnCode.OK));
assertUnsavedDataInfo(0, 2, 0, 3, 0);
// Server sends commit for the first addParticipant op.
openCallback.onUpdate(null, v2);
// Now we expect to be told that NOT everything is committed.
assertUnsavedDataInfo(0, 1, 0, 3, 2);
// Server sends commit for the second addParticipant op.
openCallback.onUpdate(null, v3);
// Now we expect to be told that everything is committed.
assertUnsavedDataInfo(0, 0, 0, 3, 3);
mux.close();
assertEquals(1, waveViewService.closes.size());
waveViewService.lastClose().callback.onSuccess();
assertEquals(1, fakeUnsavedDataListener.closeCalls);
}