当前位置: 首页>>代码示例>>Java>>正文


Java AsyncProvider.get方法代码示例

本文整理汇总了Java中com.google.gwt.inject.client.AsyncProvider.get方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncProvider.get方法的具体用法?Java AsyncProvider.get怎么用?Java AsyncProvider.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.inject.client.AsyncProvider的用法示例。


在下文中一共展示了AsyncProvider.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAsyncProviderWorksWithSingletons

import com.google.gwt.inject.client.AsyncProvider; //导入方法依赖的package包/类
public void testAsyncProviderWorksWithSingletons() {
  final AsyncProvider<Foo> fooAsyncProvider = injector.getFooAsyncProvider();
  // Foo is singleton
  assertNotNull(fooAsyncProvider);
  delayTestFinish(500);
  fooAsyncProvider.get(new AbstractAsyncCallback<Foo>() {

    public void onSuccess(final Foo foo1) {
      assertNotNull(foo1);
      delayTestFinish(500);
      fooAsyncProvider.get(new AbstractAsyncCallback<Foo>() {

        public void onSuccess(Foo foo2) {
          assertNotNull(foo2);
          assertSame(foo1, foo2);
          finishTest();
        }

      });
    }
  });
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:23,代码来源:AsyncProviderTest.java

示例2: testAsyncProviderCreatesNewInstances

import com.google.gwt.inject.client.AsyncProvider; //导入方法依赖的package包/类
public void testAsyncProviderCreatesNewInstances() {
  final AsyncProvider<FooAsync> fooAsyncAsyncProvider = injector.getFooAsyncAsyncProvider();
  // FooAsync is not a singleton, calling AsyncProvider<FooAsync>.get()
  // should create new instances
  assertNotNull(fooAsyncAsyncProvider);
  delayTestFinish(500);
  fooAsyncAsyncProvider.get(new AbstractAsyncCallback<FooAsync>() {
    
    public void onSuccess(final FooAsync fooAsync1) {
      assertNotNull(fooAsync1);
      delayTestFinish(500);
      fooAsyncAsyncProvider.get(new AbstractAsyncCallback<FooAsync>() {
        
        public void onSuccess(final FooAsync fooAsync2) {
          assertNotNull(fooAsync2);
          assertNotSame(fooAsync1, fooAsync2);
          finishTest();
        }
      });
    }
  });
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:23,代码来源:AsyncProviderTest.java

示例3: testAsyncProviderInGinjector

import com.google.gwt.inject.client.AsyncProvider; //导入方法依赖的package包/类
public void testAsyncProviderInGinjector() {
  AsyncProvider<Foo> fooAsyncProvider = injector.getFooAsyncProvider();
  assertNotNull(fooAsyncProvider);
  delayTestFinish(500);
  fooAsyncProvider.get(new AbstractAsyncCallback<Foo>() {

    public void onSuccess(Foo result) {
      assertNotNull(result);
      finishTest();
    }
    
  });
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:14,代码来源:AsyncProviderTest.java

示例4: testAsyncProviderInjection

import com.google.gwt.inject.client.AsyncProvider; //导入方法依赖的package包/类
public void testAsyncProviderInjection() {
  FooAsync fooAsync = injector.getFooAsync();
  AsyncProvider<Foo> fooAsyncProvider = fooAsync.getFooAsyncProvider();
  assertNotNull(fooAsyncProvider);
  delayTestFinish(500);
  fooAsyncProvider.get(new AbstractAsyncCallback<Foo>() {

    public void onSuccess(Foo result) {
      assertNotNull(result);
      finishTest();
    }
    
  });
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:15,代码来源:AsyncProviderTest.java

示例5: testAsyncProviderWithSupertype

import com.google.gwt.inject.client.AsyncProvider; //导入方法依赖的package包/类
public void testAsyncProviderWithSupertype() {
  AsyncProvider<Foo> fooAsyncProvider = injector.getFooAsyncProvider();
  assertNotNull(fooAsyncProvider);
  delayTestFinish(500);
  fooAsyncProvider.get(new AbstractAsyncCallback<Object>() {

    public void onSuccess(Object result) {
      assertNotNull(result);
      finishTest();
    }
    
  });
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:14,代码来源:AsyncProviderTest.java


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