Package org.apache.qpid.disttest.charting.definition

Examples of org.apache.qpid.disttest.charting.definition.SeriesDefinition


                    @Override
                    public void build(List<SeriesDefinition> seriesDefinitions)
                    {
                        for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
                        {
                            SeriesDefinition seriesDefinition = iterator.next();
                            _dataPointCallback.beginSeries(seriesDefinition);
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{1d, 1d, 0.5d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{2d, 2d, 0.4d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{4d, 4d, 0.3d});
                            _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{5d, 5d, 0.2d});
View Full Code Here


        @Override
        public void build(List<SeriesDefinition> seriesDefinitions)
        {
            for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
            {
                SeriesDefinition seriesDefinition = iterator.next();
                _dataPointCallback.beginSeries(seriesDefinition);
                _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{1d, 1d});
                _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{2d, 2d});
                _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{4d, 4d});
                _dataPointCallback.addDataPointToSeries(seriesDefinition, new Object[]{5d, 5d});
View Full Code Here

    }

    public void testBuildOneSeries() throws Exception
    {
        createTestCsvIn(_testTempDir);
        SeriesDefinition seriesDefinition = createTestSeriesDefinition();

        _seriesBuilder.build(Collections.singletonList(seriesDefinition));

        verify(_seriesWalkerCallback).beginSeries(seriesDefinition);
        verify(_seriesWalkerCallback).addDataPointToSeries(seriesDefinition, new Object[]{"elephant", "2"});
View Full Code Here

        csvWriter.close();
    }

    private SeriesDefinition createTestSeriesDefinition()
    {
        SeriesDefinition definition = new SeriesDefinition(TEST_SERIES_1_SELECT_STATEMENT, TEST_SERIES_1_LEGEND, _testTempDir.getAbsolutePath());
        return definition;
    }
View Full Code Here

    @Override
    public Dataset build(List<SeriesDefinition> seriesDefinitions)
    {
        for (Iterator<SeriesDefinition> iterator = seriesDefinitions.iterator(); iterator.hasNext();)
        {
            SeriesDefinition series = iterator.next();
            buildDataSetForSingleSeries(series);
        }
        return _datasetHolder.getPopulatedDataset();
    }
View Full Code Here

{
    public void applySeriesAppearance(JFreeChart chart, List<SeriesDefinition> seriesDefinitions, SeriesStrokeAndPaintApplier strokeAndPaintApplier)
    {
        for (int i = 0; i < seriesDefinitions.size(); i++)
        {
            SeriesDefinition seriesDefinition = seriesDefinitions.get(i);
            if (seriesDefinition.getSeriesColourName() != null)
            {
                strokeAndPaintApplier.setSeriesPaint(i, ColorFactory.toColour(seriesDefinition.getSeriesColourName()), chart);
            }
            if (seriesDefinition.getStrokeWidth() != null)
            {
                // Negative width used to signify dashed
                boolean dashed = seriesDefinition.getStrokeWidth() < 0;
                float width = Math.abs(seriesDefinition.getStrokeWidth());
                BasicStroke stroke = buildStrokeOfWidth(width, dashed);
                strokeAndPaintApplier.setSeriesStroke(i, stroke, chart);
            }
        }
    }
View Full Code Here

public class JdbcUrlGeneratorTest extends QpidTestCase
{
    public void testGetJdbcUrlWithoutProvidingAUrlReturnsCsvUrlWithCorrectDirectory()
    {
        JdbcUrlGenerator jdbcUrlGenerator = new JdbcUrlGenerator(null);
        SeriesDefinition seriesDefinition = mock(SeriesDefinition.class);
        when(seriesDefinition.getSeriesDirectory()).thenReturn("mydir");

        String jdbcUrl = jdbcUrlGenerator.getJdbcUrl(seriesDefinition);

        assertEquals("jdbc:relique:csv:mydir", jdbcUrl);
    }
View Full Code Here

    public void testGetJdbcUrlReturnsProvidedUrl()
    {
        String urlTemplate = "urlTemplate";
        JdbcUrlGenerator jdbcUrlGenerator = new JdbcUrlGenerator(urlTemplate);
        SeriesDefinition seriesDefinition = mock(SeriesDefinition.class);

        String jdbcUrl = jdbcUrlGenerator.getJdbcUrl(seriesDefinition);

        assertEquals(urlTemplate, jdbcUrl);
    }
View Full Code Here

    public void testGetJdbcUrlThrowsExceptionIfUrlProvidedAndSeriesDirectorySpecified()
    {
        String urlTemplate = "urlTemplate";
        JdbcUrlGenerator jdbcUrlGenerator = new JdbcUrlGenerator(urlTemplate);
        SeriesDefinition seriesDefinition = mock(SeriesDefinition.class);
        when(seriesDefinition.getSeriesDirectory()).thenReturn("mydir");

        try
        {
            jdbcUrlGenerator.getJdbcUrl(seriesDefinition);
            fail("Expected exception not thrown");
View Full Code Here

    }

    public void testGetJdbcUrlThrowsExceptionWithoutAProvidedUrlOrSeriesDirectory()
    {
        JdbcUrlGenerator jdbcUrlGenerator = new JdbcUrlGenerator(null);
        SeriesDefinition seriesDefinition = mock(SeriesDefinition.class);
        when(seriesDefinition.getSeriesDirectory()).thenReturn(null);

        try
        {
            jdbcUrlGenerator.getJdbcUrl(seriesDefinition);
            fail("Expected exception not thrown");
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.charting.definition.SeriesDefinition

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.