English 中文(简体)
Concordion - execute Command
  • 时间:2024-03-24 19:22:08

Concordion - execute Command


Previous Page Next Page  

调和式护卫用于调和装置的运行。 考虑以下要求:

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

系统.html是Concordion测试的结果。

concordion Execute Command Output Advertisements