Package fr.soleil.globalscreen.tangowidget.attribute

Examples of fr.soleil.globalscreen.tangowidget.attribute.AttributeScalarFileBrowserButton


        attributeName = "string_scalar_rw";
        initFirstDevice();

        // create widget
        jf1 = new JFrame();
        final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
                m_deviceName, attributeName).userEnable(false).jframe(jf1).build();
        Sleeper.SECONDS.sleep(2);

        // assert bean is not editable
        Assert.assertFalse("bean shouldn't be editable", getButton(jf1).isEnabled());

        // assert bean is updated if value change on device
        writeOnDeviceAndCheckUpdate(m_deviceProxy, attributeName, "test not writable");

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


        attributeName = "string_scalar_rw";
        initFirstDevice();

        // create widget
        jf1 = new JFrame();
        final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
                m_deviceName, attributeName).confirmation(true).jframe(jf1).build();
        Sleeper.SECONDS.sleep(2);

        // select the file
        final String fich = enterFilePath(jf1);

        if (withCancel) { // test refuse confirmation
            final JDialog fd = tth.findDialog("Confirmation");
            tth.rejectDialog(fd);

            // assert device and bean values are not changed
            Assert.assertFalse("reject confirmation failed",
                    m_deviceProxy.read_attribute(attributeName).extractString().equals(fich)
                            && fich.equals(getButton(jf1).getText()));

        }
        else {// test acceptConfirmation

            validateConfirmation("");
            // check device is updated
            Sleeper.SECONDS.sleep(2);
            Assert.assertTrue("label of bean is not same that attribute", m_deviceProxy
                    .read_attribute(attributeName).extractString().equals(getButton(jf1).getText()));
        }

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

        attributeName = "string_scalar_rw";
        initFirstDevice();

        // create widget
        final JFrame jf1 = new JFrame();
        final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
                m_deviceName, attributeName).jframe(jf1).build();
        Sleeper.SECONDS.sleep(2);

        // assert same value on device and bean
        Assert.assertEquals(m_deviceProxy.read_attribute(attributeName).extractString(),
                getButton(jf1).getText());

        // assert bean is updated if value change on device
        writeOnDeviceAndCheckUpdate(m_deviceProxy, attributeName, "comonent init test");

        // assert select File works
        final String path = enterFilePath(jf1);
        Sleeper.SECONDS.sleep(2);
        Assert.assertTrue(
                "select file doesn't works",
                path.equals(m_deviceProxy.read_attribute(attributeName).extractString())
                        && path.equals(getButton(jf1).getText()));

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

    attributeName = "string_scalar_rw";
    initFirstDevice();

    // create widget
    jf1 = new JFrame();
    final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
        m_deviceName, attributeName).userEnable(false).jframe(jf1)
        .build();
    Sleeper.SECONDS.sleep(2);

    // assert bean is not editable
    Assert.assertFalse("bean shouldn't be editable", getButton(jf1)
        .isEnabled());

    // assert bean is updated if value change on device
    writeOnDeviceAndCheckUpdate(m_deviceProxy, attributeName,
        "test not writable");

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

    attributeName = "string_scalar_rw";
    initFirstDevice();

    // create widget
    jf1 = new JFrame();
    final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
        m_deviceName, attributeName).confirmation(true).jframe(jf1)
        .build();
    Sleeper.SECONDS.sleep(2);

    // select the file
    final String fich = enterFilePath(jf1);

    if (withCancel) { // test refuse confirmation
      final JDialog fd = tth.findDialog("Confirmation");
      tth.rejectDialog(fd);

      // assert device and bean values are not changed
      Assert.assertFalse("reject confirmation failed", m_deviceProxy
          .read_attribute(attributeName).extractString().equals(fich)
          && fich.equals(getButton(jf1).getText()));

    } else {// test acceptConfirmation

      validateConfirmation("");
      // check device is updated
      Sleeper.SECONDS.sleep(2);
      Assert.assertTrue("label of bean is not same that attribute",
          m_deviceProxy.read_attribute(attributeName).extractString()
              .equals(getButton(jf1).getText()));
    }

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

    attributeName = "string_scalar_rw";
    initFirstDevice();

    // create widget
    final JFrame jf1 = new JFrame();
    final AttributeScalarFileBrowserButton widget = new AttributeScalarFileBrowserButton.Builder(
        m_deviceName, attributeName).jframe(jf1).build();
    Sleeper.SECONDS.sleep(2);

    // assert same value on device and bean
    Assert.assertEquals(m_deviceProxy.read_attribute(attributeName)
        .extractString(), getButton(jf1).getText());

    // assert bean is updated if value change on device
    writeOnDeviceAndCheckUpdate(m_deviceProxy, attributeName,
        "comonent init test");

    // assert select File works
    final String path = enterFilePath(jf1);
    Sleeper.SECONDS.sleep(2);
    Assert.assertTrue(
        "select file doesn't works",
        path.equals(m_deviceProxy.read_attribute(attributeName)
            .extractString())
            && path.equals(getButton(jf1).getText()));

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

TOP

Related Classes of fr.soleil.globalscreen.tangowidget.attribute.AttributeScalarFileBrowserButton

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.