{"id":294,"date":"2013-05-30T08:00:21","date_gmt":"2013-05-29T23:00:21","guid":{"rendered":"http:\/\/www.beeete2.com\/blog\/?p=294"},"modified":"2020-01-18T16:55:53","modified_gmt":"2020-01-18T07:55:53","slug":"playframework2%e3%81%a7%e3%83%86%e3%82%b9%e3%83%88%e3%82%92%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.beeete2.com\/blog\/?p=294","title":{"rendered":"playframework2\u3067\u30c6\u30b9\u30c8\u3092\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>Playframework2\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u69cb\u6210\u3092\u307f\u3066\u307f\u308b\u3068\u3001test\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nApplicationTest.java\u3068\u3044\u3046\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u3042\u308a\u3001\u3053\u306e\u4e2d\u3092\u307f\u3066\u307f\u308b\u3068\u3001<br \/>\n[java]<br \/>\npublic class ApplicationTest {<br \/>\n    @Test<br \/>\n    public void simpleCheck() {<br \/>\n        int a = 1 + 1;<br \/>\n        assertThat(a).isEqualTo(2);<br \/>\n    }<\/p>\n<p>    @Test<br \/>\n    public void renderTemplate() {<br \/>\n        Content html = views.html.index.render(&quot;Your new application is ready.&quot;);<br \/>\n        assertThat(contentType(html)).isEqualTo(&quot;text\/html&quot;);<br \/>\n        assertThat(contentAsString(html)).contains(&quot;Your new application is ready.&quot;);<br \/>\n    }<br \/>\n}<br \/>\n[\/java]<br \/>\n\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068\u5b9f\u884c\u3067\u304d\u308b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304b\u3002<\/p>\n<p>\u666e\u901a\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3080\u3068\u3001\u30e2\u30c7\u30eb\u306e\u30c6\u30b9\u30c8\u306f\u7c21\u5358\u306b\u3067\u304d\u3066\u3082\u3001\u30d3\u30e5\u30fc\u3084\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30c6\u30b9\u30c8\u3063\u3066\u3001\u304b\u306a\u308a\u53b3\u3057\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\nRequest\u3084\u3089Session\u3084\u3089\u51fa\u3066\u304d\u305f\u3089\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u4f5c\u3063\u3066\u3001\u30e2\u30c3\u30af\u4f5c\u3063\u3066\u30fb\u30fb\u30fb\u3002\u3063\u3066\u3001\u7d50\u5c40\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u308b\u6642\u9593\u304c\u3059\u3054\u304f\u9577\u304f\u306a\u308a\u3001\u3082\u3046\u3044\u3044\u3084\u3063\u3066\u306a\u3063\u3061\u3083\u3046\u3053\u3068\u3082\u3042\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u30fc\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3053\u307e\u3067\u3084\u3089\u306a\u304f\u3066\u3082\u3001\u3067\u3082\u30c6\u30b9\u30c8\u3057\u3066\u5b9f\u884c\u3057\u3066\u307f\u305f\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u3068\u3001Jetty\u305f\u3061\u3042\u3052\u3066\u3001\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u3066\u7d50\u679c\u3092\u30a2\u30b5\u30fc\u30b7\u30e7\u30f3\u3057\u3066\u307f\u3066\u3001\u3063\u3066\u3053\u308c\u306f\u3053\u308c\u3067\u7d50\u69cb\u9762\u5012\u306a\u3093\u3067\u3059\u3088\u306d\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u3067\u3082\u3001Playframework2\u306f\u305d\u306e\u307e\u307e\u5b9f\u884c\u3067\u304d\u3066\u3001\u30d3\u30e5\u30fc\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u7d50\u679c\u304c\u5e30\u3063\u3066\u304f\u308b\u3002\u3044\u3084\u30fc\u3001\u3073\u3063\u304f\u308a\u3057\u307e\u3057\u305f\u3002<br \/>\n\u7d50\u5c40\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u306e\u898b\u305f\u76ee\u306e\u30c6\u30b9\u30c8\u3082\u91cd\u8981\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u30b3\u30fc\u30c9\u30ec\u30d9\u30eb\u3067\u306e\u30c6\u30b9\u30c8\u3082\u3001\u3067\u304d\u308b\u306b\u8d8a\u3057\u305f\u3053\u3068\u306f\u306a\u3044\u304b\u306a\u30fc\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3067\u3059\u3088\u3001\u8868\u793a\u3057\u305f\u3044\u8981\u7d20\u304c\u3059\u3079\u3066html\u306b\u542b\u307e\u308c\u3066\u3044\u308b\u304b\uff1f\u3068\u3044\u3046\u30c6\u30b9\u30c8\u3092\u884c\u3044\u305f\u3044\u3068\u3002\u3042\u30fc\u3001\u3058\u3083Tocmat\u304b\u306a\u3093\u304b\u7acb\u3061\u4e0a\u3052\u3068\u3044\u3066\u3001Selenium\u3067\u3084\u308c\u3070\u3044\u3044\u3093\u3058\u3083\u306a\u3044\uff1f\u3084\u3063\u305f\u3053\u3068\u3042\u308b\u4eba\u306f\u308f\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3051\u3069\u3001\u7d50\u69cb\u3060\u308a\u3043\u3093\u3067\u3059\u3088\u3002\u30c6\u30b9\u30c8\u304c\u591a\u3044\u3068\u3001\u304b\u306a\u308a\u6642\u9593\u3082\u304b\u304b\u308a\u307e\u3059\u304b\u3089\u306d\u3002<br \/>\nPlayframework2\u306e\u5834\u5408\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<br \/>\n[java]<br \/>\n    @Test<br \/>\n    public void testTimeline() throws Exception {<br \/>\n    \tTwitterInfo ti = new TwitterInfo();<br \/>\n    \tti.screen_name = &quot;\u2605\u30b9\u30af\u30ea\u30fc\u30f3\u540d\u2605&quot;;<br \/>\n    \tti.description = &quot;\u2605\u6982\u8981\u2605&quot;;<\/p>\n<p>    \tList&lt;Tweet&gt; tweets = new ArrayList&lt;Tweet&gt;();<br \/>\n    \ttweets.add(createTweet(&quot;\u2605\u3064\u3044\u30fc\u3068\uff11\u2605&quot;));<br \/>\n    \ttweets.add(createTweet(&quot;\u2605\u3064\u3044\u30fc\u3068\uff12\u2605&quot;));<br \/>\n    \ttweets.add(createTweet(&quot;\u2605\u3064\u3044\u30fc\u3068\uff13\u2605&quot;));<br \/>\n    \tti.tweets = tweets;<\/p>\n<p>    \tContent html = views.html.timeline.render(ti);<br \/>\n    \tString source = contentAsString(html);<br \/>\n    \tassertThat(StringUtils.countMatches(source, &quot;\u2605\u30b9\u30af\u30ea\u30fc\u30f3\u540d\u2605&quot;)).isEqualTo(1);<br \/>\n    \tassertThat(StringUtils.countMatches(source, &quot;\u2605\u6982\u8981\u2605&quot;)).isEqualTo(1);<br \/>\n\t}<br \/>\n[\/java]<br \/>\n\u81ea\u5206\u304c\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u3042\u3093\u307e\u308a\u89e6\u3063\u3066\u3053\u306a\u304b\u3063\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30b3\u30f3\u30c6\u30ca\u52d5\u304b\u3055\u305a\u306b\u30d3\u30e5\u30fc\u306e\u30c6\u30b9\u30c8\u3067\u304d\u308b\u306a\u3093\u3066\u3001\u30ab\u30eb\u30c1\u30e3\u30fc\u30b7\u30e7\u30c3\u30af\u7684\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3057\u305f\u3002<br \/>\n\u305f\u3060\u3001Jenkins\u306a\u3069\u306eCI\u3067\u52d5\u304f\u304b\u306f\u5225\u554f\u984c\u3067\u3059\u306d\u3002\u3053\u308c\u304c\u52d5\u3044\u305f\u3089\u3001\u3059\u3063\u3054\u3044\u306a\u3002\u4eca\u5ea6\u8a66\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Playframework2\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u69cb\u6210\u3092\u307f\u3066\u307f\u308b\u3068\u3001test\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002 ApplicationTest.java\u3068\u3044\u3046\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u3042\u308a\u3001\u3053\u306e\u4e2d\u3092\u307f\u3066\u307f\u308b\u3068\u3001 [java] publ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[92],"tags":[6],"views":4194,"_links":{"self":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/294"}],"collection":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=294"}],"version-history":[{"count":5,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":299,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/294\/revisions\/299"}],"wp:attachment":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}