【发布时间】:2019-11-22 18:16:53
【问题描述】:
我希望有一个包含 util 变量的文件,以便在我的模拟类中重用,但出现以下错误:
18:15:22.702 [ERROR] i.g.c.ZincCompiler$ - /app/simulations/keyword_search/test.scala:9:20: object Args is not a member of package simulations
import simulations.Args._
^
18:15:22.711 [ERROR] i.g.c.ZincCompiler$ - /app/simulations/keyword_search/test.scala:12:13: not found: value name
println(name)
^
18:15:22.726 [ERROR] i.g.c.ZincCompiler$ - two errors found
18:15:22.740 [ERROR] i.g.c.ZincCompiler$ - Compilation crashed
我有以下场景:
项目路径:
simulations/
--keyword_search/
----test.scala
--args.scala
simulations/args.scala 文件:
package simulations
object Args {
val name = "bla"
}
simulations/keyword_search/test.scala 文件:
package simulations.keyword_search
import simulations.Args._
class Test extends Simulation {
print(name)
}
我正在使用以下脚本运行 gatling:
gatling -sf /app/simulations/keyword_search -s simulations.keyword_search.Test
这是正确的吗?我错过了什么吗?
【问题讨论】: