本文整理汇总了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();
}
});
}
});
}
示例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();
}
});
}
});
}
示例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();
}
});
}
示例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();
}
});
}
示例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();
}
});
}