<commit_before>/*
 * Copyright (c) 2009-2010 DuraSpace. All rights reserved.
 */
package org.duracloud.account.app.integration;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.duracloud.account.app.controller.ServerImageController;

import com.thoughtworks.selenium.Selenium;

/**
 * @author <NAME> Date: Feb 15, 2012
 * 
 */
public class TestServerImageForm
    extends AbstractBaseTestForm<ServerImageFormBot> {
    public TestServerImageForm() {
        super(ServerImageFormBot.class);
    }
}

class ServerImageFormBot extends SimpleFormBot {
    public ServerImageFormBot(Selenium sc) {
        super(sc);
    }

    @Override
    protected List<String> getOptionalFields() {
        List<String> optionalFields = super.getOptionalFields();
        optionalFields.add(ServerImageFormConfig.DESCRIPTION_FIELD_KEY);
        return optionalFields;
    }

    @Override
    public void login() {
        loginRoot();
    }

    @Override
    protected FormConfig createConfig() {
        return new ServerImageFormConfig();
    }

}

class ServerImageFormConfig extends FormConfig {
    public static final String DESCRIPTION_FIELD_KEY = "description";
    public static final String PROVIDER_IMAGE_FIELD_KEY = "providerImageId";

    @Override
    protected Map<String, String> createDefaultFieldMap() {
        Map<String, String> map = new HashMap<String, String>();
        map.put(PROVIDER_IMAGE_FIELD_KEY, "ami-99999999");
        map.put(DESCRIPTION_FIELD_KEY, "This is a description.");
        map.put("version", "test-version");
        map.put("password", "<PASSWORD>");
        return map;
    }

    @Override
    public String getFormPath() {
        return ServerImageController.BASE_MAPPING+ServerImageController.NEW_MAPPING;
    }

    @Override
    public String getFormId() {
        return "serverImageForm";
    }

    @Override
    String getCancelSuccessLocator() {<commit_msg>Trivial  update to the server image integration test.<commit_after>/*
 * Copyright (c) 2009-2010 DuraSpace. All rights reserved.
 */
package org.duracloud.account.app.integration;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.duracloud.account.app.controller.ServerImageController;

import com.thoughtworks.selenium.Selenium;

/**
 * @author <NAME> Date: Feb 15, 2012
 * 
 */
public class TestServerImageForm
    extends AbstractBaseTestForm<ServerImageFormBot> {
    public TestServerImageForm() {
        super(ServerImageFormBot.class);
    }
}

class ServerImageFormBot extends SimpleFormBot {
    public ServerImageFormBot(Selenium sc) {
        super(sc);
    }

    @Override
    protected List<String> getOptionalFields() {
        List<String> optionalFields = super.getOptionalFields();
        optionalFields.add(ServerImageFormConfig.DESCRIPTION_FIELD_KEY);
        return optionalFields;
    }

    @Override
    public void login() {
        loginRoot();
    }

    @Override
    protected FormConfig createConfig() {
        return new ServerImageFormConfig();
    }

}

class ServerImageFormConfig extends FormConfig {
    public static final String DESCRIPTION_FIELD_KEY = "description";
    public static final String PROVIDER_IMAGE_FIELD_KEY = "providerImageId";

    @Override
    protected Map<String, String> createDefaultFieldMap() {
        Map<String, String> map = new HashMap<String, String>();
        map.put(PROVIDER_IMAGE_FIELD_KEY, "ami-99999999");
        map.put(DESCRIPTION_FIELD_KEY, "This is a description.");
        map.put("version", "test-version");
        map.put("password", "<PASSWORD>");
        return map;
    }

    @Override
    public String getFormPath() {
        return ServerImageController.BASE_MAPPING+ServerImageController.NEW_MAPPING;
    }

    @Override
    public String getFormId() {
        return "form";
    }

    @Override
    String getCancelSuccessLocator() {
{'fraction_non_alphanumeric': 0.09851347946586042, 'fraction_numerical': 0.011085915847820609, 'mean_word_length': 3.460674157303371, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '988500', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1113, 'n_words': 249}