Package org.jboss.arquillian.drone.spi

Examples of org.jboss.arquillian.drone.spi.InstanceOrCallableInstance.asInstance()


        if (union.isInstanceCallable()) {
            droneLifecycleEvent.fire(new BeforeDroneInstantiated(union, type, qualifier));
        }

        // return browser
        return union.asInstance(type);

    }
}
View Full Code Here


        Class<?> droneType = event.getDroneType();
        Class<? extends Annotation> qualifier = event.getQualifier();

        InstanceOrCallableInstance globalConfigurationUnion = context.get().get(GlobalDroneConfiguration.class, Default.class);
        Validate.stateNotNull(globalConfigurationUnion, "Drone global configuration should be available in the context");
        GlobalDroneConfiguration globalDroneConfiguration = globalConfigurationUnion.asInstance(GlobalDroneConfiguration.class);
        int timeout = globalDroneConfiguration.getInstantiationTimeoutInSeconds();

        try {
            Object browser = null;
            if (timeout > 0) {
View Full Code Here

        if (union.isInstanceCallable()) {
            droneLifecycleEvent.fire(new BeforeDroneInstantiated(union, type, qualifier));
        }

        // return browser
        return union.asInstance(type);

    }

    // ARQ-1543
    private static enum DroneScope {
View Full Code Here

                        "Enhancing {0} @{1} using enhancer {2} with precedence {3}",
                        new Object[] { type.getSimpleName(), qualifier.getSimpleName(), enhancer.getClass().getName(),
                                enhancer.getPrecedence() });

                droneEnhancementEvent.fire(new BeforeDroneEnhanced(enhancer, browser, type, qualifier));
                Object newBrowser = enhancer.enhance(browser.asInstance(type), qualifier);
                browser.set(newBrowser);
                droneEnhancementEvent.fire(new AfterDroneEnhanced(browser, type, qualifier));
            }
        }
    }
View Full Code Here

                        "Deenhancing {0} @{1} using enhancer {2} with precedence {3}",
                        new Object[] { type.getSimpleName(), qualifier.getSimpleName(), enhancer.getClass().getName(),
                                enhancer.getPrecedence() });

                droneEnhancementEvent.fire(new BeforeDroneDeenhanced(enhancer, browser, type, qualifier));
                Object newBrowser = enhancer.deenhance(browser.asInstance(type), qualifier);
                browser.set(newBrowser);
                droneEnhancementEvent.fire(new AfterDroneDeenhanced(browser, type, qualifier));
            }
        }
    }
View Full Code Here

        Class<?> droneType = event.getDroneType();
        Class<? extends Annotation> qualifier = event.getQualifier();

        InstanceOrCallableInstance globalConfigurationUnion = context.get().get(GlobalDroneConfiguration.class, Default.class);
        Validate.stateNotNull(globalConfigurationUnion, "Drone global configuration should be available in the context");
        GlobalDroneConfiguration globalDroneConfiguration = globalConfigurationUnion.asInstance(GlobalDroneConfiguration.class);
        int timeout = globalDroneConfiguration.getInstantiationTimeoutInSeconds();

        try {
            Object browser = null;
            if (timeout > 0) {
View Full Code Here

    public void resizeBrowserWindow(@Observes AfterDroneInstantiated event) {
        // get content of event
        InstanceOrCallableInstance instance = event.getInstance();
        Class<?> droneType = event.getDroneType();
        Class<? extends Annotation> qualifier = event.getQualifier();
        Class<?> realInstanceClass = instance.asInstance(droneType).getClass();

        resizeWindow(instance, droneType, qualifier, realInstanceClass);

    }
View Full Code Here

        // get content of event
        InstanceOrCallableInstance instance = event.getInstance();
        Class<?> droneType = event.getDroneType();
        Class<? extends Annotation> qualifier = event.getQualifier();
        Class<?> realInstanceClass = instance.asInstance(droneType).getClass();

        resizeWindow(instance, droneType, qualifier, realInstanceClass);

    }
View Full Code Here

        // let's get browser configuration
        Validate.stateNotNull(droneContext.get(), "DroneContext must not be null");
        InstanceOrCallableInstance configurationInstance = droneContext.get().get(WebDriverConfiguration.class, qualifier);
        Validate.stateNotNull(configurationInstance, "WebDriver configuration must not be null");
        WebDriverConfiguration configuration = configurationInstance.asInstance(WebDriverConfiguration.class);
        Validate.stateNotNull(configuration, "WebDriver configuration must not be null");

        String dimensions = (String) configuration.getDimensions();

        if (dimensions != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.