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

Java Injector类代码示例

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

本文整理汇总了Java中org.jboss.arquillian.core.api.Injector的典型用法代码示例。如果您正苦于以下问题:Java Injector类的具体用法?Java Injector怎么用?Java Injector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Injector类属于org.jboss.arquillian.core.api包,在下文中一共展示了Injector类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: register

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public void register(@Observes DockerClientExecutor executor, CubeDockerConfiguration configuration,
    Injector injector, CubeRegistry registry) {

    //TODO, add key here generation here
    DockerCompositions containerConfigurations = configuration.getDockerContainersContent();
    for (Map.Entry<String, CubeContainer> containerConfiguration : containerConfigurations.getContainers()
        .entrySet()) {

        registry.addCube(
            injector.inject(
                new DockerCube(
                    containerConfiguration.getKey(),
                    containerConfiguration.getValue(),
                    executor)));
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:17,代码来源:CubeDockerRegistrar.java


示例2: create

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public static AutoStartParser create(String expression, DockerCompositions containersDefinition, Injector injector) {
    if (isNone(expression)) {
        return new NoneAutoStartParser();
    } else {
        if (isRegularExpressionBased(expression)) {
            return new RegularExpressionAutoStartParser(expression, containersDefinition);
        } else {
            if (isCustomImplementation(expression)) {
                return new CustomAutoStartParser(injector,
                    expression.substring(
                        expression.indexOf(CustomAutoStartParser.CUSTOM_PREFIX)
                            + CustomAutoStartParser.CUSTOM_PREFIX.length()).trim()
                );
            } else {
                if (isCommaSeparated(expression)) {
                    return new CommaSeparatedAutoStartParser(expression, containersDefinition);
                } else {
                    return null;
                }
            }
        }
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:24,代码来源:AutoStartParserFactory.java


示例3: should_start_a_network

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Test
public void should_start_a_network() {

    ContainerNetworkObjectDslTestEnricher containerNetworkObjectDslTestEnricher = new ContainerNetworkObjectDslTestEnricher();
    Injector injector = mock(Injector.class);
    containerNetworkObjectDslTestEnricher.injectorInstance = () -> injector;
    containerNetworkObjectDslTestEnricher.networkRegistryInstance = () -> networkRegistry;
    containerNetworkObjectDslTestEnricher.dockerClientExecutorInstance = () -> dockerClientExecutor;

    when(injector.inject(any(Network.class))).then(invocation -> invocation.getArgumentAt(0, Network.class));
    when(dockerClientExecutor.createNetwork(eq("default"), any(org.arquillian.cube.docker.impl.client.config.Network.class))).thenReturn("default");

    containerNetworkObjectDslTestEnricher.enrich(new NetworkTest());

    verify(dockerClientExecutor).createNetwork(eq("default"), any(org.arquillian.cube.docker.impl.client.config.Network.class));
    assertThat(networkRegistry.getNetwork("default")).isNotNull();
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:18,代码来源:ContainerNetworkObjectDslTestEnricherTest.java


示例4: should_start_a_container

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Test
public void should_start_a_container() {

    Injector injector = new Injector() {
        @Override
        public <T> T inject(T target) {
            return target;
        }
    };

    ContainerNetworkObjectDslTestEnricher containerNetworkObjectDslTestEnricher = new ContainerNetworkObjectDslTestEnricher();
    containerNetworkObjectDslTestEnricher.injectorInstance = () -> injector;
    containerNetworkObjectDslTestEnricher.cubeRegistryInstance = () -> cubeRegistry;
    containerNetworkObjectDslTestEnricher.cubeControllerInstance = () -> cubeController;
    containerNetworkObjectDslTestEnricher.dockerClientExecutorInstance = () -> dockerClientExecutor;



    containerNetworkObjectDslTestEnricher.enrich(new SimpleContainerTest());

    verify(cubeController).create("mytomcat");
    verify(cubeController).start("mytomcat");

    assertThat(cubeRegistry.getCube("mytomcat")).isNotNull();

}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:27,代码来源:ContainerNetworkObjectDslTestEnricherTest.java


示例5: should_start_multiple_containers_in_order

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Test
public void should_start_multiple_containers_in_order() {

    Injector injector = new Injector() {
        @Override
        public <T> T inject(T target) {
            return target;
        }
    };

    ContainerNetworkObjectDslTestEnricher containerNetworkObjectDslTestEnricher = new ContainerNetworkObjectDslTestEnricher();
    containerNetworkObjectDslTestEnricher.injectorInstance = () -> injector;
    containerNetworkObjectDslTestEnricher.cubeRegistryInstance = () -> cubeRegistry;
    containerNetworkObjectDslTestEnricher.cubeControllerInstance = () -> cubeController;
    containerNetworkObjectDslTestEnricher.dockerClientExecutorInstance = () -> dockerClientExecutor;

    containerNetworkObjectDslTestEnricher.enrich(new MultipleContainerTest());

    InOrder inOrder = Mockito.inOrder(cubeController);
    inOrder.verify(cubeController).create("mytomcat3");
    inOrder.verify(cubeController).create("mytomcat1");
    inOrder.verify(cubeController).create("mytomcat2");

}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:25,代码来源:ContainerNetworkObjectDslTestEnricherTest.java


示例6: init

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Before
public void init() {
    cubeRegistry = new LocalCubeRegistry();
    dockerContainerObjectFactory = new DockerContainerObjectFactory();
    cubeController = mock(CubeController.class);
    dockerClientExecutor = mock(DockerClientExecutor.class);
    injector = mock(Injector.class);
    serviceLoader = mock(ServiceLoader.class);
    when(serviceLoader.all(any(Class.class))).thenReturn(Collections.emptyList());

    dockerContainerObjectFactory.serviceLoaderInstance = () -> serviceLoader;
    dockerContainerObjectFactory.dockerClientExecutorInstance = () -> dockerClientExecutor;
    dockerContainerObjectFactory.cubeRegistryInstance = () -> cubeRegistry;
    dockerContainerObjectFactory.cubeControllerInstance = () -> cubeController;
    dockerContainerObjectFactory.injectorInstance = () -> injector;

    //We asure that there is no previous executions there.
    deleteTestDirectory();
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:CubeContainerObjectTestEnricherTest.java


示例7: initialize

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public static DockerClientExecutor initialize() {

        Injector injector = new Injector() {
            @Override
            public <T> T inject(T t) {
                return t;
            }
        };

        CubeDockerConfigurationResolver resolver = new CubeDockerConfigurationResolver(new Top(),
            new DockerMachine(new CommandLineExecutor()),
            new Boot2Docker(new CommandLineExecutor()),
            new OperatingSystemResolver().currentOperatingSystem().getFamily());

        final Map<String, String> config = resolver.resolve(new HashMap<>());

        final CubeDockerConfiguration cubeDockerConfiguration = CubeDockerConfiguration.fromMap(config, injector);
        return new DockerClientExecutor(cubeDockerConfiguration);
    }
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:DockerClientInitializer.java


示例8: register

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public void register(@Observes final OpenShiftClient client, final CubeRegistry registry, final Configuration conf,
    final Injector injector) {
    if (!(conf instanceof CubeOpenShiftConfiguration)) {
        return;
    }

    CubeOpenShiftConfiguration configuration = (CubeOpenShiftConfiguration) conf;
    if (!hasDefinitionStream(configuration)) {
        return;
    }

    for (HasMetadata item : client.getClientExt().load(getDefinitionStream(configuration)).get()) {
        if (item instanceof Pod) {
            registry.addCube(injector.inject(new BuildablePodCube((Pod) item, client, configuration)));
        } else if (item instanceof Service) {
            registry.addCube(injector.inject(new ServiceCube((Service) item, client, configuration)));
        }
    }
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:20,代码来源:CubeOpenShiftRegistrar.java


示例9: TargetController

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public TargetController(ContainerAdapter adapter, Injector injector, File resolverCacheFolder) throws Exception {
    // init
    this.classloader = resolveClasspathDependencies(adapter, resolverCacheFolder);
    final Class<?> delegateClass = classloader.loadClass(adapter.adapterClass());
    this.delegate = injector.inject((DeployableContainer) delegateClass.newInstance());
    this.adapter = adapter;
}
 
开发者ID:arquillian,项目名称:arquillian-container-chameleon,代码行数:9,代码来源:TargetController.java


示例10: shouldInstantiateACustomAutoStartParser

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Test
public void shouldInstantiateACustomAutoStartParser() {

    Map<String, String> parameters = new HashMap<String, String>();

    parameters.put("serverVersion", "1.13");
    parameters.put("serverUri", "http://localhost:25123");
    parameters.put("dockerContainers", CONTENT);
    parameters.put("definitionFormat", DefinitionFormat.CUBE.name());
    final CubeDockerConfiguration cubeDockerConfiguration = CubeDockerConfiguration.fromMap(parameters, null);

    Injector injector = new Injector() {
        @Override
        public <T> T inject(T target) {
            final ChangeNameAutoStartParser orderByNameAutoStartParser = (ChangeNameAutoStartParser) target;
            orderByNameAutoStartParser.cubeDockerConfigurationInstance = new Instance<CubeDockerConfiguration>() {
                @Override
                public CubeDockerConfiguration get() {
                    return cubeDockerConfiguration;
                }
            };
            return target;
        }
    };

    final AutoStartParser autoStartParser =
        AutoStartParserFactory.create("custom:org.arquillian.cube.docker.impl.client.ChangeNameAutoStartParser", null,
            injector);
    assertThat(autoStartParser, instanceOf(CustomAutoStartParser.class));

    final Set<String> names = autoStartParser.parse().keySet();
    assertThat(names, hasItem("og"));
    assertThat(names, hasItem("tacmot"));
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:35,代码来源:CustomResolutionAutoStartParserTest.java


示例11: setInjector

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
@Override
public void setInjector(Injector injector) {
    this.injector = injector;
}
 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:5,代码来源:HttpTarget.java


示例12: ToxiProxyScenario

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public ToxiProxyScenario(ToxiProxyClient client, Injector injector) {
    this.client = client;
    this.proxies = new HashMap<>();
    this.injector = injector;
}
 
开发者ID:arquillian,项目名称:arquillian-cube-q,代码行数:6,代码来源:ToxiProxyScenario.java


示例13: CustomAutoStartParser

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public CustomAutoStartParser(Injector injector, String clazz) {
    this.injector = injector;
    this.clazz = clazz;
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:5,代码来源:CustomAutoStartParser.java


示例14: register

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public void register(@Observes(precedence = 100) CubeConfiguration configuration, Injector injector) {
    NetworkRegistry registry = new LocalDockerNetworkRegistry();
    networkRegistryProducer.set(registry);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:5,代码来源:NetworkRegistrar.java


示例15: register

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
public void register(@Observes(precedence = 100) CubeConfiguration configuration, Injector injector) {
    CubeRegistry registry = new LocalCubeRegistry();
    registryProducer.set(registry);
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:5,代码来源:CubeRegistrar.java


示例16: setInjector

import org.jboss.arquillian.core.api.Injector; //导入依赖的package包/类
void setInjector(Injector injector); 
开发者ID:arquillian,项目名称:arquillian-algeron,代码行数:2,代码来源:ArquillianTestClassAwareTarget.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java FloatNode类代码示例发布时间:2022-05-22
下一篇:
Java Expr类代码示例发布时间: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