public void validateDescriptor(@Observes BeforeStart event, ArquillianDescriptor descriptor) { if (!event.getDeployableContainer().getConfigurationClass().equals(AndroidContainerConfiguration.class)) { return; } Map<String, String> extensionProperties = null; for (ExtensionDef extension : descriptor.getExtensions()) { extensionProperties = extension.getExtensionProperties(); if (extension.getExtensionName().startsWith("webdriver")) { String browser = extensionProperties.get("browser"); if (browser != null && browser.equals("android")) { if (!isNativeExtensionOnClassPath()) { logger.warning("You have Droidium container as well as webdriver extension with browser \"android\" " + "configured in arquillian.xml but there is not Droidium native extension on " + "the class path. This setting is highly suspicious - it might not be wrong when you actually " + "do not use Drone instance injected into test case for that extension however, in most cases, " + "please add Droidium native on class path to be able to test native Android " + "applications or web applications from Android device."); break; } } } } }
public void startCubeMappedContainer(@Observes BeforeStart event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry, CubeConfiguration cubeConfiguration) { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) { return; } Cube<?> cube = cubeRegistry.getCube(ContainerUtil.getCubeIDForContainer(container)); if (cube == null) { return; // No Cube found matching Container name, not managed by Cube } ConnectionMode connectionMode = cubeConfiguration.getConnectionMode(); if (connectionMode.isAllowReconnect() && cube.isRunningOnRemote()) { controlEvent.fire(new PreRunningCube(cube)); return; } controlEvent.fire(new CreateCube(cube)); controlEvent.fire(new StartCube(cube)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cube)); } }
public void startCubeMappedContainer(@Observes BeforeStart event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry, CubeConfiguration cubeConfiguration) { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) { return; } Cube<?> cube = cubeRegistry.getCube(ContainerUtil.getCubeIDForContainer(container)); if (cube == null) { return; // No Cube found matching Container name, not managed by Cube } ConnectionMode connectionMode = cubeConfiguration.getConnectionMode(); if (connectionMode.isAllowReconnect() && cube.isRunningOnRemote()) { controlEvent.fire(new PreRunningCube(cube)); return; } controlEvent.fire(new CreateCube(cube)); controlEvent.fire(new StartCube(cube)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cube)); } }