Scala sydoct2011

  • 634 views
Uploaded on

Talk about cloud apis and scala, how to mock and test them in a meaningful way with mockito. Presented to scalasyd in Oct 2011

Talk about cloud apis and scala, how to mock and test them in a meaningful way with mockito. Presented to scalasyd in Oct 2011

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
634
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. Mocking the cloudMichael Neale@michaelnealegithub.com/michaelneale
  • 2. @cloudbees Hosted apps (PaaS a la GAE etc) Jenkins/hudson “as a service” lotsa elastic servers, variable load in production !
  • 3. Where scala: Provisioning: Build servers, masters, new hosts, allocation “cloud controller” app Some Play! framework, some maven
  • 4. CloudBees controller providore storageApp pool DB clusters Master pool Slave pool scala
  • 5. Why scala? Easy ! * Saved time (early startup - I had to wear lots of hats) * Types help hard to reach (test) places * And why not
  • 6. Result? New staff come on, able to contribute, maintain. No issues. But they aren’t idiots.
  • 7. Next time?Seriously look at scala “native” things (akka)Avoid faux-oo - instead use objects as namespacesMonadic IO - Monadic server/cloudoperations?
  • 8. server = do instance = launch_server "image-id" volume = create_volume_for instance "10G" return attach_volume instance volume
  • 9. To the cloud (jclouds + scala) Avert your eyes children...
  • 10. CloudClient “Discovered” semantics: Start, Stop, List, Status, Volume Create, Attach etc.. Create own easily mockable cloud api (trait) Don’t try this at home... (EBS sob stories for another time - pushed provisioning api to the limit)
  • 11. Mockito + Scalatest Runs nicely in IDEA runner TestX extends ShouldMatchers (scalatest) import org.mockito.{Matchers, ArgumentCaptor}
  • 12. Also: the REPL Invaluable: Controlled “live” testing Explore api behaviors, inspect Data in “hazelcast” - reload new version, continue Testing with real things == expensive