Package org.slim3.tester

Examples of org.slim3.tester.TestEnvironment


    }

    @Test
    public void 議事録をTSVに変換する() throws IOException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        Key minutesKey = MinutesService.put(" テスト用議事録");
        for (int i = 0; i < 5; i++) {
            MemoService.put(minutesKey, "memo" + i);
        }
        assertThat(" 実行前のメモ数は5", MemoService.list(minutesKey).size(), is(5));
View Full Code Here


    @Test
    public void 特定の議事録にメモを追加できる() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");

        Key minutesKey = MinutesService.put(" テスト用議事録1");
        tester.request.setMethod("POST");
        tester.param("minutes", Datastore.keyToString(minutesKey));
        tester.param("memo", " テスト用議事録1");
View Full Code Here

    @Test
    public void 特定の議事録にメモを追加できる_memoを指定しない() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");

        Key minutesKey = MinutesService.put(" テスト用議事録1");
        tester.request.setMethod("POST");
        tester.param("minutes", Datastore.keyToString(minutesKey));
        tester.start(PATH);
View Full Code Here

    @Test
    public void 特定の議事録にメモを追加できる_minutesを指定しない() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");

        @SuppressWarnings("unused")
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        tester.request.setMethod("POST");
        tester.param("memo", " テスト用議事録1");
View Full Code Here

    @Test
    public void 特定の議事録にメモを追加できる_無効なminutesを指定する() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");

        @SuppressWarnings("unused")
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        tester.request.setMethod("POST");
        tester.param("minutes", "uso800");
View Full Code Here

    @Test
    public void ログインしている() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        tester.start(PATH);
        assertThat(
            "AuthController のインスタンスが使用される",
            tester.getController(),
            instanceOf(AuthController.class));
View Full Code Here

public class MemoServiceTest extends AppEngineTestCase {

    @Test
    public void 特定の議事録にメモを追加できる() {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        int before = tester.count(Memo.class);
        Key key = MemoService.put(minutesKey, " メモ1");
        int after = tester.count(Memo.class);
        assertThat("Memo が一件増える", after, is(before + 1));
View Full Code Here

    @Test
    public void アップロード用URLを取得する() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        tester.start(PATH);
        assertThat(
            "ImagesController のインスタンスが使用される",
            tester.getController(),
            instanceOf(ImagesController.class));
View Full Code Here

        output.write(imageBytes);
        output.close();
        writeChannel.closeFinally();
        BlobKey blobKey = fileService.getBlobKey(file);
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        int beforeCount = tester.count(Profile.class);
        tester.param("key", blobKey.getKeyString());
        tester.start(PATH);
        assertThat(
            " レスポンスコードが200",
View Full Code Here

    @Test
    public void 議事録のタイトルを作成できる() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");

        tester.request.setMethod("POST");
        tester.param("title", " テスト用議事録1");
        tester.start(PATH);
        assertThat(
View Full Code Here

TOP

Related Classes of org.slim3.tester.TestEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.