WebコンソールからLambdaを動かしていた時に、次のステップとしてローカルでLambdaデバッグする流れを伝えるスライドです。 セットアップ手順などは省いてますが、Webコンソールで操作する場合とSAMを使用してローカルで試験する場合の対比がわかりやすくなるように作成しています。
本記事は、jacocoの導入関連の記事や公式ドキュメントを読んでも、導入がうまくいかなかった人に向け解決策の1つの可能性を示すものである。 みんながうまくいくかは知らない。 なぜなら筆者自身Mavenとかよくわかってないからだ。 前提 javaのバージョン java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T01:41:47+09:00) Maven home: /usr/local/apache-maven-3.3.9
package sample.junit5; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.DisplayName; class JUnit5Test { @Test void fail() { Assertions.assertEquals(10, 8); } static class StaticClass { @Test void fail() { Assertions.assertEquals(10, 8); } } static class StaticTest { @Test void fail() { Assertions.assertEquals(10, 8); } } class InnerTest { @Te
最近は Lambda Function を TypeScript で実装することが多く、テストツールとして Jest を選択しました。導入から基本的なテスト、カバレッジ出力までやってみたので、その手順を記録します。 ユニットテストのモチベーション 変更に対する心理的な安全性を手に入れるため、という理由が大きいです。 たとえば API Gateway のバックエンドを Lambda Function で実装する場合。実装だけであれば、可能な限り any 型を使用せず、 interface や type の有効活用によりデータ型に起因する実行時エラーは大幅に少なくできます。 TypeScript を使うメリットのひとつですね。ではサーバーレスならではの難しいポイントはどこかというと、私の場合 前作った Lambda Function の挙動をすぐ忘れる ということがよくありました。それで、 L
Mockito.reset(mockAppender); // Appenderの名前を設定 Mockito.when(mockAppender.getName()).thenReturn("MockAppender"); // Appenderとして利用できる準備ができていることを設定(下2行) Mockito.when(mockAppender.isStarted()).thenReturn(true); Mockito.when(mockAppender.isStopped()).thenReturn(false); // ROOTロガーを取り出し、Appenderの設定を行う。 LoggerContext ctx = (LoggerContext) LogManager.getContext(false); Configuration config = ctx.getConfigu
最近はTypeScriptを使ってフロントエンドの開発をしている。 JSをbrowserifyでビルドし、ライセンスコメントを適切に残す - $shibayu36->blog; gulp + browserify + tsifyを利用してTypeScriptコンパイル環境を作る - $shibayu36->blog; typingsを使ってnpmモジュールをTypeScriptで利用する - $shibayu36->blog; 以上の記事に引き続き、次はTypeScriptでユニットテストをするためのシンプルな環境を構築してみた。 今回のサンプルコードは https://github.com/shibayu36/typescript-project-sample/tree/967c9d74fd3d844127a4352f19a0cc31b7a0690d においてあるので、見ながら確認しても
As one might intuit, the jasmine-maven-plugin is a Maven plugin for the JavaScript testing framework, Jasmine. If you’re using Maven, you’re probably writing Java (but, hey, you could be using it for any JVM-language). And if you’re anything like me, you’re here to figure out how to treat your client-side code with the same degree of professionalism that you already show server-side code. Maybe th
JAX-RSのClient APIを確認した流れで、ユニットテストまわりも眺めてみる。 Jersey - 2.17 RESTEasy - 3.0.9.Final 各実装のテストサポート 軽くコード書いてみたりしつつ思ったことをば。 Jerseyさん Chapter 25. Jersey Test Framework Jerseyさんのテスティングフレームワークを使うには、jersey-test-framework-core と、テストで使うコンテナのproviderが要ります。providerはいくつか用意されているので、好きなのを依存に追加しましょう。 testCompile "org.glassfish.jersey.test-framework:jersey-test-framework-core:${jerseyVersion}" // grizzly2, inmemory, jd
ES6 で書かれたコードをユニット テストしたい。できればテスト自体も ES6 で。という希望を実現してくれそうなツールがあったので試してみる。 mocha ユニット テストには mocha を利用する。業務で Node モジュールのテストに利用していて馴染みがあるのと後述する espower-babel が mocha を想定しているのがその理由。 mocha を npm test や npm run から利用するならインストールはローカルだけでよい。package.json 管理下にある npm にはパスが通った状態になる。 余談だが以下の記事を読んで gulp などもローカルにインストールして実行を npm で抽象化するほうがよいのでは?と考えるようになった。 npm で依存もタスクも一元化する 記事中にもメリットとして説明されているとおり利用者は npm だけ覚えればよい。グローバ
Arqullian を使っている。 ちょっとずつ書き方がわかってきた気がする。 サンプルコード @RunWith(Arquillian.class) @UsingDataSet("dataset.yml") public class CountryResourceTest { @ArquillianResource private URL baseUrl; private URI countryUri; @Before public void init() throws Exception { countryUri = UriBuilder.fromUri(baseUrl.toURI()) .path(ApplicationConfig.class.getAnnotation(ApplicationPath.class).value()) .path(CountryResource.cla
http://martinfowler.com/bliki/UnitTest.html 2014/5/5 ソフトウェア開発において、ユニットテスティングの話題になることが多い。私がプログラムを書きはじめて以来ずっと、ユニットテスティングという言葉はおなじみだった。 しかし、ソフトウェア開発用語の常として、ユニットテスティングという用語もきちんと定義できていない。 ユニットテスティングという用語の意味を実際よりも厳密にとらえてしまったせいで、混乱してしまっている人もよく見かける。 もちろんそれ以前からもユニットテスティングはやってきていたのだが、それを人前で公表したのは、Kent Beckと仕事をして Xunit系のツールを使い始めたころのことだった (この種のテストのことは、ユニットテスティングっていうより「xunitテスティング」って呼んだほうがいいと思うんだ)。 ユニットテスティングは
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く