Java 类org.apache.commons.lang3.time.FastDateFormat 实例源码

项目:Hydrograph    文件:DelimitedAndFixedWidthHelper.java   
public static Object[] getFields(
        StructType schema, String line,
        String[] lengthsAndDelimiters, String[] lengthsAndDelimitersType,
        boolean safe, String quote, List<FastDateFormat> dateFormats)  throws Exception{

    if (!line.equals("")) {

        try {
            String[] tokens = generateTokensFromRawData(line,
                    lengthsAndDelimiters, lengthsAndDelimitersType, quote);
            return coerceParsedTokens(line, tokens, safe, schema, dateFormats);
        } catch (Exception e) {
            throw new RuntimeException("Exception while generating tokens.\nLine being parsed: "
                    + line + "\nFields: " + getFieldsFromSchema(schema,dateFormats.size())
                    + "\nLengths and delimiters in scheme: "
                    + Arrays.toString(lengthsAndDelimiters)
                    + "\nDatatypes in scheme: "
                    + getTypesFromSchema(schema,dateFormats.size())
                    + "\nSafe was set to: " + safe + "\n Error being -> " ,e);
        }
    } else {
        return new Object[lengthsAndDelimiters.length];
    }
}
项目:Hydrograph    文件:DelimitedAndFixedWidthHelper.java   
private static Object[] coerceParsedTokens(
        String line, Object[] tokens, boolean safe,
        StructType schema, List<FastDateFormat> dateFormats)  throws Exception {

    Object[] result = new Object[tokens.length];
    for (int i = 0; i < tokens.length; i++) {
        try {
            tokens[i] = !schema.apply(i).dataType().simpleString().equalsIgnoreCase("String") ? tokens[i].toString().trim() : tokens[i];
            result[i] = TypeCast.inputValue(tokens[i].toString(), schema.apply(i).dataType(),
                    schema.apply(i).nullable(), "null", true, dateFormats.get(i));
        } catch (Exception exception) {
            result[i] = null;
            if (!safe) {
                throw new RuntimeException(getSafeMessage(tokens[i], i, schema) + "\n Line being parsed => " + line,exception);
            }
        }
    }
    tokens = result;
    return tokens;
}
项目:datax    文件:ColumnCast.java   
static void init(final Configuration configuration) {
    StringCast.datetimeFormat = configuration.getString(
            "common.column.datetimeFormat", StringCast.datetimeFormat);
    StringCast.dateFormat = configuration.getString(
            "common.column.dateFormat", StringCast.dateFormat);
    StringCast.timeFormat = configuration.getString(
            "common.column.timeFormat", StringCast.timeFormat);
    StringCast.extraFormats = configuration.getList(
            "common.column.extraFormats", Collections.<String>emptyList(), String.class);

    StringCast.timeZone = configuration.getString("common.column.timeZone",
            StringCast.timeZone);
    StringCast.timeZoner = TimeZone.getTimeZone(StringCast.timeZone);

    StringCast.datetimeFormatter = FastDateFormat.getInstance(
            StringCast.datetimeFormat, StringCast.timeZoner);
    StringCast.dateFormatter = FastDateFormat.getInstance(
            StringCast.dateFormat, StringCast.timeZoner);
    StringCast.timeFormatter = FastDateFormat.getInstance(
            StringCast.timeFormat, StringCast.timeZoner);

    StringCast.encoding = configuration.getString("common.column.encoding",
            StringCast.encoding);
}
项目:maxwell-sink    文件:LogUtil.java   
public static void backUp(ExportRowMap exportRowMap) {
    // 按照终端过滤,不同的终端写不同的文件
    Map<String, Object> data = exportRowMap.getData();
    String sn = StrUtils.valueOf(data.get("sn"));
    if (StringUtils.isEmpty(sn)) {
        return;
    }
    File termBackupFile = new File(TERMINAL_BACKUP_PATH + sn);
    String timeStr = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:sss").format(new Date());
    String rowMapStr = exportRowMap.toString();
    String result = new StringBuilder().append(timeStr).append(" ").append(rowMapStr).append("\n").toString();
    try {
        FileUtils.write(termBackupFile, result, Charset.defaultCharset(), true);
    } catch (IOException e) {
        log.error(e.getMessage(), e);
        log.info(result);
    }
}
项目:slf4j-json-logger    文件:StandardJsonLoggerExceptionTest.java   
@Before
public void setup() {
  this.slf4jLogger = mock(org.slf4j.Logger.class);

  // Use a special GSON configuration that throws exceptions at the right time for the test.
  this.gson = new GsonBuilder().registerTypeAdapterFactory(new TestTypeAdapterFactory()).create();

  this.formatter = FastDateFormat.getInstance(dateFormatString);

  logger = new StandardJsonLogger(slf4jLogger, formatter, gson, null, null, null) {
    @Override
    public void log() {
      logMessage = formatMessage("INFO");
    }

  };
}
项目:photosOpen    文件:DataListFilter.java   
/**
 * Default String contains filter processing.
 *
 * @param item          Photo to consider for inclusion.
 * @param filterProperty Filter property name used to determine which photo field to compare with.
 * @param filterValue    Value of the filter.
 * @return True if photo should be included in the resultant list to display.
 */
