-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sunjun
committed
Jun 13, 2019
1 parent
d2133a5
commit 8db745c
Showing
4 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
name := "gatling-dubbo" | ||
|
||
version := "2.0.1" | ||
version := "2.0.2" | ||
|
||
scalaVersion := "2.12.6" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/scala/io/gatling/dubbo/check/DubboCustomCheck.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.gatling.dubbo.check | ||
|
||
import io.gatling.commons.validation._ | ||
import io.gatling.core.check.CheckResult | ||
import io.gatling.core.session.Session | ||
import io.gatling.dubbo.DubboCheck | ||
|
||
import scala.collection.mutable | ||
|
||
case class DubboCustomCheck(func: String => Boolean, failureMessage: String = "Dubbo check failed") extends DubboCheck { | ||
override def check(response: String, session: Session)(implicit cache: mutable.Map[Any, Any]): Validation[CheckResult] = { | ||
func(response) match { | ||
case true => CheckResult.NoopCheckResultSuccess | ||
case _ => Failure(failureMessage) | ||
} | ||
} | ||
} |