Package java.util

Examples of java.util.Date.compareTo()


        } catch (ParseException e) {
            throw new RuntimeException(e);
        }

        int c1 = date.compareTo(date1);
        int c2 = date.compareTo(date2);


        return (c1 >= 0 && c2 <= 0);
    }
View Full Code Here


            job = jpaService.execute(coordGetCmd);

            if (endTime != null) {
                Date d = job.getEndTime();
                if (d.compareTo(endTime) != 0) {
                    fail("Endtime is not updated properly job_end_time=" + d + ", expected_end_time=" + endTime);
                }

                CoordinatorJob.Status status = job.getStatus();
                if (status != CoordinatorJob.Status.RUNNING) {
View Full Code Here

                        fail("Pausetime is not updated properly job_pause_time=" + d + ", expected_pause_time="
                                + pauseTime);
                    }
                }
                else {
                    if (d.compareTo(pauseTime) != 0) {
                        fail("Pausetime is not updated properly job_pause_time=" + d + ", expected_pause_time="
                                + pauseTime);
                    }
                }
            }
View Full Code Here

        job.setLastActionNumber(lastActionNumber);
        // if the job endtime == action endtime, then set status of job to
        // succeeded
        // we dont need to materialize this job anymore
        Date jobEndTime = job.getEndTime();
        if (jobEndTime.compareTo(endTime) <= 0) {
            job.setStatus(CoordinatorJob.Status.SUCCEEDED);
            log.info("[" + job.getId() + "]: Update status from PREMATER to SUCCEEDED");
        }
        else {
            job.setStatus(CoordinatorJob.Status.RUNNING);
View Full Code Here

        LOG.info("[" + job.getId() + "]: Update status from " + job.getStatus() + " to RUNNING");
        job.setStatus(Job.Status.RUNNING);
        job.setPending();

        if (jobEndTime.compareTo(endMatdTime) <= 0) {
            LOG.info("[" + job.getId() + "]: all actions have been materialized, job status = " + job.getStatus()
                    + ", set pending to true");
            // set doneMaterialization to true when materialization is done
            job.setDoneMaterialization();
        }
View Full Code Here

                Date startTime = coordJob.getStartTime();
                long startTimeMilli = startTime.getTime();
                long endTimeMilli = startTimeMilli + (3600 * 1000);
                Date jobEndTime = coordJob.getEndTime();
                Date endTime = new Date(endTimeMilli);
                if (endTime.compareTo(jobEndTime) > 0) {
                    endTime = jobEndTime;
                }
                jobId = coordJob.getId();
                LOG.info("[" + jobId + "]: Update status to RUNNING");
                coordJob.setStatus(Job.Status.RUNNING);
View Full Code Here

                Date startTime = bundleBean.getStartTime();
                long startTimeMilli = startTime.getTime();
                long endTimeMilli = startTimeMilli + (3600 * 1000);
                Date jobEndTime = bundleBean.getEndTime();
                Date endTime = new Date(endTimeMilli);
                if (endTime.compareTo(jobEndTime) > 0) {
                    endTime = jobEndTime;
                }
                jobId = bundleBean.getId();
                LOG.info("[" + jobId + "]: Update status to PREP");
                bundleBean.setStatus(Job.Status.PREP);
View Full Code Here

        Iterator iter = query_result.iterator();
        int cnt = 0;
        while( iter.hasNext() ){
            AllTypes obj = (AllTypes) iter.next();
            Date val = obj.getDate();
            boolean correct_value = valueOnLeft ? (value.compareTo(val) > 0) : (val.compareTo(value) > 0);
            if( !correct_value ){
                fail(ASSERTION_FAILED, "JDOQL Greater Than test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter);
            }
            cnt++;
        }
View Full Code Here

        Iterator iter = query_result.iterator();
        int cnt = 0;
        while( iter.hasNext() ){
            AllTypes obj = (AllTypes) iter.next();
            Date val = obj.getDate();
            boolean correct_value = valueOnLeft ? (value.compareTo(val) >= 0) : (val.compareTo(value) >= 0);
            if( !correct_value ){
                fail(ASSERTION_FAILED, "JDOQL GreaterThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter);
            }
            cnt++;
        }
View Full Code Here

        Iterator iter = query_result.iterator();
        int cnt = 0;
        while( iter.hasNext() ){
            AllTypes obj = (AllTypes) iter.next();
            Date val = obj.getDate();
            boolean correct_value = valueOnLeft ? (value.compareTo(val) < 0) : (val.compareTo(value) < 0);
            if( !correct_value ){
                fail(ASSERTION_FAILED, "JDOQL LessThan test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter);
            }
            cnt++;
        }
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.