protected boolean filterByDate(T item, String filterProperty, Object filterValue) {
    FastDateFormat dateInstance = FastDateFormat.getInstance(MM_DD_YY_PATTERN);

    try {
        Object fieldValue = PropertyUtils.getNestedProperty(item, filterProperty);
        Date theDate = (Date) fieldValue;
        String dateStr = dateInstance.format((Date) fieldValue);

        if (filterValue == null || (dateInstance.format((Date) fieldValue).contains(filterValue.toString()))) {
            return true;
        }
    } catch (Exception e) {
        log.error("Failed to filter. ", e);
    }

    return false;
}
项目:kayura-activiti    文件:DateTimeFormatTest.java   
@Test
public void convertTest() {

    Date now = new Date();
    String source = now.toString();
    System.out.println(source);

    FastDateFormat chinaDate = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
    FastDateFormat sourceDate = FastDateFormat.getInstance("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US);

    try {
        Date object = sourceDate.parse(source);
        System.out.println(object);

        String format = chinaDate.format(object);
        System.out.println(format);

    } catch (ParseException e) {
        e.printStackTrace();
    }
}
项目:blog-java2    文件:MyFunction.java   
public String formatDate(Date date) {

        if (date == null) {
            return "";
        }

        String fmt = "yyyy/MM/dd HH:mm";
        Locale locale = Locale.JAPANESE;

        // i18nはJavascript側でやる
        //        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
        //        if (requestAttributes instanceof ServletRequestAttributes) {
        //            HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
        //            String lang = request.getHeader("Accept-Language");
        //            if (StringUtils.indexOfIgnoreCase(lang, "ja") != 0) {
        //                fmt = "d MMM yyyy HH:mm z";
        //                locale = Locale.ENGLISH;
        //            }
        //        }

        FastDateFormat sdf = FastDateFormat.getInstance(fmt, AppConfig.JST, locale);
        String ret = sdf.format(date);
        return ret;
    }
项目:Tank    文件:DateConverter.java   
/**
 * @{inheritDoc
 */
@Override
public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) {
    try {
        FastDateFormat fmt = DF;
        if (preferencesBean != null) {
            fmt = preferencesBean.getDateTimeFormat();
        }
        return fmt.parseObject(value);
    } catch (ParseException e) {
        // throw new IllegalArgumentException("Passed in value was not a valid date format in the pattern of " +
        // PATTERN);
        LOG.error("Cannot parse date value of" + value + ". Must be in the pattern of " + PATTERN);
    }
    return null;
}
项目:Tank    文件:ActJobNodeBean.java   
public ActJobNodeBean(JobInstance job, boolean hasRights, FastDateFormat fmt) {
    super();
    this.setHasRights(hasRights);
    this.setName(job.getName());
    this.setJobId(String.valueOf(job.getId()));
    this.setId(String.valueOf(job.getId()));
    this.setReportMode(job.getReportingMode().toString());
    this.setStatus(job.getStatus().toString());
    this.setRegion("");
    this.setActiveUsers(String.valueOf(job.getBaselineVirtualUsers()));
    this.setTotalUsers(String.valueOf(job.getTotalVirtualUsers()));
    this.jobDetails = job.getJobDetails();

    if (job.getStartTime() != null) {
        this.setStartTime(fmt.format(job.getStartTime()));
    } else {
        this.setStartTime("");
    }

    if (job.getEndTime() != null) {
        this.setEndTime(fmt.format(job.getEndTime()));
    } else {
        this.setEndTime("");
    }

}
项目:Tank    文件:ActJobNodeBean.java   
public ActJobNodeBean(String jobId, CloudVmStatusContainer container, FastDateFormat fmt) {
    super();
    this.setName(jobId);
    this.setJobId(jobId);
    this.setId(jobId);
    this.setReportMode("");
    this.setStatus(container.getStatus().name());
    this.setRegion("");
    this.setActiveUsers("");
    this.setTotalUsers("");

    if (container.getStartTime() != null) {
        this.setStartTime(fmt.format(container.getStartTime()));
    } else {
        this.setStartTime("");
    }

    if (container.getEndTime() != null) {
        this.setEndTime(fmt.format(container.getEndTime()));
    } else {
        this.setEndTime("");
    }
}
项目:Tank    文件:ProjectNodeBeanTest.java   
/**
 * Run the void addJob(ActJobNodeBean) method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:54 PM
 */
