/**
* @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. 非典型的scala程序及其编译后的结果

    初学Scala Folder structure以及部分代码 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2xldmVyd3lx/font/5a6L5L ...

  2. Hive编程指南_学习笔记01

    第四章: HQl的数据定义 1:创建数据库   create database financials;   create database  if not exists financials; 2: ...

  3. JavaScript常用的api

    打印日志 console.log 类型判断 第一种方式var type = Object.prototype.toString.call(list);console.log(type);第二种方式ty ...

  4. zzuoj--10424--无聊的课(简单几何)

    10424: 无聊的课 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 81  Solved: 16 [Submit][Status][Web Boar ...

  5. validation-api参数校验

    这里针对springboot项目结构 maven添加: <dependency> <groupId>javax.validation</groupId> <a ...

  6. Java7里try-with-resources分析--转

    原文地址:http://blog.csdn.net/hengyunabc/article/details/18459463 这个所谓的try-with-resources,是个语法糖.实际上就是自动调 ...

  7. HD-ACM算法专攻系列(11)——Exponentiation

    问题描述: 源码: 考察对大数的计算,需要注意去除前导0与后导0. import java.math.BigDecimal; import java.util.*; public class Main ...

  8. oracle中对字符串进行分割,并反回随机段

    --测试数据 select fun_spilt_draw('1,2,3,4,5,6,7') a from dual--待处理数据 strtext--定义一个函数分割 返回字符串中的一个随机段creat ...

  9. java高级——暴力反射

    反射,java中一个比较高级的应用,主要和开发中的框架紧密相连.今天我们就介绍一下他的特性之一,暴力反射.(听名字很恐怖呦) package wo; public class A{ public St ...

  10. kinEditor动态渲染的问题

    摘自:jingyan.baidu.com/article/a65957f4a4c89a24e67f9b3d.html 在使用kindEditor时,因为textarea是动态加载的,因而对textar ...