2014-11-05 107 views
0

我在试图弄清楚TestSimulation.scala文件中我的'setUp'方法出了什么问题。它会抛出错误“无法解析符号设置”从Intellij 13.1.5中,它显示我有两种类型的'声明'可以从Simulation.class文件中进行选择,如下所示。选择任何一个似乎都不能解决问题。请协助。Gatling 2.0:无法调用setUp方法

Simulation.class:

package io.gatling.core.scenario 
    abstract class Simulation() extends scala.AnyRef { 
    .... 
    def setUp(scenarios : io.gatling.core.structure.PopulatedScenarioBuilder*) : Simulation.this.SetUp = { /* compiled code */ } 

class SetUp() extends scala.AnyRef { 
    ....} 
    def setUp(scenarios : scala.List[io.gatling.core.structure.PopulatedScenarioBuilder]) : Simulation.this.SetUp = { /* compiled code */ } 
    } 

TestSimulation.scala:

import io.gatling.core.Predef._ 
import io.gatling.http.Predef._ 
import sim_replacement.SimReplacement 
import scala.concurrent.duration._ 

class TestSimulation extends Simulation { 

    val httpProtocol = http 
    .baseURL("http://xx.xx.x.xx") 
    .inferHtmlResources(BlackList(""".*\.css""", """.*\.js""", """.*\.ico"""), WhiteList()) 
    .acceptHeader("""*/*""") 
    .acceptEncodingHeader("""gzip,deflate,sdch""") 
    .acceptLanguageHeader("""en-US,en;q=0.8""") 
    .contentTypeHeader("""application/x-www-form-urlencoded""") 
    .userAgentHeader("""Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36""") 

    setUp(
    SimReplacement.scn 
     .inject(rampRate(5 usersPerSec) to (100 usersPerSec) during (5 minutes)) 
     .protocolConfig(httpProtocol) 
    ) 

回答

0

你确定你的项目的目标适当的斯卡拉版本(2.10加特林2.0,2.11的主/ 2.1即将推出) ?

+0

我的Scala库包括以下类别和来源: 斯卡拉-2.10.2的\ src \斯卡拉 - 演员 - src.jar 斯卡拉-2.10.2的\ src \斯卡拉库-src.jar scala- 2.10.2 \ src \ scala-swing-src.jar – user2948219 2014-11-06 04:25:32

+0

你确定你的模块有Scala方面吗? – 2014-11-06 09:21:11