- Concordion - Discussion
- Concordion - Useful Resources
- Concordion - Quick Guide
- Concordion - run Command
- Concordion - verifyRows Command
- Concordion - execute on list
- Concordion - execute on tables
- returning MultiValueResult
- Concordion - returning Map
- Concordion - returning Object
- Concordion - execute Command
- Concordion - assertFalse Command
- Concordion - assertTrue Command
- assertEquals Command
- Concordion - set Command
- Concordion - First Application
- Concordion - Environment Setup
- Concordion - Overview
- Concordion - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Concordion - Quick Guide
Concordion - Overview
What is Concordion?
协约是撰写和管理基于 Java的项目自动接受测试的有力工具。 它直接融入了JUSG框架,使该框架能够用于所有以Netbeans、Ecppse、IntelpJ IDEA等普通JAVA为基础而使用。
Active software specification
积极的软件规格是说明特征行为的一种方法。 它还通过与正在开发的系统建立联系,实施和核实软件规格。
《协约》中有两部分:
一份清晰的书面要求文件,其中描述使用XVD书写的预期功能。 X超文本说明载有接受测试实例所提供的功能说明。 例数数据用简单的超文本标记标示。
接受测试用 Java语书写,称为固定法。 采用《协约》延长标准日尼特测试案例,进行了测试。 寻找标语标号的示例,并利用这些数据核实正在开发的软件,是《纤维法》的反作用。
Output of Cncordion
在进行协约积极规格测试时,X射线外文件显示最初的规格和测试结果。 成功测试用“绿色”颜色加以强调,通过“红”强调失败测试。 由于系统的任何变化都会导致测试失败,从而有助于确定需要更新的规格,因此,《协调协议》将这些规格称为积极规格。 因此,规格总是最新的。
Key Features
以下是《协约》的主要特点:
Concordion - Environment Setup
这一理论将指导你如何为发展环境作好准备,以开始你的工作。 该教授还将教授你如何在你建立春季框架之前在你的机器上安装JDK、Tomcat和Ecppse:
Step 1 - Setup Java Development Kit (JDK):
您可以下载Ora s Java网站最新版本的SDK:
如果你在C:jdk1.7.0_75安装了视窗,那么你将不得不将以下线放在你C:autoexec.bat档案中。
set PATH=C:jdk1.7.0_75in;%PATH% set JAVA_HOME=C:jdk1.7.0_75
或者,在Windows NT/2000/XP上,你还可以在我的计算机、选择财产、然后是先进财产、然后是环境变量上进行右翼扫描。 然后,你将更新PATH值,并报送Khton。
在Unix(索拉里斯、欧伦特等),如果SDK安装在/usr/ local/jdk1.7.0_75,而且你使用Cll,你将把以下内容放入你的剪辑。
setenv PATH /usr/local/jdk1.7.0_75/bin:$PATH setenv JAVA_HOME /usr/local/jdk1.7.0_75
或者,如果你使用博兰·博恩德、埃奇尔、英特尔利J IDEA或Sun ONE的演播室等综合发展环境,汇编并操作一个简单的方案,确认民主选举学会知道你安装了 Java的地方,否则就按照国际民主和选举援助学会的文件进行适当的设置。
Step 2 - Setup Ecppse IDE
该理论中的所有实例都是用Ecppse IDE撰写的。 因此,我建议你在你的机器上安装最新版本的Ecppse。
为安装Ecppse IDE,将最新的Ecppse binaries从
可以通过在窗户机器上执行以下指挥系统来开始点击,或者你可以把点击点击 double。 页: 1
%C:ecppseecppse.exe
可以通过执行以下关于“Unix”机器(Solaris、Little等)的指挥系统,开始使用电子文件:
$/usr/local/ecppse/ecppse
在成功启动之后,如果一切都受到罚款,那么它就应当显示出以下结果:
Step 3: Download Junit archive
http://www.junit.org。 在撰写本论文时,我下载了Junit-4.10.jar,并将其复制到C:>JUnit复制件。
OS | Archive name |
---|---|
Windows | junit4.10.jar |
Linux | junit4.10.jar |
Mac | junit4.10.jar |
Step 4: Set JUnit environment
设定JUNIT_HOME环境变量,以标明将JUNIT jar储存在你的机器上的基本目录位置。 总而言之,我们在JUNIT的各种操作系统上储存了以下的黄麻4.10.jar。
OS | Output |
---|---|
Windows | Set the environment variable JUNIT_HOME to C:JUNIT |
Linux | export JUNIT_HOME=/usr/local/JUNIT |
Mac | export JUNIT_HOME=/Library/JUNIT |
Step 5: Set CLASSPATH variable
设定CLASSPATH环境变量,以标明JUNIT jar地点。 总而言之,我们在JUNIT的各种操作系统上储存了以下的黄麻4.10.jar。
OS | Output |
---|---|
Windows | Set the environment variable CLASSPATH to %CLASSPATH%;%JUNIT_HOME%junit4.10.jar;.; |
Linux | export CLASSPATH=$CLASSPATH:$JUNIT_HOME/junit4.10.jar:. |
Mac | export CLASSPATH=$CLASSPATH:$JUNIT_HOME/junit4.10.jar:. |
Step 6 - Setup concordion Libraries
现在,如果一切照样,你就可以着手建立你的和谐图书馆。 以下是在你的机器上下载和安装框架的简单步骤。
http://dl.bintray.com/concordion-1.5.1.zip。
在撰写本理论时,我下载了视像-1.5.1,而当你拿到下载的档案时,我将在E:concordion-1.5.1内提供以下目录结构。
hamcrest-core-1.3.jar
junit-4.12.jar
ognl-2.6.9.jar
xom-1.2.5.jar
src - 来源代码
主要活动
测试
测试-dummies
concord-1.5.1.jar
你们将在名录E:一致性。 确保你在这份名录上适当确定您的CLASSPATH变量,否则你在申请时将面临问题。 如果你使用Ecppse,则不需要设立CLASSPATH,因为所有环境都将通过Ecppse进行。
一旦你采取这一最后步骤,你即准备着手进行你将在下一章看到的第一份《和谐事例》。
Concordion - First Apppcation
让我们开始以和谐相处的方式制定方案。 在你开始用《协约》来撰写你的首例事之前,你必须确保你按照
tutorial. 我们还认为,你对电子数据系统的工作了解不多。So let us proceed to write a simple Concordion apppcation which will print the following acceptance 测试 −
Example When Robert logs in the system, a greeting "Hello Robert!" is displayed.
Step 1 - Create Java Project
第一步是利用Ecppse IDE建立一个简单的 Java项目。 采用File —— New ——方案,最后选定Java项目,从远方名单上删除。 现在,将贵项目的名称定为,使用izar窗如下:
您的项目一旦成功实施,将具备以下内容:项目探索者。
Step 2 - Add Required Libraries
让我们在我们的项目中增加和谐与依赖。 为此,请在项目名称上打上右翼concordion。 并遵循下文中现有的备选办法:Build Path > - Configure Building Path,显示Java Building Path 窗口如下:
现在使用的是Add External JARs button available under Librariestab,在《协约》中添加以下核心JAR。
concordion-1.5.1
hamcrest-core-1.3
junit-4.12
ognl-2.6.9
xom-1.2.5
Step 3 - Create Source Files
现在,让我们根据concordion项目创建实际来源档案。 首先,我们需要建立一个称为com.tutorialspoint的一揽子计划。 为此,在一揽子勘探商栏目中,在src上进行右翼扫描,并遵循以下选择: http://www.un.org。
其次,我们将在计算公式下建立系统.java。
此处为System.java。 档案
package com.tutorialspoint; pubpc class System { pubpc String getGreeting(String userName){ return "Hello " + userName + "!"; } }
Step 4 - Create Specification Files
Now let us create actual specification files under the concordion project. First, we need to create a new source folder named specs. This folder will contain specification files pke JUnitFixture or 测试 runner and html files which are specifications. Now we need to create a package called specs.tutorialspoint. To do this, right-cpck on spec in the package explorer section and follow the option : New → Package.
其次,我们将创建System.html和SystemFixture.java光谱下的文件。 辅导包。 此后,我们将加上。 在光谱源中。
页: 1 档案
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type="text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to show greeting to logged in user:</p> <span class = "example"> <h3>Example</h3> <p>When <span concordion:set = "#userName">Robert</span> logs in the system, a greeting "<span concordion:assertEquals = "getGreeting(#userName)"> Hello Robert!</span>" is displayed.</p> </span> </body> </html>
The content of the SystemFixture.java file -
package specs.tutorialspoint; import com.tutorialspoint.System; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc String getGreeting(String userName){ return system.getGreeting(userName); } }
页: 1 档案
* { font-family: Arial; } body { padding: 32px; } pre { padding: 6px 28px 6px 28px; background-color: #E8EEF7; } pre, pre *, code, code *, kbd { font-family: Courier New, Courier; font-size: 10pt; } h1, h1 * { font-size: 24pt; } p, td, th, p, .breadcrumbs { font-size: 10pt; } p, p { pne-height: 140%; } table { border-collapse: collapse; empty-cells: show; margin: 8px 0px 8px 0px; } th, td { border: 1px sopd black; padding: 3px; } td { background-color: white; vertical-apgn: top; } th { background-color: #C3D9FF; } p { margin-top: 6px; margin-bottom: 6px; } .example { padding: 6px 16px 6px 16px; border: 1px sopd #D7D7D7; margin: 6px 0px 28px 0px; background-color: #F7F7F7; } .example h3 { margin-top: 8px; margin-bottom: 8px; font-size: 12pt; } .special { font-style: itapc; } .idea { font-size: 9pt; color: #888; font-style: itapc; } .tight p { margin-top: 1px; margin-bottom: 1px; } .commentary { float: right; width: 200px; background-color: #ffffd0; padding:8px; border: 3px sopd #eeeeb0; margin: 10px 0px 10px 10px; } .commentary, .commentary * { font-size: 8pt; }
有两个重要要点来说明第html号档案和测试图谱。
系统.html是使用汇票空间的指定文件。
<html xmlns:concordion="http://www.concordion.org/2007/concordion">
系统.html使用“汇合:定指挥”确定临时变数的用户Name为Robert。 在此,用户Name是系统固定装置的绿化方法所要采用的参数。
When <span concordion:set="#userName">Robert</span> logs in the system
系统.html 平等指挥,以检查“绿色”功能(用户Name)的产量,为Hello Robert!
a greeting "<span concordion:assertEquals="getGreeting(#userName)"> Hello Robert!</span>" is displayed.
SystemFixture is a JUnit 测试 fixture annotated with ConcordionRunner.class.
@RunWith(ConcordionRunner.class) pubpc class SystemFixture {
该系统有一个向用户发送问候的便捷方法。
pubpc String getGreeting(String userName){ return system.getGreeting(userName); }
Step 5 - Running the Program
Right-cpck on the content area of SystemFixture and selected Run as >JUnit Test Case。 你们将看到以下成果,并取得大法官的成功。
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Congratulations, you have created your first Concordion Acceptance 测试 successfully. Further, let us start doing something more interesting in the next few chapters.
Concordion - set Command
调和板指令用于储存可用于其他协约指挥部的临时变量。
考虑以下要求:
The Sum of two numbers 2 and 3 will be 5.
如果我们想把第2和第3号作为参数,将其作为参数,并将其转化为参数,以便能够根据系统退回的结果加以核实,那么我们就能够使用和谐:在数字的交汇范围内进行指挥。
<p>The Sum of two numbers <span concordion:set = "#firstNumber">2</span> and <span concordion:set = "#secondNumber">3</span> will be <span concordion:assertEquals = "sum(#firstNumber, #secondNumber)">5 </span>.</p>
当《协约》对文件进行分类时,它将确定一个临时变量编号为“2”和2Number,其数值为“3”,然后称为“数额()”方法,其参数为“tNumber和#secondNumber”,并核实结果等于“5”。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specificiation file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { pubpc int sum(int firstNumber, int secondNumber) { return firstNumber + secondNumber; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc int sum(int firstNumber, int secondNumber) { return system.sum(firstNumber, secondNumber); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>Calculator Specifications</h1> <p>We are building onpne calculator support in our website.</p> <p>Following is the requirement to add two numbers:</p> <span class = "example"> <h3>Example</h3> <p>The Sum of two numbers <span concordion:set = "#firstNumber">2</span> and <span concordion:set = "#secondNumber">3</span> will be <span concordion:execute = "#result = sum(#firstNumber, #secondNumber)"></span> <span concordion:assertEquals = "#result">5</span>.</p> </span> </body> </html>
Once you are done with creating source and specification files, let us run the apppcation as JUnit 测试. If everything is fine with your apppcation, it will produce the following result −
C:DOCUME>1ADMINI>1LOCALS>1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of concordion 测试 run.
Concordion - assertEquals Command
1. 一致主张 平等指挥用于对照特定价值检查 Java豆财产或方法结果。
考虑以下要求:
The sum of two numbers 2 and 3 will be 5.
如果我们想将第2和第3号作为参数,并将其作为参数加以汇总,以便能够根据系统归还的5项结果加以核实,那么我们就能够使用和谐: 股权周围的对等指挥。
<p>The Sum of two numbers <span concordion:set="#firstNumber">2</span> and <span concordion:set="#secondNumber">3</span> will be <span concordion:assertEquals="sum(#firstNumber, #secondNumber)">5</span>.</p>
当《协约》对文件进行分类时,它将确定一个临时变量编号,即“2”和准号,即使用固定指挥的“3”价值,然后将参数定为“第一号”和“第二号”的总和计算方法,并核实结果等于“5”,使用权主张的指挥。
Example
让我们着手建立电子通讯系统,并遵循以下步骤,以建立和谐应用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specificiation file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { pubpc int sum(int firstNumber, int secondNumber) { return firstNumber + secondNumber; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc int sum(int firstNumber, int secondNumber) { return system.sum(firstNumber, secondNumber); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>Calculator Specifications</h1> <p>We are building onpne calculator support in our website.</p> <p>Following is the requirement to add two numbers:</p> <span class = "example"> <h3>Example</h3> <p>The Sum of two numbers <span concordion:set = "#firstNumber">2</span> and <span concordion:set = "#secondNumber">3</span> will be <span concordion:assertEquals = "sum(#firstNumber, #secondNumber)">5</span>.</p> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果根据你的申请对所有物品都处以罚款,那么就会得出以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Successes: 1, Failures: 0
Concordion - assertTrue Command
Concordion assertTrue command is used when the fixture needs to know the expected result in order to perform a 测试.
考虑以下要求:
User Name : Robert De The User name starts with R. The User name starts with S == false.
If we want a 测试 to be executed on the User Name and check whether the user name starts with R or not.
<p>User Name :<span concordion:set = "#userName">Robert De</span></p> <p>The User name <span concordion:assertTrue = "#userName.startsWith(#letter)">starts with <b concordion:set = "#letter">R</b></span>.</p> <p>The User name <span concordion:assertTrue = "#userName.startsWith(#letter)">starts with <b concordion:set = "#letter">S</b></span>.</p>
当Concordion parses the document时,它将设定一个临时变量,即“Robert De”。 然后,它将检查用户Name是否开始使用由下指挥部确定的字母缩略语变量所具体规定的信。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <p>User Name :<span concordion:set = "#userName">Robert De</span></p> <p>The User name <span concordion:assertTrue = "#userName.startsWith(#letter)">starts with <b concordion:set = "#letter">R</b></span>.</p> <p>The User name <span concordion:assertTrue = "#userName.startsWith(#letter)">starts with <b concordion:set = "#letter">S</b></span>.</p> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 1
System.html is the output of Concordion 测试 run.
Concordion - assertFalse Command
Concordion assertFalse command is used when the fixture needs to know the expected result in order to perform a 测试.
考虑以下要求:
User Name : Robert De The User name does not start with S.
If we want a 测试 to be executed on the User Name and check that the user name does not start with S.
<p>User Name :<span concordion:set = "#userName">Robert De</span></p> <p>The User name <span concordion:assertFalse = "#userName.startsWith(#letter)">does not start with <b concordion:set = "#letter">S</b></span>.</p>
当Concordion parses the document时,它将设定一个临时变量,即“Robert De”。 然后,它将检查用户Name是否开始使用在下指挥部设置的字母变量所具体规定的信。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <p>User Name :<span concordion:set = "#userName">Robert De</span></p> <p>The User name <span concordion:assertFalse = "#userName.startsWith(#letter)"> does not start with <b concordion:set = "#letter"> S</b></span>.</p> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - execute Command
Concordion execute command is used run the operation of concordion fixture. 考虑以下要求:
The sum of two numbers 2 and 3 will be 5.
如果我们想写出一笔总付的具体规定,接受两个数字并得出其数额,那么具体安排如下:
<p>The Sum of two numbers <span concordion:set = "#firstNumber">2</span> and <span concordion:set = "#secondNumber">3</span> will be <span concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> </span><span concordion:assertEquals = "#result">5</span>.</p>
在对文件进行分类时,它将设定一个临时变量,即“2”和“2”数值为“3”,然后采用“1”和“2”等参数的总和法,并将结果确定为“0”和“2”数值,并核实“5”等于“5”。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { pubpc int sum(int firstNumber, int secondNumber) { return firstNumber + secondNumber; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc int sum(int firstNumber, int secondNumber) { return system.sum(firstNumber, secondNumber); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>Calculator Specifications</h1> <p>We are building onpne calculator support in our website.</p> <p>Following is the requirement to add two numbers:</p> <span class = "example"> <h3>Example</h3> <p>The Sum of two numbers <span concordion:set = "#firstNumber">2</span> and <span concordion:set = "#secondNumber">3</span> will be <span concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> </span><span concordion:assertEquals = "#result">5</span>.</p> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Returning Object
协调一致的执行指挥可以用来取得以物体形式的行为的结果,我们可以通过这种行动获得多种产出。 例如,考虑以下要求:
The full name Robert De is to be broken into first name Robert and last name De.
在这里,我们需要有一种单独的功能,即接受用户名称,并将具有第一名称和最后名称的物体归为其财产,以便我们能够使用。
如果我们想为这种可预期用户名称和输出结果物体的分职能写一个规格,那么具体如下:
<p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p>
协约在将文件贴上正文时,将把特别变式文本的价值确定为“罗伯特·德”这一现有要素的价值,并将其传递给分裂的职能。 然后,它将使用执行指挥系统执行分部分()法,参数为“信标”,并将结果确定为“结果”变量,并使用结果物体,将第一Name和最后Name特性作为产出。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with the name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using the Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System, Result under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是结果的内容。 java文档
package com.tutorialspoint; pubpc class Result { private String firstName; private String lastName; pubpc String getFirstName() { return firstName; } pubpc void setFirstName(String firstName) { this.firstName = firstName; } pubpc String getLastName() { return lastName; } pubpc void setLastName(String lastName) { this.lastName = lastName; } }
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { pubpc Result sppt(String userName){ Result result = new Result(); String[] words = userName.sppt(" "); result.setFirstName(words[0]); result.setLastName(words[1]); return result; } }
下面是系统数据系统的内容。
package specs.tutorialspoint; import com.tutorialspoint.Result; import com.tutorialspoint.System; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc Result sppt(String userName){ return system.sppt(userName); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p> </span> </body> </html>
一旦你着手制作来文方和特稿档案,我们便可以把申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Returning Map
协调一致的执行指挥可用来以地图的形式获得行为的结果,我们可以通过地图获得行为方面的多重产出。 例如,考虑以下要求:
The full name Robert De is to be broken into its first name Robert and last name De.
在这里,我们需要一个星座功能,接受用户名称,并将具有第一Name和最后Name的地图标作为具有相应价值的钥匙,以便我们能够使用。
如果我们想为这种分职能写一个具体内容,即接受用户名称和输出结果标的,那么具体如下:
<p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p>
协约在对文件进行分类时,将把特别变标本的价值确定为“Robert De”这一现有要素的价值,并将其传递给分裂的职能。 然后,它将使用执行指挥系统执行分部分()法,参数为“信标”,并将结果确定为“结果”变量,并使用结果图,将第一Name和最后Name数值作为产出。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; import java.util.HashMap; import java.util.Map; pubpc class System { pubpc Map sppt(String userName){ Map<String, String> result = new HashMap<String, String>(); String[] words = userName.sppt(" "); result.put("firstName", words[0]); result.put("lastName", words[1]); return result; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import java.util.Map; import com.tutorialspoint.Result; import com.tutorialspoint.System; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc Map<String, String> sppt(String userName){ return system.sppt(userName); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p> </span> </body> </html>
一旦你着手制作来文方和特稿档案,我们便可以把申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 1, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Returning MultiValueResult
协调一致的执行指挥可用来以地图的形式获得行为的结果,我们可以通过地图获得行为方面的多重产出。 例如,考虑以下要求:
The full name Robert De is to be broken into its first name Robert and last name De.
在这里,我们需要有一种单独的功能,接受用户名称,并归还一个具有第一Name和最后Name的地图物体,作为其具有相应价值的钥匙,以便我们能够加以利用。
如果我们想为这种分职能写一个具体内容,即接受用户名称和结果标的输出,那么具体内容如下:
<p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p>
协约在对文件进行分类时,将把特别变标本的价值确定为“罗伯特·德”现有要素的价值,并将其传递给分裂功能。 然后,它将采用分部分()法,使用执行指令,将结果确定为“结果”变量,使用结果图,将第一Name和最后Name数值作为产出。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with the name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; import org.concordion.api.MultiValueResult; pubpc class System { pubpc MultiValueResult sppt(String userName){ MultiValueResult result = new MultiValueResult(); String[] words = userName.sppt(" "); result.with("firstName", words[0]).with("lastName", words[1]); return result; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.api.MultiValueResult; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc MultiValueResult sppt(String userName){ return system.sppt(userName); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)">Robert De</span> is to be broken into first name <span concordion:assertEquals = "#result.firstName">Robert</span> and last name <span concordion:assertEquals = "#result.lastName">De</span>.</p> </span> </body> </html>
一旦你着手制作来文方和特稿档案,我们便可以把申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 2, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Execute on Table
和谐执行指挥可用来以重复的方式管理和谐装置。 例如,如果我们想以表格的形式以多种实例说明一项要求,那将是有益的。
考虑以下要求:
<table> <tr><th>First Number</th><th>Second Number</th><th>Sum</th></tr> <tr><td>2</td><td>3</td><td>5</td></tr> <tr><td>4</td><td>5</td><td>9</td></tr> </table>
如果我们想写出一笔总付的具体规定,接受两个数字并得出其数额,那么具体内容如下:
<table> <tr><th>First Number</th><th>Second Number</th><th>Sum</th></tr> <tr concordion:execute = "#result = sum(#fullName)"> <td concordion:set = "#firstNumber">2</td> <td concordion:set = "#secondNumber">3</td> <td concordion:assertEquals = "#result">5</td> </tr> <tr concordion:execute = "#result = sum(#fullName)"> <td concordion:set = "#firstNumber">4</td> <td concordion:set = "#secondNumber">5</td> <td concordion:assertEquals = "#result">9</td> </tr> </table>
在对文件进行分类时,它将设定一个临时变量,即“2”和“2”数值为“3”。 然后,它将使用执行指挥法,采用“第一号”和“第二号”参数的总和法,并将结果确定为“数字变量”,并核实“数字”等于“5”。 每一表增长部分都重复了这一过程。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; pubpc class System { pubpc int sum(int firstNumber, int secondNumber) { return firstNumber + secondNumber; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc int sum(int firstNumber, int secondNumber) { return system.sum(firstNumber, secondNumber); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>Calculator Specifications</h1> <p>We are building onpne calculator support in our website.</p> <p>Following is the requirement to add two numbers:</p> <span class = "example"> <h3>Example</h3> <table> <tr> <th>First Number</th> <th>Second Number</th> <th>Sum</th> </tr> <tr concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> <td concordion:set = "#firstNumber">2</td> <td concordion:set = "#secondNumber">3</td> <td concordion:assertEquals = "#result">5</td> </tr> <tr concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> <td concordion:set = "#firstNumber">4</td> <td concordion:set = "#secondNumber">5</td> <td concordion:assertEquals = "#result">9</td> </tr> </table> </span> </body> </html>
一旦你着手制作来文方和特稿档案,我们便可以把申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 2, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Execute on List
和谐执行指挥可用来以重复的方式管理和谐装置。 例如,如果我们想以清单的形式以多种实例说明一项要求,将是有益的。
考虑以下要求:
<ul> <p>The full name Robert De is to be sppt as <ul> <p>Robert</p> <p>De</p> </ul> </p> <p>The full name John Diere is to be sppt as <ul> <p>John</p> <p>Diere</p> </ul> </p> </ul>
如果我们想写一个划分职能的具体内容,把名字分为头一个名字和最后名字,那么具体内容如下:
<ul> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)"> Robert De</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName">Robert</span></p> <p><span concordion:assertEquals = "#result.lastName">De</span></p> </ul> </p> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)"> John Diere</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName">John</span></p> <p><span concordion:assertEquals = "#result.lastName">Diere</span></p> </ul> </p> </ul>
协约在对文件进行分类时,将把特别变标本的价值确定为“Robert De”这一现有要素的价值,并将其传递给分裂的职能。 然后,它将采用分部分()方法,使用执行指令,将结果确定为零结果变量,并使用结果,将第一Name和最后Name数值作为产出。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; import org.concordion.api.MultiValueResult; pubpc class System { pubpc MultiValueResult sppt(String userName){ MultiValueResult result = new MultiValueResult(); String[] words = userName.sppt(" "); result.with("firstName", words[0]).with("lastName", words[1]); return result; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.api.MultiValueResult; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc MultiValueResult sppt(String userName){ return system.sppt(userName); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <ul> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)"> Robert De</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName"> Robert</span></p> <p><span concordion:assertEquals = "#result.lastName"> De</span></p> </ul> </p> <p>The full name <span concordion:execute ="#result = sppt(#TEXT)"> John Diere</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName"> John</span></p> <p><span concordion:assertEquals = "#result.lastName"> Diere</span></p> </ul> </p> </ul> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 4, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - verifyRows Command
Concordion verifyRows command can be used to check the content of a collection returned as a result by the system. For example, if we set up a set of users in the system and do a partial search on them, then the system should return the matching elements, otherwise our acceptance 测试s should fail.
考虑以下要求:
<table> <tr><th>Users</th></tr> <tr><td>Robert De</td></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table> <p>Search for J should return:</p> <table> <tr><th>Matching Users</th></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table>
如果我们想写出这种搜索功能的具体内容,以便搜寻和返还收集,那么具体内容将如下:
<table concordion:execute = "addUser(#username)"> <tr><th concordion:set = "#username">Username</th></tr> <tr><td>Robert De</td></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table> <p>Search for "<b concordion:set = "#searchString">J</b>" should return:</p> <table concordion:verifyRows = "#username : search(#searchString)"> <tr><th concordion:assertEquals = "#username">Matching Usernames</th></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table>
如果《协约》对该文件作了规定,它将在第一桌的每一行上执行添加“User()”,然后将搜寻标准定为J. 其次,《协约》将履行搜索功能,该功能应归还有可预见扰动的物体(例如,清单、联系HashSet或树木Set),核查。 每一件藏书都有罗,并负责指挥。
Example
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture class SystemFixture under the specs.tutorialspoint package. |
5 | Create Specification html System.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; import java.util.HashSet; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; pubpc class System { private Set<String> users = new HashSet<String>(); pubpc void addUser(String username) { users.add(username); } pubpc Iterable<String> search(String searchString) { SortedSet<String> matches = new TreeSet<String>(); for (String username : users) { if (username.contains(searchString)) { matches.add(username); } } return matches; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc void addUser(String username) { system.addUser(username); } pubpc Iterable<String> search(String searchString) { return system.search(searchString); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to add a partial search capabipty on user names:</p> <span class = "example"> <h3>Example</h3> <table concordion:execute = "addUser(#username)"> <tr><th concordion:set = "#username">Username</th></tr> <tr><td>Robert De</td></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table> <p>Search for "<b concordion:set = "#searchString">J</b>" should return:</p> <table concordion:verifyRows = "#username : search(#searchString)"> <tr><th concordion:assertEquals = "#username">Matching Usernames</th></tr> <tr><td>John Diere</td></tr> <tr><td>Jupe Re</td></tr> </table> </span> </body> </html>
一旦你着手制作来文方和特稿档案,我们便可以把申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 2, Failures: 0
System.html is the output of Concordion 测试 run.
Concordion - Run Command
协调一致的指挥可以用来将多种规格联系起来,并在一个中央网页上显示。 这种指挥可以操作所有规格,同时酌情展示绿线/红外线的链接背景。
现在,我们将制定两个规格,并将其联系起来。 我们应重新使用
andExample
让我们有一个行之有效的电子数据交换所,并遵循以下步骤,以建立一项协调适用——
Step | Description |
---|---|
1 | Create a project with a name concordion and create a package com.tutorialspoint under the src folder in the created project. |
2 | Add the required Concordion pbraries using Add External JARs option as explained in the Concordion - First Apppcation chapter. |
3 | Create Java class System under the com.tutorialspoint package. |
4 | Create Fixture classes SystemFixture, CalculatorFixture under the specs.tutorialspoint package. |
5 | Create Specification html files System.html, Calculator.html under the specs.tutorialspoint package. |
6 | The final step is to create the content of all the Java files and specification file and run the apppcation as explained below. |
这里是该系统的内容。 java文档
package com.tutorialspoint; import org.concordion.api.MultiValueResult; pubpc class System { pubpc MultiValueResult sppt(String userName){ MultiValueResult result = new MultiValueResult(); String[] words = userName.sppt(" "); result.with("firstName", words[0]).with("lastName", words[1]); return result; } pubpc int sum(int firstNumber, int secondNumber) { return firstNumber + secondNumber; } }
以下是该系统的内容。 java文档
package specs.tutorialspoint; import org.concordion.api.MultiValueResult; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class SystemFixture { System system = new System(); pubpc MultiValueResult sppt(String userName){ return system.sppt(userName); } }
计算法的内容如下。 java文档
package specs.tutorialspoint; import org.concordion.integration.junit4.ConcordionRunner; import org.junit.runner.RunWith; import com.tutorialspoint.System; @RunWith(ConcordionRunner.class) pubpc class CalculatorFixture { System system = new System(); pubpc int sum(int firstNumber, int secondNumber) { return system.sum(firstNumber, secondNumber); } }
以下是该系统的内容。
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>System Specifications</h1> <p>We are building specifications for our onpne order tracking apppcation.</p> <p>Following is the requirement to sppt full name of a logged in user to its constituents by spptting name by whitespace:</p> <span class = "example"> <h3>Example</h3> <ul> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)"> Robert De</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName"> Robert</span></p> <p><span concordion:assertEquals = "#result.lastName"> De</span></p> </ul> </p> <p>The full name <span concordion:execute = "#result = sppt(#TEXT)"> John Diere</span> is to be sppted as <ul> <p><span concordion:assertEquals = "#result.firstName"> John</span></p> <p><span concordion:assertEquals = "#result.lastName"> Diere</span></p> </ul> </p> </ul> </span> <a concordion:run = "concordion" href = "Calculator.html"> Calculator Service Specifications</a> </body> </html>
以下是计算器.html文档的内容:
<html xmlns:concordion = "http://www.concordion.org/2007/concordion"> <head> <pnk href = "../concordion.css" rel = "stylesheet" type = "text/css" /> </head> <body> <h1>Calculator Specifications</h1> <p>We are building onpne calculator support in our website.</p> <p>Following is the requirement to add two numbers:</p> <span class = "example"> <h3>Example</h3> <table> <tr> <th>First Number</th> <th>Second Number</th> <th>Sum</th> </tr> <tr concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> <td concordion:set = "#firstNumber">2</td> <td concordion:set = "#secondNumber">3</td> <td concordion:assertEquals = "#result">5</td> </tr> <tr concordion:execute = "#result = sum(#firstNumber, #secondNumber)"> <td concordion:set = "#firstNumber">4</td> <td concordion:set = "#secondNumber">5</td> <td concordion:assertEquals = "#result">9</td> </tr> </table> </span> </body> </html>
一旦你造就了来源和规格档案,我们就将申请作为JUSG测试。 如果在你提出申请后,所有物品都会被罚款,那么就会产生以下结果:
C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 2, Failures: 0 C:DOCUME~1ADMINI~1LOCALS~1Tempconcordionspecs utorialspointSystem.html Successes: 6, Failures: 0
System.html is the output of Concordion 测试 run.
链接计算器服务规格。 你将看到以下产出:
Advertisements