0

TestSimulation.scala ファイルの「setUp」メソッドで何が問題になったのかを突き止めようとして問題が発生しています。「シンボル設定を解決できません」というエラーがスローされますIntellij 13.1.5 から、以下に示すように、Simulation.class ファイルから選択する 2 種類の「宣言」があることが示されます。どちらを選択しても問題は解決しないようです。手伝ってください。

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

1 に答える 1

0

プロジェクトが適切な Scala バージョン (Gatling 2.0 の場合は 2.10、マスター/今後の 2.1 の場合は 2.11) をターゲットにしていることは確かですか?

于 2014-11-05T13:49:33.867 に答える