/**
* @param input
* <CURRENTMONTH><CURRENTMONTH+1>
* @return Month "MM"
*/
private String currentMonth(String input) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date now = new Date();
String temp = dateFormat.format(now);
String month = temp.split("/")[1];
input = input.toUpperCase();
if (input.length() == "<CURRENTMONTH>".length()) {
return month;
} else if (input.length() > "<CURRENTMONTH>".length()) {
String math = input.substring("<CURRENTMONTH".length(),
"<CURRENTMONTH".length() + 1);
String value = input.substring(input.indexOf(math) + 1,
input.length() - 1);
int m = 0;
if (math.equals("+")) {
m = (Integer.parseInt(month) + Integer.parseInt(value)) % 12;
} else if (math.equals("-")) {
m = (Integer.parseInt(month) - Integer.parseInt(value)) % 12;
m = Math.abs(m);
} else {
return "Operator error!";
}
if (m == 0) {
m = 12;
}
if ((m + "").length() == 1) {
month = "0" + m;
} else {
month = m + "";
}
return month;
} else {
return "The format of input value " + input + " is incorrect.";
}
}

CURRENMONTH TAG in Automation Framework的更多相关文章

  1. Automation Framework Design 自动化框架设计思想

    从2007年到2017年,十年内自动化测试工具层出不穷,各种工具在运用一段时间之后,各个公司都会有测试架构师对于目前的自动化测试工具进行框架定制设计. 从惠普2007年GDCC推出的的WebDrivi ...

  2. 自动化框架Quantum Automation Framework+cucumber+perfecto

    名词解释 Quantum: 一款基于JAVA的自动化框架,支持手机和桌面WEB的自动化测试.与cucumber和perfecto实现了整合,用于BDD自动化. Refer: http://projec ...

  3. Robot Framework + Pywinauto 框架实现Windows GUI Automation

    Robot Framework is a generic test automation framework for acceptance testing and acceptance test-dr ...

  4. 5 Best Automation Tools for Testing Android Applications

    Posted In | Automation Testing, Mobile Testing, Software Testing Tools   Nowadays automated tests ar ...

  5. Robot Framework自动化测试(三)--- 封装系统关键字

    之前对robotframework-ride了解的不多,后来知道了引入Selenium2Lirary库后可以做web UI自动化测试,但发现和python没啥关系,今天学习了封装系统关键字算是和pyt ...

  6. Robot Framework安装配置 Linux

    Simple introduction Robot Framework is a generic test automation framework for acceptance testing an ...

  7. What is Data Driven Testing? Learn to create Framework

    What is Data Driven Testing? Data-driven is a test automation framework which stores test data in a ...

  8. Robot Framework 快速入门_英文版

    Copyright © Nokia Siemens Networks 2008 Licensed under the Apache License, Version 2.0 Table of Cont ...

  9. 10 Unit Testing and Automation Tools and Libraries Java Programmers Should Learn

    转自:https://javarevisited.blogspot.com/2018/01/10-unit-testing-and-integration-tools-for-java-program ...

随机推荐

  1. HDU 3723

    把向上看成+1,向下看成-1.可以知道符合卡特兰数的一般解释了.记作Can(i) 中间平过的即是0.亦即是C(n,2*i),i表示向上的数. 于是总的就是sum(C(n,2*i)*Can(i)),i从 ...

  2. PHP编译时错误解决:Don&#39;t know how to define struct flock on this system, set --enable-opcache=no

    在编辑PHP5.6.1时出现了这个错误: Don't know how to define struct flock on this system, set --enable-opcache=no 解 ...

  3. Java虚拟机的类载入机制

    Java虚拟机类载入过程是把Class类文件载入到内存.并对Class文件里的数据进行校验.转换解析和初始化,终于形成能够被虚拟机直接使用的java类型的过程. 在载入阶段,java虚拟机须要完毕下面 ...

  4. oracle实现自增id

    --oracle实现自增id --创建一张T_StudentInfo表 create table T_StudentInfo ( "id" integer not null pri ...

  5. moveToThread的根本目的还是为了处理QObject的事件循环(如果为空指针的话,当前对象的所有的事件都不处理了),看官方说明就知道了

    Changes the thread affinity for this object and its children. The object cannot be moved if it has a ...

  6. vue平行组件传值 params

    欢迎加入前端交流群交流知识&&获取视频资料:749539640 需要传值的组件组件: <template> <div> <router-link :to= ...

  7. .net core @Html 自定义属性中包含特殊符号解决

    最近自己在练手项目用到了VUE 绑定属性的时候发现 有: -符号 这样显然是不支持的.之前发现 v-on  这种-符号也是不支持的 但是可用 @v_on 替代.可是找遍了所有资料也没找到:转义符 当时 ...

  8. 利用IP安全策略关闭危险端口

    默认情况下,Windows服务器有很多端口是开放的,网络病毒和黑客可以通过这些端口连上你的服务器并进行攻击. 为了让你的系统变为铜墙铁壁,应该封闭这些端口,主要有:TCP 135.139.445.59 ...

  9. PIC kit3问题

    1.通过pic kit3烧录pic16F1938的时候,pic kit3自动更新了firmware,但是仍然烧录不了pic16F1938,然后再次用pic kit3烧录pic18F45k80时,一直显 ...

  10. 监控慢SQL

    SELECT G.TARGET || ' ' || S.MACHINE || ' ' || ceil((G.LAST_UPDATE_TIME - G.START_TIME)*86400)   FROM ...