这个测试中另一个值得注意的行是这个类定义,它指向这个模板的类,而不是您可能创建的模板。
The other notable line in this test is the class definition, which points to the template class, rather than one that you might create.
这个文件还声明模块的入口点类(第6行)。
This file also declares the entry point class for the module (line 6).
然后它生成一个HTML或者xml格式的报告,指出代码中的哪些包、哪些类、哪些方法和哪些行没有测试到。
It then produces a report in HTML or XML that shows exactly which packages, classes, methods, and individual lines of code are not being tested.
现在让我们实现更复杂的目标并添加一些有条件的文本呈现—例如,命名偶数和奇数表行的css类。
Let's make the goal more complex and add some conditional text rendering - for example, CSS class names for even and odd table rows.
换句话说,表映射到类,对象映射到行,而对象属性映射到列。
That is, tables map to classes, objects map to rows, and object properties map to columns.
这三个类基本上只需要一行代码。
代码中的第5行现在正确地扩展类。
这个过程在总体层次上也工作得很好:如果一个类有100行代码,其中的45行被触及,那么这个类的行覆盖率就是45%。
The process works at the aggregate level as well: If a class has 100 lines and 45 of them were touched, then the class has a line coverage of 45%.
取得对表格ID、值对象类、数据行的会话属性和组合框(如果有的话)的会话属性的引用。
Obtains the reference for the table ID, value object class, session attribute for data rows, and session attribute for combo box if one exists.
可单击每一个包,获得类级别的行百分比和路径百分比,甚至能看到执行的源代码行和它们执行的次数。
You can click on each package to get class level line and path percentages and even see which source code lines were executed and how many times they was run.
许多人所提倡的一条经验法则是,类的代码行超过1,000行就可以说该类太长了。
A rule of thumb advocated by many is that a class with more than 1,000 lines of code is too big.
最后的两行负责在这个测试类内部运行测试,方法是直接运行该模块即可。
Finally, the two lines at the bottom allow you to run the tests within this test class by simply running this module.
进一步深入到单独的类中,具体查看哪一行代码没有测试到。
Drilling down further into individual classes, you can see exactly which lines aren't being tested.
第 30-33行中导入的类是使用JTA 所必要的。
The classes imported in line 30-33 are necessary to work with JTA.
首先第一行创建了类Document的一个实例,它由一个或者多个的域(Field)组成。
The first line creates an instance of the Document class, which consists of a collection of fields.
将这两个问题集合联合起来并不是意见简单的事情:动态分析以urls和参数的形式说明,而静态分析则讨论代码的类和行。
Combining the two sets of issues is not simple: dynamic analysis speaks in terms of URLs and parameters, while static analysis discusses classes and lines of code.
第24行-使用“File”类中的“fnmatch”方法检查发现的文件是否符合给定的模式。
Line 24 - Uses the 'fnmatch' method of 'file' class to check if the file found matches the pattern given.
行覆盖率:类文件中覆盖的行百分比。
Line coverage: the percentage of lines covered in the class file.
大多数数据绑定框架支持将这个文档映射成包含以下代码行的类实例。
Most data binding frameworks support mapping this document to instances of classes along the lines of.
请特别注意清单中的以下代码行:(1):urlarguments类是一个小型实用工具类,它将URL参数解析为散列表对象。
Pay particular attention to these lines in this listing: (1) : the UrlArguments class is a small utility class that parses the URL arguments into a hashtable object.
第一行的下面是对实际int类的详细说明。
Following this first line is a detailed description of the actual int class.
如这些类的名称所示,Ro w类存储每个行的对象,而cell类用于储存每个行的单元格的内容,见下面的清单3。
As the names of these classes suggest, the row class holds objects for a single row, and a cell class, shown in the code below (Listing 3), is for a content of a cell in a row.
要创建数据库行,需创建对应类的实例,代码如下。
To create a database row, you create an instance of the corresponding class with the code.
我们通过实例化treecolumn类(第23和28行)来向树中添加列。
We add columns to the tree by instantiating the TreeColumn class (lines 23 and 28).
我将整个含有25000行的代码的类打印了出来,让我的同事来找出里面的错误。
I printed an entire class containing 25,000 lines of code and asked my colleagues to find the bugs.
现在,回顾一下Rational类定义中的第一行。
Now look again at the first line in the Rational class definition.
第33行-使用“File”类中的“fnmatch”方法检查发现的文件是否符合给定的模式。
Line 33 - Uses the 'fnmatch' method of 'file' class to check if the file found matches the pattern given.
leftright和topbottom是分别用于列和行的类STL(标准模板库)的半开区间(half - open range)。
The leftright and topbottom are STL (Standard Template Library) -like half-open ranges for column (s) and row (s) respectably.
行导入实现该中心所需的类和接口。
Lines 03-12 import the classes and interfaces we need to implement the authority.
下一行导入Scala的核心xml类。
应用推荐