public static IInjectorProvider getorCreateInjectorProvider(ExtensionContext context) {
InjectWith injectWith = context.getrequiredTestClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
Class<? extends IInjectorProvider> klass = injectWith.value();
IInjectorProvider injectorProvider = injectorProviderClassCache.get(klass);
if (injectorProvider == null) {
try {
injectorProvider = klass.newInstance();
injectorProviderClassCache.put(klass,injectorProvider);
} catch (Exception e) {
throwUncheckedException(e);
}
}
return injectorProvider;
}
return null;
}
项目:xtext-core
文件:InjectorProviders.java
public static IInjectorProvider getorCreateInjectorProvider(TestClass testClass) {
InjectWith injectWith = testClass.getJavaClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
Class<? extends IInjectorProvider> klass = injectWith.value();
IInjectorProvider injectorProvider = injectorProviderClassCache.get(klass);
if (injectorProvider == null) {
try {
injectorProvider = klass.newInstance();
injectorProviderClassCache.put(klass,injectorProvider);
} catch (Exception e) {
throwUncheckedException(e);
}
}
return injectorProvider;
}
return null;
}
public static IInjectorProvider getInjectorProvider(ExtensionContext context) {
InjectWith injectWith = context.getrequiredTestClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
return injectorProviderClassCache.get(injectWith.value());
}
return null;
}
public static IInjectorProvider createInjectorProvider(ExtensionContext context) {
InjectWith injectWith = context.getrequiredTestClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
try {
return injectWith.value().newInstance();
} catch (Exception e) {
throwUncheckedException(e);
}
}
return null;
}
项目:xtext-core
文件:InjectorProviders.java
public static IInjectorProvider getInjectorProvider(TestClass testClass) {
InjectWith injectWith = testClass.getJavaClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
return injectorProviderClassCache.get(injectWith.value());
}
return null;
}
项目:xtext-core
文件:InjectorProviders.java
public static IInjectorProvider createInjectorProvider(TestClass testClass) {
InjectWith injectWith = testClass.getJavaClass().getAnnotation(InjectWith.class);
if (injectWith != null) {
try {
return injectWith.value().newInstance();
} catch (Exception e) {
throwUncheckedException(e);
}
}
return null;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。