@Test
public void testAddJob_1()
    throws Exception {
    Project project = new Project();
    project.setName("");
    ProjectNodeBean fixture = new ProjectNodeBean(project);
    fixture.setJobBeans(new LinkedList());
    ActJobNodeBean jobNode = new ActJobNodeBean(new JobInstance(), true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    fixture.addJob(jobNode);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.project.Project.<init>(Project.java:77)
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the ActJobNodeBean(JobInstance,boolean) constructor test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testActJobNodeBean_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance job = new JobInstance(workload, "");
    job.setEndTime(new Date());
    job.setJobDetails("");
    job.setTotalVirtualUsers(1);
    job.setStatus(JobQueueStatus.Aborted);
    job.setStartTime(new Date());
    boolean hasRights = true;

    ActJobNodeBean result = new ActJobNodeBean(job, hasRights, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.api.enumerated.IncrementStrategy.<init>(IncrementStrategy.java:23)
    //       at com.intuit.tank.api.enumerated.IncrementStrategy.<clinit>(IncrementStrategy.java:13)
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the ActJobNodeBean(String,CloudVmStatusContainer) constructor test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testActJobNodeBean_2()
    throws Exception {
    String jobId = "";
    CloudVmStatusContainer container = new CloudVmStatusContainer();
    container.setStatus(JobQueueStatus.Aborted);
    container.setEndTime(new Date());
    container.setStartTime(new Date());

    ActJobNodeBean result = new ActJobNodeBean(jobId, container, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    //       at com.intuit.tank.api.model.v1.cloud.CloudVmStatusContainer.<init>(CloudVmStatusContainer.java:79)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the String getJobDetails() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetJobDetails_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    String result = fixture.getJobDetails();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the List<VMNodeBean> getSubNodes() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetSubNodes_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    List<VMNodeBean> result = fixture.getSubNodes();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the String getType() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetType_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    String result = fixture.getType();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the List<VMNodeBean> getVmBeans() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testGetVmBeans_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    List<VMNodeBean> result = fixture.getVmBeans();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertNotNull(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean hasSubNodes() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testHasSubNodes_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.hasSubNodes();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean hasSubNodes() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testHasSubNodes_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.hasSubNodes();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isDeleteable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsDeleteable_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isDeleteable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isJobNode() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsJobNode_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isJobNode();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isKillable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsKillable_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isKillable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isKillable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsKillable_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isKillable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isPausable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsPausable_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isPausable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isRampPausable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsRampPausable_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isRampPausable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isRampPausable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsRampPausable_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isRampPausable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isRunnable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsRunnable_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isRunnable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isRunnable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsRunnable_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isRunnable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isStopable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsStopable_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isStopable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the boolean isStopable() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testIsStopable_2()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    boolean result = fixture.isStopable();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
    assertTrue(!result);
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the void reCalculate() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testReCalculate_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());

    fixture.reCalculate();

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
}
项目:Tank    文件:ActJobNodeBeanTest.java   
/**
 * Run the void setVmBeans(List<VMNodeBean>) method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 12/15/14 3:52 PM
 */
@Test
public void testSetVmBeans_1()
    throws Exception {
    Workload workload = new Workload();
    workload.setJobConfiguration(new JobConfiguration());
    JobInstance jobInstance = new JobInstance(workload, "");
    jobInstance.setEndTime(new Date());
    jobInstance.setJobDetails("");
    jobInstance.setTotalVirtualUsers(1);
    jobInstance.setStatus(JobQueueStatus.Aborted);
    jobInstance.setStartTime(new Date());
    ActJobNodeBean fixture = new ActJobNodeBean(jobInstance, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));
    fixture.setVmBeans(new LinkedList());
    List<VMNodeBean> vmBeans = new LinkedList();

    fixture.setVmBeans(vmBeans);

    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.IncrementStrategy
    //       at com.intuit.tank.project.BaseJob.<init>(BaseJob.java:28)
    //       at com.intuit.tank.project.JobConfiguration.<init>(JobConfiguration.java:63)
    //       at com.intuit.tank.project.Workload.<init>(Workload.java:57)
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the VMNodeBean(CloudVmStatus,boolean) constructor test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testVMNodeBean_1()
        throws Exception {
    CloudVmStatus vmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT, VMRegion.ASIA_1,
            VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    vmStatus.setTotalTps(1);
    vmStatus.setUserDetails(new LinkedList());
    boolean hasRights = true;

    VMNodeBean result = new VMNodeBean(vmStatus, hasRights, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    // at com.intuit.tank.api.enumerated.VMImageType.<init>(VMImageType.java:18)
    // at com.intuit.tank.api.enumerated.VMImageType.<clinit>(VMImageType.java:4)
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertNotNull(result);
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the List<JobNodeBean> getSubNodes() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testGetSubNodes_1()
        throws Exception {
    CloudVmStatus cloudVmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT,
            VMRegion.ASIA_1, VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    cloudVmStatus.setTotalTps(1);
    cloudVmStatus.setUserDetails(new LinkedList());
    VMNodeBean fixture = new VMNodeBean(cloudVmStatus, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    List<JobNodeBean> result = fixture.getSubNodes();

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.VMImageType
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertNotNull(result);
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the String getType() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testGetType_1()
        throws Exception {
    CloudVmStatus cloudVmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT,
            VMRegion.ASIA_1, VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    cloudVmStatus.setTotalTps(1);
    cloudVmStatus.setUserDetails(new LinkedList());
    VMNodeBean fixture = new VMNodeBean(cloudVmStatus, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    String result = fixture.getType();

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.VMImageType
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertNotNull(result);
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the boolean hasSubNodes() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testHasSubNodes_1()
        throws Exception {
    CloudVmStatus cloudVmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT,
            VMRegion.ASIA_1, VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    cloudVmStatus.setTotalTps(1);
    cloudVmStatus.setUserDetails(new LinkedList());
    VMNodeBean fixture = new VMNodeBean(cloudVmStatus, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    boolean result = fixture.hasSubNodes();

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.VMImageType
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertTrue(!result);
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the boolean isKillable() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testIsKillable_1()
        throws Exception {
    CloudVmStatus cloudVmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT,
            VMRegion.ASIA_1, VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    cloudVmStatus.setTotalTps(1);
    cloudVmStatus.setUserDetails(new LinkedList());
    VMNodeBean fixture = new VMNodeBean(cloudVmStatus, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    boolean result = fixture.isKillable();

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.VMImageType
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertTrue(!result);
}
项目:FHIR-Server    文件:BaseDateTimeDtTest.java   
@Test
public void testFormats() throws Exception {
    Date instant = myDateInstantParser.parse("2001-02-03 13:01:02.555");
    for (FastDateFormat next : BaseDateTimeDt.getFormatters()) {

        Calendar cal = Calendar.getInstance();
        cal.setTime(instant);
        String value = next.format(cal);
        ourLog.info("String: {}", value);

        DateTimeDt dt = new DateTimeDt(value);
        String reEncoded = next.format(dt.getValue());

        assertEquals(value, reEncoded);

    }
}
项目:Tank    文件:VMNodeBeanTest.java   
/**
 * Run the boolean isStopable() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:53 PM
 */
@Test
public void testIsStopable_1()
        throws Exception {
    CloudVmStatus cloudVmStatus = new CloudVmStatus("", "", "", JobStatus.Completed, VMImageType.AGENT,
            VMRegion.ASIA_1, VMStatus.pending, new ValidationStatus(), 1, 1, new Date(), new Date());
    cloudVmStatus.setTotalTps(1);
    cloudVmStatus.setUserDetails(new LinkedList());
    VMNodeBean fixture = new VMNodeBean(cloudVmStatus, true, FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM));

    boolean result = fixture.isStopable();

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: Could not initialize class com.intuit.tank.api.enumerated.VMImageType
    // at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    assertTrue(!result);
}