Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.FrameFixture.label()


        frame.setSize(400, 30);
        frame.validate();
        frameFixture.show();

        assert frameFixture.label("Population").text().equals("N/A") : "Wrong initial text for population label.";
        assert frameFixture.label("Elitism").text().equals("N/A") : "Wrong initial text for elitism label.";
        assert frameFixture.label("Generations").text().equals("N/A") : "Wrong initial text for generations label.";
        assert frameFixture.label("Time").text().equals("N/A") : "Wrong initial text for elapsed time label.";

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
View Full Code Here


        frame.validate();
        frameFixture.show();

        assert frameFixture.label("Population").text().equals("N/A") : "Wrong initial text for population label.";
        assert frameFixture.label("Elitism").text().equals("N/A") : "Wrong initial text for elitism label.";
        assert frameFixture.label("Generations").text().equals("N/A") : "Wrong initial text for generations label.";
        assert frameFixture.label("Time").text().equals("N/A") : "Wrong initial text for elapsed time label.";

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
View Full Code Here

        frameFixture.show();

        assert frameFixture.label("Population").text().equals("N/A") : "Wrong initial text for population label.";
        assert frameFixture.label("Elitism").text().equals("N/A") : "Wrong initial text for elitism label.";
        assert frameFixture.label("Generations").text().equals("N/A") : "Wrong initial text for generations label.";
        assert frameFixture.label("Time").text().equals("N/A") : "Wrong initial text for elapsed time label.";

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
        assert frameFixture.label("Elitism").text().equals("5x1") : "Wrong value for elitism label.";
View Full Code Here

        assert frameFixture.label("Generations").text().equals("N/A") : "Wrong initial text for generations label.";
        assert frameFixture.label("Time").text().equals("N/A") : "Wrong initial text for elapsed time label.";

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
        assert frameFixture.label("Elitism").text().equals("5x1") : "Wrong value for elitism label.";
        // Generation count is number + 1 (because generations start at zero).
        assert frameFixture.label("Generations").text().equals("1") : "Wrong value for generations label.";
        assert frameFixture.label("Time").text().equals("10:10:10") : "Wrong value for elapsed time label.";
    }
View Full Code Here

        assert frameFixture.label("Time").text().equals("N/A") : "Wrong initial text for elapsed time label.";

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
        assert frameFixture.label("Elitism").text().equals("5x1") : "Wrong value for elitism label.";
        // Generation count is number + 1 (because generations start at zero).
        assert frameFixture.label("Generations").text().equals("1") : "Wrong value for generations label.";
        assert frameFixture.label("Time").text().equals("10:10:10") : "Wrong value for elapsed time label.";
    }
View Full Code Here

        statusBar.islandPopulationUpdate(0, new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 36610000));
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
        assert frameFixture.label("Elitism").text().equals("5x1") : "Wrong value for elitism label.";
        // Generation count is number + 1 (because generations start at zero).
        assert frameFixture.label("Generations").text().equals("1") : "Wrong value for generations label.";
        assert frameFixture.label("Time").text().equals("10:10:10") : "Wrong value for elapsed time label.";
    }

   
    @Test(groups = "display-required") // Will fail if run in a headless environment.
View Full Code Here

        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 50, 1, 0, 36610000));
        assert frameFixture.label("Population").text().equals("5x10") : "Wrong value for popluation label.";
        assert frameFixture.label("Elitism").text().equals("5x1") : "Wrong value for elitism label.";
        // Generation count is number + 1 (because generations start at zero).
        assert frameFixture.label("Generations").text().equals("1") : "Wrong value for generations label.";
        assert frameFixture.label("Time").text().equals("10:10:10") : "Wrong value for elapsed time label.";
    }

   
    @Test(groups = "display-required") // Will fail if run in a headless environment.
    public void testTimeFormat()
View Full Code Here

        frameFixture.show();

        // Previous test checks two-digit field values, this test checks that single-digit
        // values and zeros are correctly padded.
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 1000));
        assert frameFixture.label("Time").text().equals("00:00:01");
    }

}
View Full Code Here

        frame.validate();
        frame.setVisible(true);

        JSlider slider = frameFixture.slider().component();
        assert slider.getValue() == 75 : "Wrong slider position: " + slider.getValue();
        String displayedValue = frameFixture.label().text();
        assert displayedValue.equals("0.75") : "Wrong value displayed: " + displayedValue;


        frameFixture.slider().slideTo(80); // 80 ticks is a probability of 0.8.
        robot.waitForIdle();
View Full Code Here

        frameFixture.slider().slideTo(80); // 80 ticks is a probability of 0.8.
        robot.waitForIdle();
        double probability = control.getNumberGenerator().nextValue().doubleValue();
        assert probability == 0.8 : "Wrong probability: " + probability;
        displayedValue = frameFixture.label().text();
        assert displayedValue.equals("0.80") : "Wrong value displayed: " + displayedValue;
    }


    @Test(dependsOnMethods = "testSlider",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.