Package fr.soleil.globalscreen.tangowidget.attribute

Examples of fr.soleil.globalscreen.tangowidget.attribute.AttributeBooleanComboBox$Builder


    }
   
    private void invalidDeviceTest(final boolean autoStart) {
        jf1 = new JFrame();
        final AssertErrorConf aec = new AssertErrorConf(jf1);
        AttributeBooleanComboBox widget;

        // test invalid device Conf
        for (int i = 0; i < NB_INVALID_DEVICE_CONF_TEST; i++) {

            if (autoStart) {
                widget = new AttributeBooleanComboBox.Builder(m_deviceName,
                        "boolean_scalar_rw").jframe(jf1).build();
            }
            else {
                // construct a widget with userEnable = true,alarmEnable =true,
                widget = new AttributeBooleanComboBox.Builder("", "boolean_scalar_rw")
                        .jframe(jf1).autoStart(false).build();
            }

            // Configuration test
            invalidDeviceConfigTest(widget, i, aec, !autoStart);

            // clear
            jf1.remove(widget);
            widget.stop();

        }
        jf1.dispose();
    }
View Full Code Here


   
    private void invalidAttNameTest(final boolean autoStart) {
        jf1 = new JFrame();
        final AssertErrorConf aec = new AssertErrorConf(jf1);

        AttributeBooleanComboBox widget;

        if (autoStart) {
            widget = new AttributeBooleanComboBox.Builder(m_deviceName, "boolean_scalar_rw")
                    .jframe(jf1).build();
        }
        else {
            // construct a widget with userEnable = true,alarmEnable =true,
            widget = new AttributeBooleanComboBox.Builder(m_deviceName, null).jframe(jf1)
                    .autoStart(false).build();
        }

        // before Start
        invalidAttrConfigTest(widget, 0, aec, !autoStart);

        // clear
        widget.stop();
        jf1.dispose();
    }
View Full Code Here

        m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, currentBoolean));

        // Initialize the component
        initFirstDevice();
        final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(m_deviceName,
                attributeName).jframe(jf1).build();

        Sleeper.SECONDS.sleep(4);

        JComboBox comboBox = getComboBox(jf1);

        // Check if it has get the right value
        assertTrue("The component doesn't got the attribute value",
                waitBooleanValue(m_deviceProxy, attributeName, getBooleanValue(widget), 0));

        // Tooltip test (not working with ATK)
        // toolTiptest(m_deviceName + "/" + attributeName, comboBox);

        // switch the combo state
        currentBoolean = switchComboBoxState(widget);

        // .... check the device update
        assertTrue("write failed",
                waitBooleanValue(m_deviceProxy, attributeName, currentBoolean, 2000));

        comboBox.setFocusable(false);
        // Write into the attribute and check if the component is updated
        controlWriteBooleanAttUpdateComboBox(m_deviceProxy, widget, comboBox,
                attributeName, false, 1);

        // SetData test
        controlWriteBooleanValue(m_deviceProxy, widget, attributeName);

        // Write into attribute and check notification
        // TODO Must be done with IWidgetListener instead
        // controlReadBooleanValueChange(m_deviceProxy, widget, attributeName);

        // Write into component and check notification
        // TODO Must be done with IWidgetListener instead
        // controlBooleanValueChange(comboBox, widget);

        // txtField.setFocusable(true);
        // Passer en userEnabled � false
        widget.setUserEnabled(false);
        Sleeper.SECONDS.sleep(1);
        assertFalse("The ComboBox has to be disabled", comboBox.isEnabled());
       
        widget.setUserEnabled(true);
        Sleeper.SECONDS.sleep(1);
        assertTrue("The ComboBox has to be enabled", comboBox.isEnabled() );

        widget.stop();
        jf1.dispose();

    }
View Full Code Here

    protected void componentNotWritableTest() throws DevFailed {
        jf1 = new JFrame();

        initFirstDevice();

        final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(m_deviceName,
                "boolean_scalar_rw").userEnable(false).alarmEnable(false).jframe(jf1).build();

        Sleeper.SECONDS.sleep(3);
        // test we can't edit bean
        Assert.assertFalse("Invalid behavior, the combobox shouldn't be enabled", getComboBox(jf1)
                .isEnabled());

        // clean
        widget.stop();
        jf1.dispose();
    }
View Full Code Here

       
        boolean initialValue = true;
        m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, initialValue));
       
       
        final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(m_deviceName,
                attributeName).alarmEnable(false).jframe(jf1).confirmation(true).build();
        Sleeper.SECONDS.sleep(2);

        // Changement de state
        switchComboBoxState(widget);

        final JDialog fd = tth.findDialog("Confirmation");

        if (withCancel) {
            // init device
            tth.rejectDialog(fd);
            Assert.assertTrue("reject confirmation failed",
                    m_deviceProxy.read_attribute(attributeName).extractBoolean() == initialValue);
        }
        else {
            // Valider la confirmation
            validateConfirmation("");
            Assert.assertTrue("Write failed",
                    waitBooleanValue(m_deviceProxy, attributeName, !initialValue, 5000));
        }

        widget.stop();
        jf1.dispose();
    }
