参数化构造函数是否有其他选择 [英] Is there any alternative for the parameterized constructor

查看:93
本文介绍了参数化构造函数是否有其他选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我必须进行性能测试.为此,我创建了一个脚本,必须传递要进行性能测试的相应方法名称.
我拥有另一个测试类中提供的所有方法.
并且测试类应该只具有一个零参数构造函数.这是场景.
问题是,每当我尝试在perftestclass中传递该方法名称时,都会出现类似创建参数化构造函数以对其进行初始化之类的错误.这是绝对正确的.
但是我的testclass不允许我创建参数化的构造函数.
所以我的问题是,这还有其他选择吗?
如果有人有解决方案,请回复...
谢谢...

Hi All,
I have to do performance testing.for that I have created one script in that I have to pass respective method name against which i have to do performance testing.
i have all the methods provided in the another test class.
and test class should have exactly one zero-argument constructor. This is the scenario.
problem is, whenever I try to pass that method name in the perftestclass it gives me an error like "create parameterized constructor to initialize it. And it is absolutely right.
but my testclass doesn''t allow me to create a paramaterized constructor.
So my question is, is there any alternative for this?
please reply if anybody has solution...
Thank you...

推荐答案

尝试在具有空值的非参数化构造函数中初始化您的testclass.也许会有帮助
try initializing your testclass in non-parameterized constructor with NULL values. Maybe this will help


这篇关于参数化构造函数是否有其他选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