Examples of Instant


Examples of org.joda.time.Instant

  public void testDoNotGetCommandIfNotLastResponse() throws Exception {
    CapturedBrowsers browsers = new CapturedBrowsers(new BrowserIdStrategy(new MockTime(0)));
    String id = "1";
    SlaveBrowser slave =
        new SlaveBrowser(new TimeImpl(), id, new BrowserInfo(), 20, null, CaptureHandler.QUIRKS,
            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    slave.createCommand("awaitingResponse");
View Full Code Here

Examples of org.joda.time.Instant

  public void testFilesLoadedAreAddedToTheBrowserFileSet() throws Exception {
    CapturedBrowsers browsers = new CapturedBrowsers(new BrowserIdStrategy(new MockTime(0)));
    String id = "1";
    SlaveBrowser slave =
        new SlaveBrowser(new TimeImpl(), id, new BrowserInfo(), 20, null, CaptureHandler.QUIRKS,
            RunnerType.CLIENT, BrowserState.CAPTURED, new Instant(0));

    browsers.addSlave(slave);
    BrowserQueryResponseHandler handler =
        new BrowserQueryResponseHandler(null, null, browsers, streamedResponses);
    List<FileResult> fileResults = new LinkedList<FileResult>();
View Full Code Here

Examples of org.joda.time.Instant

        System.out.println("Instant");
        System.out.println("=======");
        System.out.println("Instant stores a point in the datetime continuum as millisecs from 1970-01-01T00:00:00Z");
        System.out.println("Instant is immutable and thread-safe");
        System.out.println("                      in = new Instant()");
        Instant in = new Instant();
        System.out.println("Millisecond time:     in.getMillis():           " + in.getMillis());
        System.out.println("ISO string version:   in.toString():            " + in.toString());
        System.out.println("ISO chronology:       in.getChronology():       " + in.getChronology());
        System.out.println("UTC time zone:        in.getDateTimeZone():     " + in.getZone());
        System.out.println("Change millis:        in.withMillis(0):         " + in.withMillis(0L));
        System.out.println("");
        System.out.println("Convert to Instant:   in.toInstant():           " + in.toInstant());
        System.out.println("Convert to DateTime:  in.toDateTime():          " + in.toDateTime());
        System.out.println("Convert to MutableDT: in.toMutableDateTime():   " + in.toMutableDateTime());
        System.out.println("Convert to Date:      in.toDate():              " + in.toDate());
        System.out.println("");
        System.out.println("                      in2 = new Instant(in.getMillis() + 10)");
        Instant in2 = new Instant(in.getMillis() + 10);
        System.out.println("Equals ms and chrono: in.equals(in2):           " + in.equals(in2));
        System.out.println("Compare millisecond:  in.compareTo(in2):        " + in.compareTo(in2));
        System.out.println("Compare millisecond:  in.isEqual(in2):          " + in.isEqual(in2));
        System.out.println("Compare millisecond:  in.isAfter(in2):          " + in.isAfter(in2));
        System.out.println("Compare millisecond:  in.isBefore(in2):         " + in.isBefore(in2));
View Full Code Here

Examples of org.joda.time.Instant

    public void actOnPostponeRequired(Mail mail, PostponeException e)
            throws LocalMailSystemException {
        mail.postpones++;
        if (mail.postpones <= 3) {
            Instant newScheduleDate =
                    new DateTime().plusSeconds(e.getRecommendedDelay())
                            .toInstant();
            mail.scheduleDate = newScheduleDate.toDate();
            retryTransmitter.transmit(mail);
            logger.debug("Delivery must be postponed to all hosts. "
                    + "Rescheduling the attempt. This is the " + mail.postpones
                    + ". postponing of this delivery attempt.");
View Full Code Here

Examples of org.joda.time.Instant

        private void rescheduleTemporaryFailures()
                throws LocalMailSystemException {
            if (transientFailures.isEmpty())
                return;
            Period waitingPeriod = retryPeriods.get(mail.deliveryAttempts - 1);
            Instant newScheduleDate =
                    new DateTime().plus(waitingPeriod).toInstant();
            mail.scheduleDate = newScheduleDate.toDate();
            mail.recipients = calculateTemporarilyRejectedRecipientList();
            retryTransmitter.transmit(mail);
            logger.debug("Transient failure, the mail is scheduled for a "
                    + (mail.deliveryAttempts + 1) + ". attempt "
                    + waitingPeriod + " later on " + newScheduleDate);
View Full Code Here

Examples of org.joda.time.Instant

        localDomains.addDomain("example.net");
    }

    @Before
    public void setup() {
        DateTimeUtils.setCurrentMillisFixed(new Instant("2011-07-21T12:00Z")
                .getMillis());
    }
View Full Code Here

Examples of org.opengis.temporal.Instant

        String frameName = (String) node.getAttributeValue("frame", "#ISO-8601");
        NamedIdentifier frameID = new NamedIdentifier(Citations.CRS, frameName);
        TemporalReferenceSystem frame = new DefaultTemporalReferenceSystem(frameID, null);

        Instant begining = new DefaultInstant((Position) node.getChild("beginPosition").getValue());
        Instant ending = new DefaultInstant((Position) node.getChild("endPosition").getValue());

        Period timePeriod = new DefaultPeriod(begining, ending);

        return timePeriod;
    }
View Full Code Here

Examples of org.threeten.bp.Instant

    @Test
    public void test_parse_fromField_InstantSeconds() {
        DateTimeFormatter fmt = new DateTimeFormatterBuilder()
            .appendValue(INSTANT_SECONDS).toFormatter();
        TemporalAccessor acc = fmt.parse("86402");
        Instant expected = Instant.ofEpochSecond(86402);
        assertEquals(acc.isSupported(INSTANT_SECONDS), true);
        assertEquals(acc.isSupported(NANO_OF_SECOND), true);
        assertEquals(acc.isSupported(MICRO_OF_SECOND), true);
        assertEquals(acc.isSupported(MILLI_OF_SECOND), true);
        assertEquals(acc.getLong(INSTANT_SECONDS), 86402L);
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.