简体   繁体   English

Fitnesse固定装置-找不到设置方法

[英]fitnesse fixture - can't find setter methods

I have written a couple of fixtures that I have been able to manage to run too so far.however,I'm stuck on this attempt and I don't have a clue as to where I'm going wrong. 我已经写了一些固定装置,我已经设法使它们运行得太远了。但是,我一直坚持这种尝试,而且我不知道哪里出了问题。

My test wiki looks like this 我的测试维基看起来像这样

Pattern Engine Report Page Test

start date  end date    start time  end time    submit result ?
x            x            x                x                false
x            x            x                0                false

The execution actually leads to errors (trivial) I should add since the values set in the decision table are not being injected via the respective setter methods. 由于未通过相应的setter方法注入决策表中设置的值,因此执行实际上会导致错误(琐碎),我应该添加。 在此处输入图片说明

The Fixture code is as follows 灯具代码如下

package com.fit.fixtures;

import org.apache.log4j.Logger;

import com.fit.PatternEngineMainPageScenario;

public class PatternEngineReportPageTest {

    public PatternEngineReportPageTest() {
        log.debug("Created instance of test class ");
    }

    private static final Logger log = Logger.getLogger(PatternEngineReportPageTest.class);

    private String appName;

    private String startDate;

    private String endDate;

    private String startTime;

    private String endTime;

    public void setAppName(String applicationName) {
        this.appName = applicationName;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String submitResult() {
        log.debug("Starting to test");
        System.out.println("Starting to test");
        PatternEngineMainPageScenario launchPageScenario = new PatternEngineMainPageScenario();
        return String.valueOf(launchPageScenario.launchMainPage("", startDate, endDate, startTime, endTime));
    }


}

The fixture as you can see is devoid of too much logic and most of it is in the PatternEngineMainPageScenario class. 如您所见,该固定装置没有太多逻辑,并且大多数在PatternEngineMainPageScenario类中。

My concern is the bare minimum logic of just calling the respective setters is not happening as expected.Please help 我担心的是,仅调用相应的二传手的最低限度的逻辑并没有按预期发生。请帮助

It looks like your test is split into 2 tables, so 'start date' is treated like another fixture name. 看来您的测试已分为2个表格,因此“开始日期”被视为另一个灯具名称。 Make sure there's no blank line between the test table rows. 确保测试表行之间没有空白行。

|pattern engine report page test|
|start date|etc|
|etc|etc|

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM