English 中文(简体)
Concordion - run Command
  • 时间:2024-03-24 19:17:28

Concordion - Run Command


Previous Page Next Page  

协调一致的指挥可以用来将多种规格联系起来,并在一个中央网页上显示。 这种指挥可以操作所有规格,同时酌情展示绿线/红外线的链接背景。

现在,我们将制定两个规格,并将其联系起来。 我们应重新使用制定的规格,“Concordion - Execute on List and Concordion - Execute on Table Chapter as System specifiedations and rapor specifiedations.

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 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

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

concordion Run Command Output

链接计算器服务规格。 你将看到以下产出:

concordion Output
Advertisements