@Override public ArquillianGrapheneConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); return ConfigurationMapper.fromSystemConfiguration(this, qualifier); }
@SuppressWarnings("deprecation") @Override public RichFacesPageFragmentsConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { return ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); }
static <T extends DroneConfiguration<T>> void injectMapProperty(T configuration, List<Field> maps, Map<String, Field> fields, String propertyName, String value) { try { for (Field mapField : maps) { Object typedValue = value; if (CapabilityTypeMapper.isCastNeeded(propertyName)) { typedValue = CapabilityTypeMapper.createTypedObjectFromString(propertyName, value); } // put property into a map @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) mapField.get(configuration); map.put(propertyName, typedValue); } } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }
static <T extends DroneConfiguration<T>> Field injectField(T configuration, List<Field> maps, Map<String, Field> fields, String fieldName, String value) { try { Field f = fields.get(fieldName); if (f.getAnnotation(Deprecated.class) != null) { log.log(Level.WARNING, "The property \"{0}\" used in Arquillian \"{1}\" configuration is deprecated.", new Object[] {f.getName(), configuration.getConfigurationName()}); } // remap the property into capability if this is a legacy one // or remap the property into different property field if (LegacyConfigurationMapper.isLegacy(fieldName)) { String newKey = LegacyConfigurationMapper.remapKey(fieldName); String newValue = LegacyConfigurationMapper.remapValue(fieldName, value); if (LegacyConfigurationMapper.remapsToCapability(fieldName)) { injectMapProperty(configuration, maps, fields, newKey, newValue); } else { injectField(configuration, maps, fields, newKey, newValue); } } f.set(configuration, convert(f.getType(), value)); return f; } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }
Map<String, Field> fields = SecurityActions.getAccessableFields(configuration.getClass()); List<Field> maps = SecurityActions.getMapFields(configuration.getClass(), String.class, Object.class); for (Field mapField : maps) { try { String name = nameValue.getKey(); String reversedName = keyTransformReverse(name); injectField(configuration, maps, fields, name, nameValue.getValue()); else if (fields.containsKey(reversedName) && !LegacyConfigurationMapper.isLegacy(reversedName)) { new Object[] {name, configuration.getConfigurationName(), keyTransformReverse(name)}); injectField(configuration, maps, fields, keyTransformReverse(name), nameValue.getValue()); injectMapProperty(configuration, maps, fields, name, nameValue.getValue());
String qualifierName = qualifier.getSimpleName().toLowerCase(); Map<String, String> nameValuePairs = loadNameValuePairs(descriptor, descriptorQualifier, qualifierName); return mapFromNameValuePairs(configuration, sanitizedNameValuePairs);
public List<Field> run() { Map<String, Field> accesableFields = getAccessableFields(source);
@Override public FundamentalTestConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { return ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); }
public SeleniumConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); return ConfigurationMapper.fromSystemConfiguration(this, qualifier); }
Map<String, Field> fields = SecurityActions.getAccessableFields(configuration.getClass()); List<Field> maps = SecurityActions.getMapFields(configuration.getClass(), String.class, Object.class); for (Field mapField : maps) { try { String name = nameValue.getKey(); String reversedName = keyTransformReverse(name); injectField(configuration, maps, fields, name, nameValue.getValue()); else if (fields.containsKey(reversedName) && !LegacyConfigurationMapper.isLegacy(reversedName)) { new Object[] {name, configuration.getConfigurationName(), keyTransformReverse(name)}); injectField(configuration, maps, fields, keyTransformReverse(name), nameValue.getValue()); injectMapProperty(configuration, maps, fields, name, nameValue.getValue());
static <T extends DroneConfiguration<T>> void injectMapProperty(T configuration, List<Field> maps, Map<String, Field> fields, String propertyName, String value) { try { for (Field mapField : maps) { Object typedValue = value; if (CapabilityTypeMapper.isCastNeeded(propertyName)) { typedValue = CapabilityTypeMapper.createTypedObjectFromString(propertyName, value); } // put property into a map @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) mapField.get(configuration); map.put(propertyName, typedValue); } } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }
String qualifierName = qualifier.getSimpleName().toLowerCase(); Map<String, String> nameValuePairs = loadNameValuePairs(descriptor, descriptorQualifier, qualifierName); return mapFromNameValuePairs(configuration, sanitizedNameValuePairs);
public List<Field> run() { Map<String, Field> accesableFields = getAccessableFields(source);
@Override public GrapheneConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { return ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); }
@Override public GrapheneConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { return ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); }
public SeleniumServerConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { return ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); }
@Override public WebDriverConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); // ARQ-1022, we need to check if we haven't overriden original browser // capabilities in an incompatible way if (_originalBrowser != null && !_originalBrowser.equals(this.browser)) { log.log(Level.WARNING, "Arquillian configuration is specifying a Drone of type {0}, however test class specifically asked for {1}. As Drone cannot guarantee that those two are compatible, \"browser\" property will be set to {1}.", new Object[] {browser, _originalBrowser}); this.browser = _originalBrowser; } return this; }
@Override public WebDriverConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { ConfigurationMapper.fromArquillianDescriptor(descriptor, this, qualifier); // ARQ-1022, we need to check if we haven't overriden original browser // capabilities in an incompatible way if (_originalBrowser != null && !_originalBrowser.equals(this.browser)) { log.log(Level.WARNING, "Arquillian configuration is specifying a Drone of type {0}, however test class specifically asked for {1}. As Drone cannot guarantee that those two are compatible, \"browser\" property will be set to {1}.", new Object[] {browser, _originalBrowser}); this.browser = _originalBrowser; } return this; }
@Override public GlobalDroneConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { // qualifier is ignored ConfigurationMapper.fromArquillianDescriptor(descriptor, this, Default.class); // if debugging is enabled if (Boolean.parseBoolean(SecurityActions.getProperty("arquillian.debug"))) { this.instantiationTimeoutInSeconds = 0; } return this; }
@Override public GlobalDroneConfiguration configure(ArquillianDescriptor descriptor, Class<? extends Annotation> qualifier) { // qualifier is ignored ConfigurationMapper.fromArquillianDescriptor(descriptor, this, Default.class); // if debugging is enabled if (Boolean.parseBoolean(SecurityActions.getProperty("arquillian.debug"))) { this.instantiationTimeoutInSeconds = 0; } return this; }