• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Lists类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:27,代码来源:UnsavedDataUpdateTest.java


示例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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:19,代码来源:UnsavedDataUpdateTest.java


示例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();
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:18,代码来源:ViewChannelImplTest.java


示例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);
}
 
开发者ID:codenvy-legacy,项目名称:plugin-datasource,代码行数:18,代码来源:TestSqlCodeAssistProcessor.java


示例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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:ViewChannelImplTest.java


示例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();
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:17,代码来源:ViewChannelImplTest.java


示例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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:47,代码来源:UnsavedDataUpdateTest.java


示例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);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:51,代码来源:UnsavedDataUpdateTest.java



注:本文中的com.google.gwt.dev.util.collect.Lists类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HindiAnalyzer类代码示例发布时间:2022-05-22
下一篇:
Java Paths类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap