`

segment of test code

 
阅读更多

{

{
            if (fieldName == null || fieldName.trim().equalsIgnoreCase(""))
                return true;
            con = getConnection();
            st = con.createStatement();
            rs = st.executeQuery("SELECT * FROM " + to.getSchemaName() + "."
                    + to.getTableName() + " ");
            rsmd = rs.getMetaData();
            for (int i = 1; i < rsmd.getColumnCount() + 1; i++) {
                if (rsmd.getColumnName(i).equalsIgnoreCase(fieldName)) {
                    exist = true;
                }
            }
        }


        Pattern p = Pattern.compile("[a-zA-Z0-9]*");
        Matcher m = p.matcher("xx");
        boolean b = m.matches();
        System.out.println(""+b);

        String aa="喊";
        String bb="x";
        System.out.println("喊="+aa.getBytes().length);
        System.out.println("x="+bb.getBytes().length);


        String str="x2x收拾";
                                    
        String regEx="[a-zA-Z0-9]*";
        Pattern p=Pattern.compile(regEx);

        Matcher m=p.matcher(str);

        boolean rs=m.find();
        System.out.println(""+rs);
        String StrTemp = "";
        for (int i = 0; i < StrTemp.length(); i++) {

            if ((StrTemp.charAt(i) > '9' || StrTemp.charAt(i) < '0')

                    && (StrTemp.charAt(i) > 'a' || StrTemp.charAt(i) < 'z')
                    && (StrTemp.charAt(i) > 'A' || StrTemp.charAt(i) < 'Z')) {

            }
        }


   try {
    TableProfilePOJO pojo = new TableProfilePOJO();
    Class classType = pojo.getClass();
    Field[] fields = classType.getDeclaredFields();
    for (int i = 0; i < fields.length; i++) {

     Field field = fields[i];
     String fieldName = field.getName();
     //System.out.println("fieldName["+i+"]"+fieldName);
     String setMethodName = "set" + StringUtil.capitalize(fieldName);
     Method setMethod = classType.getMethod(setMethodName,
       new Class[] { field.getType() });
     //System.out.println("setMethod["+i+"]"+setMethod);

     setMethod.invoke(pojo, new Object[] { "setin" });
     System.out.println("pojo.getSchemaName()="+pojo.getSchemaName());
     pojo.getSchemaName();
    }
   } catch (Exception e) {
    e.printStackTrace();
   }


   try {
    TableProfilePOJO aab = new TableProfilePOJO();
    PropertyUtils.setProperty(aab, "idNo", "12");
    log.warn(PropertyUtils.getProperty(aab, "idNo"));
   } catch (Exception e) {
    e.printStackTrace();
   }

   ArrayList list=new ArrayList();

   list.add("1");
   list.add("2");
   list.add("3");
   list.add("4");
   list.add("5");

   for(int i=0;i<list.size();i++){

    log.warn(list.get(i));

   }

    }

分享到:
评论

相关推荐

    The code for Distortion-Convolution-Module-for-Semantic-Segmenta

    The code for Distortion_Convolution_Module_for_Semantic_Segmentation, IEEE TIM. Xing Hu, Yi An.... to run it , you need install pytorch, tqdm, and tensorboardX package. to train and test, you can ...

    微机原理实验指导书

    CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV DX,307H ;控制字端口地址送DX MOV AL,80H ;送方式字 OUT DX,AL MOV DX,304H ;端口A的输出端送DX LPPO0: LEA SI. OUT_CODE ;数据段 ...

    Microsoft Library MSDN4DOS.zip

    13.1 80286 Code Executes as a Subset of the 80386 13.2 Two ways to Execute 80286 Tasks 13.3 Differences From 80286 Chapter 14 80386 Real-Address Mode 14.1 Physical Address Formation 14.2 Registers and...

    Java 英文习题及答案

    Which of the following Java statements is syntactically correct and semantically identical to the program segment? (a) int[] arr= {15, 17, 19}; (b) int[3] arr = {15, 17, 19}; (c) int arr = {15, 17, ...

    Debugging Malloc Lab: Detecting Memory-Related Errors

    For example, the code segment: void *ptr1 = MALLOC(10), *ptr2 = MALLOC(8); FREE(ptr2); printf("%d\n", AllocatedSize()); should print out "10". Once you have gotten to the point where you can ...

    acpi控制笔记本风扇转速

    The debug version of the code includes the debug output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug ...

    PHP Objects, Patterns, and Practice, 4th Edition

    The last segment of the book covers the tools and practices that can help turn great code into a successful project. The section shows how to manage multiple developers and releases with git, how to ...

    C++ plus Data Structures.pdf

    oriented design Identify several sources of program errors Describe strategies to avoid software errors Specify the preconditions and postconditions of a program segment or function Show how ...

    The Art of Assembly Language Programming

    Arrays 5.6.1.1 - Declaring Arrays in Your Data Segment 5.6.1.2 - Accessing Elements of a Single Dimension Array 5.6.2 - Multidimensional Arrays 5.6.2.1 - Row Major Ordering 5.6.2.2 - ...

    BIos原代码《陈文钦》

    _text segment word public 'CODE' assume cs:cgroup .486p ;---------------------------------------; public _BIOS_STARTS _BIOS_STARTS label byte ; marks start of module ;------------------------------...

    PHP Objects, Patterns, and Practice(Apress,2016)

    it builds on this foundation to instill core principles of software design and then covers the tools and practices needed to develop, test and deploy robust code. PHP Objects, Patterns, and Practice ...

    i-vector的工具箱

    During the evaluation phase, each test segment is scored either against all enrolled speaker models to determine who is speaking (speaker identification), or against the background model and a given ...

    The Indispensable PC Hardware Book - rar - part1. (1/7)

    Code segment and instruction counter. Stack segment and stack pointer. Data segment DS and addressing. Addressing types and instruction coding. Programming at processor level: mnemonics and the ...

    degital electronics

    2.5 Seven-segment Display Code 38 2.6 Error Detection and Correction Codes 40 2.6.1 Parity Code 41 2.6.2 Repetition Code 41 2.6.3 Cyclic Redundancy Check Code 41 2.6.4 Hamming Code 42 Review Questions...

    Bochs - The cross platform IA-32 (x86) emulator

    - Allow reloading of segment registers from internal debugger - Improved verbose physical memory access tracing - BIOS - Fix MTRR configuration (prevented boot of modern Linux kernels) - Fix ...

    Microsoft CDIMAGE v2.52

    t load segment in hex for El Torito boot image (e.g. -yt7C0) f use a faster way to generate short names -k (keep) create image even if fail to open some of the source files -m ignore maximum image...

    计算机网络第六版答案

    Part of protocol has always been the acknowledgment of the hierarchical standing of all present. Protocol rules are based on the principles of civility. Standards are important for protocols so that...

    VB编程资源大全(英文源码 控件)

    on left and right side of a text box.&lt;END&gt;&lt;br&gt;40,Assist.zip A simple application with source code which shows how to save the contents of a rich text box without the help of common dialog box.&lt;END&gt;...

    SAP屠夫作品汇总

    7.1.5 Define profitability Segment Char. 493 7.1.6 Set Operating Concern 493 7.2 Master Data 493 7.2.1 Maintain Characteristic Values 493 7.2.2 Define Characteristics Hierarchy 494 7.2.3 Define ...

    最完整的Toad For Oracle使用手册

    Installation and Administration of Toad 64 Window Privileges and Toad 64 Toad for Oracle, Read-Only 64 Registering Toad 65 Silent Installation 66 Group Policy Management 71 Citrix Support 71 SQL*...

Global site tag (gtag.js) - Google Analytics