/**
* @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. Cocos2d-x-lua学习点滴

    Lua下的方法.自己项目经验,个人见解,不能确保正确. Sprite: local Light = CCSprite:create("light.png")             ...

  2. leetCode(46):Kth Smallest Element in a BST

    Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Not ...

  3. angular4(3)angular脚手架引入scss

    scss..sass....sccc...ssss...ccccc......MMP················· 先说下scss和sass的异同: SCSS 是 Sass 3 引入新的语法,其语 ...

  4. [JZOJ 5906] [NOIP2018模拟10.15] 传送门 解题报告(树形DP)

    题目链接: https://jzoj.net/senior/#contest/show/2528/2 题目: 8102年,Normalgod在GLaDOS的帮助下,研制出了传送枪.但GLaDOS想把传 ...

  5. [JZOJ 5905] [NOIP2018模拟10.15] 黑暗之魂(darksoul) 解题报告 (拓扑排序+单调队列+无向图基环树)

    题目链接: http://172.16.0.132/senior/#main/show/5905 题目: oi_juruo热爱一款名叫黑暗之魂的游戏.在这个游戏中玩家要操纵一名有 点生命值的无火的余灰 ...

  6. Django之ORM数据库增删改查

    总结:ORM的 查.增.删.改 - 查 - client - 有一个展示页面(xxx_show.html) - 这一个页面一输入执行后,get请求向server端发送 - 这个展示页面有添加按钮.删除 ...

  7. 重温前端基础之-js排序算法

    javascript数组常用的方法: push():返回值,数组新的长度 pop():返回值,被删除的数组末尾元素 shift():返回值,被删除的数组首部元素 unshift():返回值,数组新的长 ...

  8. MyBatis数据持久化(八)sql复用

    在mybatis中,我们可以將sql语句中公共的部分提取出来,然后需要该段sql的地方通过include标签引入即可,这样可以达到sql语句复用的目的. 例如我们有两条相似的查询语句: <sel ...

  9. JavaScript学习——使用JS实现首页轮播图效果

    1.相关技术 获取元素 document.getElementById(“id 名称”) 事件(onload) 只能写一次并且放到body标签中 定时操作:setInterval(“changeImg ...

  10. 51nod 1066 - Bash游戏,简单博弈

    有一堆石子共有N个.A B两个人轮流拿,A先拿.每次最少拿1颗,最多拿K颗,拿到最后1颗石子的人获胜.假设A B都非常聪明,拿石子的过程中不会出现失误.给出N和K,问最后谁能赢得比赛. 例如N = 3 ...