java批量生成用例脚本-保留字关键词的用例脚本生成
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java批量生成用例脚本-保留字关键词的用例脚本生成相关的知识,希望对你有一定的参考价值。
20171012新补丁包程序,程序整理了全部的关键字和保留字,支持 字段a = "字段b" 与 字段a = 字段b,并做了代码重构。对补丁包进行关键字专项测试,验证关键字保留字作为库、表、视图、字段、词典等情况
package com.io.test;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class ConstTest01 {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
String path01 = "C:\\tmp\\const.txt";
String path02 = "C:\\tmp\\ksql.txt";
FileInputStream fis = new FileInputStream(path01);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
FileOutputStream fos = new FileOutputStream(path02);
OutputStreamWriter osr = new OutputStreamWriter(fos);
BufferedWriter bw = new BufferedWriter(osr);
String temp;
String temp01;
while((temp=br.readLine())!=null)
{
if(temp.contains("\""))
{
String[] arr = temp.split("\"");
temp01 = arr[1];
bw.write("--<DROP>");
bw.newLine();
temp = "drop table "+temp01+"\ngo";
bw.write(temp);
bw.newLine();
bw.write("--<CREATE>");
bw.newLine();
temp = "CREATE TABLE "+temp01+"\nPATH \‘C:\\tmp\\table\\"+temp01+"\‘\nAT temp \n("+temp01+" INTEGER(8) NORMAL,test INTEGER(8) NORMAL)\ngo";
// System.out.println(temp);
bw.write(temp);
bw.newLine();
bw.write("--<INSERT>");
bw.newLine();
temp = "INSERT INTO "+temp01+"("+temp01+",test)\nVALUES(0,12345678)\ngo";
bw.write(temp);
bw.newLine();
bw.write("--<SELECT recordset=1-*>");
bw.newLine();
temp = "SELECT * FROM "+temp01+"\ngo";
bw.write(temp);
bw.newLine();
bw.write("--<UPDATE>");
bw.newLine();
temp = "update "+temp01+" set "+temp01+"= test\ngo";
bw.write(temp);
bw.newLine();
bw.write("--<SELECT recordset=1-*>");
bw.newLine();
temp = "SELECT * FROM "+temp01+