CustomerRadioButtonTest.java :  » ERP-CRM-Financial » OpenXava-3.0 » org » openxava » test » tests » Java Open Source

Java Open Source » ERP CRM Financial » OpenXava 3.0 
OpenXava 3.0 » org » openxava » test » tests » CustomerRadioButtonTest.java
package org.openxava.test.tests;

import org.openxava.tests.*;

/**
 * @author Javier Paniza
 */

public class CustomerRadioButtonTest extends ModuleTestBase {
  
  public CustomerRadioButtonTest(String testName) {
    super(testName, "CustomerRadioButton");    
  }
  
  public void testEditorByView_radioButton() throws Exception {
    // Really editor by property-view must be tested visually
    // and about radioButton we only test that it's possible to use in junit test,
    // because behaves equals that a combo. Hence it's needed to test visually
    execute("CRUD.new");
    setValue("number", "66");    
    setValue("type", isOX3()?"1":"2"); // steady
    setValue("name", "CUSTOMER JUNIT");
    setValue("address.street", "DOCTOR PESSET");
    setValue("address.zipCode", "46540");
    setValue("address.city", "EL PUIG");
    setValue("address.state.id", "CA");
    execute("CRUD.save");
    
    assertNoErrors();
    assertValue("number", "");
    assertValue("name", "");
    assertValue("type", isOX3()?"0":"1"); // normal, because a default calculator
    
    
    setValue("number", "66");
    execute("CRUD.search");
    assertValue("number", "66");
    assertValue("name", "Customer Junit");
    assertValue("type", isOX3()?"1":"2"); // steady
    
    execute("CRUD.delete");
    assertMessage("Customer deleted successfully");
  }
    
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.