Package net.greghaines.jesque.utils

Examples of net.greghaines.jesque.utils.CompositeDateFormat


        Assert.assertNotNull(workerInfo.getQueues());
        Assert.assertEquals(3, workerInfo.getQueues().size());
        Assert.assertTrue(workerInfo.getQueues().containsAll(Arrays.asList("bar", "baz", "qux")));
        Assert.assertEquals(WorkerInfo.State.IDLE, workerInfo.getState());
        Assert.assertNull(workerInfo.getStatus());
        Assert.assertEquals(new CompositeDateFormat().parse(startedStr), workerInfo.getStarted());
        Assert.assertEquals((Long)2L, workerInfo.getFailed());
        Assert.assertEquals((Long)6L, workerInfo.getProcessed());
    }
View Full Code Here


        date = cal.getTime();
    }

    @Test
    public void testParse_ISO8601() throws ParseException {
        final DateFormat dateFormat = new CompositeDateFormat();
        // yyyy-MM-dd'T'HH:mm:ss.SSSZ
        Assert.assertEquals(date, dateFormat.parse("2013-03-07T21:26:05.234-0500"));
        Assert.assertEquals(date, dateFormat.parse("2013-03-08T02:26:05.234+0000"));
    }
View Full Code Here

        Assert.assertEquals(date, dateFormat.parse("2013-03-08T02:26:05.234+0000"));
    }

    @Test
    public void testParse_PHP() throws ParseException {
        final DateFormat dateFormat = new CompositeDateFormat();
        // EEE MMM dd HH:mm:ss z yyyy
        // Since PHP's format is missing milliseconds, see if they're within a
        // second of each other
        assertWithinASecond(date, dateFormat.parse("Thu March 07 21:26:05 GMT-05:00 2013"));
        assertWithinASecond(date, dateFormat.parse("Fri March 08 02:26:05 GMT 2013"));
    }
View Full Code Here

        assertWithinASecond(date, dateFormat.parse("Fri March 08 02:26:05 GMT 2013"));
    }

    @Test
    public void testParse_Ruby() throws ParseException {
        final DateFormat dateFormat = new CompositeDateFormat();
        // yyyy-MM-dd HH:mm:ss Z
        // Since Ruby's formats are missing milliseconds, see if they're within
        // a second of each other
        assertWithinASecond(date, dateFormat.parse("2013-03-07 21:26:05 -0500"));
        assertWithinASecond(date, dateFormat.parse("2013-03-08 02:26:05 +0000"));
        assertWithinASecond(date, dateFormat.parse("2013/03/07 21:26:05 -0500"));
        assertWithinASecond(date, dateFormat.parse("2013/03/08 02:26:05 +0000"));
    }
View Full Code Here

        assertWithinASecond(date, dateFormat.parse("2013/03/08 02:26:05 +0000"));
    }

    @Test
    public void testFormat() {
        final DateFormat dateFormat = new CompositeDateFormat();
        Assert.assertEquals("2013-03-08T02:26:05.234+0000", dateFormat.format(date));
    }
View Full Code Here

        } else {
            workerInfo.setState(WorkerInfo.State.IDLE);
        }
        final String startedStr = jedis.get(key(WORKER, workerName, STARTED));
        if (startedStr != null) {
            workerInfo.setStarted(new CompositeDateFormat().parse(startedStr));
        }
        final String failedStr = jedis.get(key(STAT, FAILED, workerName));
        if (failedStr != null) {
            workerInfo.setFailed(Long.parseLong(failedStr));
        } else {
View Full Code Here

TOP

Related Classes of net.greghaines.jesque.utils.CompositeDateFormat

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.