【问题标题】:java.lang.ArrayIndexOutOfBoundsException error displayed when run soapUI testsuite through jenkins通过jenkins运行soapUI testsuite时显示java.lang.ArrayIndexOutOfBoundsException错误
【发布时间】:2017-12-15 05:58:47
【问题描述】:

当我通过 jenkins 运行测试套件时,日志中显示“java.lang.ArrayIndexOutOfBoundsException”错误。 发生错误的行。

def randomuserserial = Long.toUnsignedString(new Random().nextLong().abs(), 16).toUpperCase()

当我在本地机器上运行相同的套件时没有发生错误。

【问题讨论】:

    标签: jenkins groovy soapui


    【解决方案1】:

    问题在于 Jenkins 服务器中安装的 SoapUI(5.3.0) 版本。 更新到最新版本(5.4.0)后,就可以正常使用了。

    【讨论】:

    • 奇怪。但很高兴知道。
    • true 在soapui 5.3.0 上尝试了该命令,但出现错误。一旦我升级它就消失了。看起来变量的限制在最新版本中增加了
    【解决方案2】:

    看起来您的要求是生成一个随机的无符号长数字。所以你可以尝试这样的事情:

    def min = 1000000000000000
    def max = 9223372036854775807
    
    def rand = new Random()
    int range = max-min
    def random_long = rand.nextInt(range) + min
    
    def randomuserserial = random_long.toString().toUpperCase()
    

    这应该可以解决您的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-05
      • 2014-08-13
      • 2017-08-25
      • 1970-01-01
      • 2020-11-18
      • 1970-01-01
      • 1970-01-01
      • 2017-02-05
      相关资源
      最近更新 更多