Examples of roll()


Examples of java.util.Calendar.roll()

    @Test
    public void testRetentionCoords() throws FalconException {
        org.apache.falcon.entity.v0.feed.Cluster cluster = FeedHelper.getCluster(feed, srcCluster.getName());
        final Calendar instance = Calendar.getInstance();
        instance.roll(Calendar.YEAR, 1);
        cluster.getValidity().setEnd(instance.getTime());

        OozieFeedMapper feedMapper = new OozieFeedMapper(feed);
        List<COORDINATORAPP> coords = feedMapper.getCoordinators(srcCluster, new Path("/projects/falcon/"));
        COORDINATORAPP coord = coords.get(0);
View Full Code Here

Examples of java.util.Calendar.roll()

    otherDate.add(Calendar.YEAR, 1);
    assertEquals(0, taskService.createTaskQuery().dueDate(otherDate.getTime()).count());

    Calendar priorDate = Calendar.getInstance();
    priorDate.setTime(dueDate);
    priorDate.roll(Calendar.YEAR, -1);
    assertEquals(1, taskService.createTaskQuery().dueAfter(priorDate.getTime())
        .count());

    assertEquals(1, taskService.createTaskQuery()
        .dueBefore(otherDate.getTime()).count());
View Full Code Here

Examples of java.util.Calendar.roll()

        return df;
    }

    private static long calculateExpiryDate() {
        Calendar cal = Calendar.getInstance();
        cal.roll(Calendar.MONTH, 1);
        return cal.getTime().getTime();
    }

    public static void fastChannelCopy(final InputStream in, final OutputStream out) throws IOException {
View Full Code Here

Examples of java.util.Calendar.roll()

  @Test
  public void shouldntDoNothingWhenFinalDateNotExpired() {

    Calendar calendar = Calendar.getInstance();
    calendar.roll(Calendar.DAY_OF_MONTH, 1); // rest one day for finish the sprint

    Sprint sprint = new Sprint();
    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

        if (request instanceof HttpServletRequest) {
            filterChain.doFilter(request, response);
            HttpServletResponse httpResponse = (HttpServletResponse) response;
            httpResponse.setHeader("Pragma", "public");
            Calendar cal = new GregorianCalendar();
            cal.roll(Calendar.SECOND, seconds);
            httpResponse.setHeader("Cache-Control", "PUBLIC, max-age=" + seconds + ", must-revalidate");
            httpResponse.setHeader("Expires", httpDateFormat.format(cal.getTime()));
        }
    }
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

    String[] months = new String[12];
    SimpleDateFormat dateFmt = new SimpleDateFormat("MMM");
    boolean isComplete = false;
    for(GregorianCalendar iDate = new GregorianCalendar(1970, Calendar.JANUARY, 1);
    !isComplete ;
    iDate.roll(Calendar.MONTH, true)) {
      months[iDate.get(Calendar.MONTH)] = dateFmt.format(new Date(iDate.getTimeInMillis()));
      isComplete = iDate.get(Calendar.MONTH) == Calendar.DECEMBER;
    }
    _monthField = new JComboBox(months);
    add(_monthField);
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 7, cal.get(Calendar.DATE));
       
        cal.roll(Calendar.WEEK_OF_YEAR, true);
        assertEquals("Wrong year: " + cal.getTime(), 1994, cal
                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 14, cal.get(Calendar.DATE));
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 14, cal.get(Calendar.DATE));
       
        cal.roll(Calendar.WEEK_OF_YEAR, false);
        assertEquals("Wrong year: " + cal.getTime(), 1994, cal
                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 7, cal.get(Calendar.DATE));
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 7, cal.get(Calendar.DATE));
       
        cal.roll(Calendar.WEEK_OF_YEAR, false);
        assertEquals("Wrong year: " + cal.getTime(), 1994, cal
                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.DECEMBER, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 30, cal.get(Calendar.DATE));
View Full Code Here

Examples of java.util.GregorianCalendar.roll()

                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.DECEMBER, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 30, cal.get(Calendar.DATE));
       
        cal.roll(Calendar.WEEK_OF_YEAR, false);
        assertEquals("Wrong year: " + cal.getTime(), 1994, cal
                .get(Calendar.YEAR));
        assertEquals("Wrong month: " + cal.getTime(), Calendar.DECEMBER, cal
                .get(Calendar.MONTH));
        assertEquals("Wrong date: " + cal.getTime(), 23, cal.get(Calendar.DATE));
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.