In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Query table, sub-query table, ordered query table
The header still needs to be marked. There's nothing to say about it. Parameter columns are usually constructed to provide query conditions (which can be omitted). What needs to be noted in the fixture code is that there must be a query method with no parameters, and the return value is List. This List is a bit complicated, it is a collection of three layers of List, corresponding to tables, rows and fields respectively. Verbal expression is not very clear, or look at the following code is good. The returned results are compared to the data on the page. Query tables are suitable for validating query results from relational databases.
Query:qt.zjc.com.QueryTable123456nameagejobsalaryzjc99worker1000000
The code is as follows:
public class QueryTable { private int salary; private List table; public QueryTable(int s){ this.salary=s; } public List query(){ table=new ArrayList(); ArrayList row=new ArrayList(); ArrayList field1=new ArrayList(); ArrayList field2=new ArrayList(); ArrayList field3=new ArrayList(); ArrayList field4=new ArrayList(); field1.add("name"); field1.add("zjc"); row.add(field1); field2.add("age"); field2.add("99"); row.add(field2); field3.add("job"); field3.add("worker"); row.add(field3); field4.add("salary"); field4.add("1000000"); row.add(field4); table.add(row); return table; }}
As you can see, constructing this List structure is rather cumbersome. Of course, I'm just an example here. In practice, it must be a circular operation. But even so, I think there are simpler ways to achieve the same validation, such as using decision tables. Test code must be as simple and clear as possible, do not contain complex operations and business logic, otherwise the problem is detected by checking whether the problem is the business code or the test code, it is not worth the loss, this is my opinion. Therefore, I feel that the scope of application of the query table is not wide, and I will write the sub-query table and the ordered query table together.
The child lookup table, ordered lookup table format and lookup table exactly the same. According to the document, the sub-query table is to contain the results that are certain to exist, and I verify that I have not found any difference; the ordered query table is to compare the results in order, and the contents are all right, and the order is not correct.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.