-
Notifications
You must be signed in to change notification settings - Fork 18
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
Showing
17 changed files
with
148 additions
and
30 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
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
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ALTER TABLE thread_pool_config | ||
ADD COLUMN queue_size INTEGER | ||
NOT NULL | ||
DEFAULT 256 | ||
CHECK (queue_size >= -1); | ||
|
||
COMMENT ON COLUMN thread_pool_config.queue_size IS 'size of the execution queue for a specific thread pool'; |
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
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 @@ | ||
|
||
object Version { | ||
|
||
val octopartsVersion = "2.5" | ||
val octopartsVersion = "2.5.1" | ||
val theScalaVersion = "2.11.7" | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
test/com/m3/octoparts/hystrix/HystrixSetterSupportSpec.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,20 @@ | ||
package com.m3.octoparts.hystrix | ||
|
||
import com.m3.octoparts.support.mocks.ConfigDataMocks | ||
import org.scalatest._ | ||
|
||
class HystrixSetterSupportSpec extends FunSpec with Matchers with ConfigDataMocks { | ||
|
||
val subject = new HystrixSetterSupport {} | ||
|
||
describe("#threadPoolSetter") { | ||
|
||
it("should return a Hystrix ThreadPool setter with queue size and queue threshold size set to the config item's queue size") { | ||
val r = subject.threadPoolSetter(mockThreadConfig) | ||
r.getMaxQueueSize shouldBe mockThreadConfig.queueSize | ||
r.getQueueSizeRejectionThreshold shouldBe mockThreadConfig.queueSize | ||
} | ||
|
||
} | ||
|
||
} |
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package integration | ||
|
||
import org.openqa.selenium.htmlunit.HtmlUnitDriver | ||
import org.scalatest.{ Matchers, FunSpec } | ||
import org.scalatest.selenium.{ Page => SeleniumPage } | ||
import org.scalatest.concurrent.{ IntegrationPatience, ScalaFutures } | ||
import org.scalatestplus.play.{ HtmlUnitFactory, OneBrowserPerSuite, OneServerPerSuite } | ||
|
||
class AdminSpec | ||
extends FunSpec | ||
with OneServerPerSuite | ||
with OneBrowserPerSuite | ||
with HtmlUnitFactory | ||
with Matchers | ||
with ScalaFutures | ||
with IntegrationPatience { | ||
|
||
val htmlunitDriver = webDriver.asInstanceOf[HtmlUnitDriver] | ||
htmlunitDriver.setJavascriptEnabled(false) | ||
|
||
def baseUrl: String = { | ||
s"http://localhost:$port" | ||
} | ||
|
||
object ThreadPoolAddPage extends SeleniumPage { | ||
val url: String = s"$baseUrl/admin/thread-pools/new" | ||
} | ||
|
||
describe("adding a thread pool") { | ||
|
||
it("should work and redirect me to the show page") { | ||
val name = s"my little pool ${java.util.UUID.randomUUID}" | ||
val size = 10 | ||
val queueSize = 500 | ||
goTo(ThreadPoolAddPage) | ||
textField("threadPoolKey").value = name | ||
numberField("coreSize").value = s"$size" | ||
numberField("queueSize").value = s"$queueSize" | ||
submit() | ||
eventually { | ||
pageTitle should include("Thread pool details") | ||
} | ||
val descriptors = findAll(TagNameQuery("dd")) | ||
descriptors.find(_.text == name) shouldBe 'defined | ||
descriptors.find(_.text == size.toString) shouldBe 'defined | ||
descriptors.find(_.text == queueSize.toString) shouldBe 'defined | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.