View Full Code Here

        // Initialiser le composant
        initFirstDevice();
        final String attributeName = "boolean_scalar_rw";
               
        final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(m_deviceName,
                attributeName).defaultValue(!isTrueLabel).jframe(jf1).build();
        Sleeper.SECONDS.sleep(2);
       
        if(isTrueLabel){
           
            String trueLabel = "TRUE_LABEL";
            widget.setTrueLabel(trueLabel);
                       
            m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, isTrueLabel));
            Sleeper.SECONDS.sleep(2);
           
            JComboBox combobox = getComboBox(jf1);
           
            Object selectedItem = combobox.getSelectedItem();
            String selectedValue = (String) selectedItem;
            Assert.assertTrue("The label for 'true' value is not correctly modified", trueLabel.equals(selectedValue));
           
        }
        else{
            String falseLabel = "FALSE_LABEL";
            widget.setFalseLabel(falseLabel);
                       
            m_deviceProxy.write_attribute(new DeviceAttribute(attributeName, isTrueLabel));
            Sleeper.SECONDS.sleep(2);
           
            JComboBox combobox = getComboBox(jf1);
           
            Object selectedItem = combobox.getSelectedItem();
            String selectedValue = (String) selectedItem;
            Assert.assertTrue("The label for 'false' value is not correctly modified", falseLabel.equals(selectedValue));
        }
       
        widget.stop();
        jf1.dispose();
    }   
View Full Code Here

  }

  private void invalidDeviceTest(final boolean autoStart) {
    jf1 = new JFrame();
    final AssertErrorConf aec = new AssertErrorConf(jf1);
    AttributeBooleanComboBox widget;

    // test invalid device Conf
    for (int i = 0; i < NB_INVALID_DEVICE_CONF_TEST; i++) {

      if (autoStart) {
        widget = new AttributeBooleanComboBox.Builder(m_deviceName,
            "boolean_scalar_rw").jframe(jf1).build();
      } else {
        // construct a widget with userEnable = true,alarmEnable =true,
        widget = new AttributeBooleanComboBox.Builder("",
            "boolean_scalar_rw").jframe(jf1).autoStart(false)
            .build();
      }

      // Configuration test
      invalidDeviceConfigTest(widget, i, aec, !autoStart);

      // clear
      jf1.remove(widget);
      widget.stop();

    }
    jf1.dispose();
  }
View Full Code Here

  private void invalidAttNameTest(final boolean autoStart) {
    jf1 = new JFrame();
    final AssertErrorConf aec = new AssertErrorConf(jf1);

    AttributeBooleanComboBox widget;

    if (autoStart) {
      widget = new AttributeBooleanComboBox.Builder(m_deviceName,
          "boolean_scalar_rw").jframe(jf1).build();
    } else {
      // construct a widget with userEnable = true,alarmEnable =true,
      widget = new AttributeBooleanComboBox.Builder(m_deviceName, null)
          .jframe(jf1).autoStart(false).build();
    }

    // before Start
    invalidAttrConfigTest(widget, 0, aec, !autoStart);

    // clear
    widget.stop();
    jf1.dispose();
  }
View Full Code Here

    m_deviceProxy.write_attribute(new DeviceAttribute(attributeName,
        currentBoolean));

    // Initialize the component
    initFirstDevice();
    final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(
        m_deviceName, attributeName).jframe(jf1).build();

    Sleeper.SECONDS.sleep(4);

    final JComboBox comboBox = getComboBox(jf1);

    // Check if it has get the right value
    assertTrue(
        "The component doesn't got the attribute value",
        waitBooleanValue(m_deviceProxy, attributeName,
            getBooleanValue(widget), 0));

    // Tooltip test (not working with ATK)
    // toolTiptest(m_deviceName + "/" + attributeName, comboBox);

    // switch the combo state
    currentBoolean = switchComboBoxState(widget);

    // .... check the device update
    assertTrue(
        "write failed",
        waitBooleanValue(m_deviceProxy, attributeName, currentBoolean,
            2000));

    comboBox.setFocusable(false);
    // Write into the attribute and check if the component is updated
    controlWriteBooleanAttUpdateComboBox(m_deviceProxy, widget, comboBox,
        attributeName, false, 1);

    // SetData test
    controlWriteBooleanValue(m_deviceProxy, widget, attributeName);

    // Write into attribute and check notification
    // TODO Must be done with IWidgetListener instead
    // controlReadBooleanValueChange(m_deviceProxy, widget, attributeName);

    // Write into component and check notification
    // TODO Must be done with IWidgetListener instead
    // controlBooleanValueChange(comboBox, widget);

    // txtField.setFocusable(true);
    // Passer en userEnabled � false
    widget.setUserEnabled(false);
    Sleeper.SECONDS.sleep(1);
    assertFalse("The ComboBox has to be disabled", comboBox.isEnabled());

    widget.setUserEnabled(true);
    Sleeper.SECONDS.sleep(1);
    assertTrue("The ComboBox has to be enabled", comboBox.isEnabled());

    widget.stop();
    jf1.dispose();

  }
View Full Code Here

  protected void componentNotWritableTest() throws DevFailed {
    jf1 = new JFrame();

    initFirstDevice();

    final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(
        m_deviceName, "boolean_scalar_rw").userEnable(false)
        .alarmEnable(false).jframe(jf1).build();

    Sleeper.SECONDS.sleep(3);
    // test we can't edit bean
    Assert.assertFalse(
        "Invalid behavior, the combobox shouldn't be enabled",
        getComboBox(jf1).isEnabled());

    // clean
    widget.stop();
    jf1.dispose();
  }
View Full Code Here

TOP

Related Classes of fr.soleil.globalscreen.tangowidget.attribute.AttributeBooleanComboBox$Builder

Copyright © 2018 www.massapicom. 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.