Examples of Minutes


Examples of gaej2011.model.Minutes

            is(ProspectiveSearchController.ADMIN_EMAIL));
    }

    @Test
    public void XMPPメッセージが送信される() {
        Minutes minutes = new Minutes();
        minutes.setTitle(" 活発な議事録");
        minutes.setMemoCount(100);
        Entity document = MinutesMeta.get().modelToEntity(minutes);
        ProspectiveSearchController.sendMessage(document);
        assertThat(" メッセージが一件送信される", delegate.messages.size(), is(1));
        assertThat(
            " 宛先",
View Full Code Here

Examples of gaej2011.model.Minutes

    @Test
    public void タスクを実行する() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        Key minutesKey = MinutesService.put(" テスト用議事録1");
        Minutes before = Datastore.get(Minutes.class, minutesKey);
        tester.request.addParameter(
            "minutesKey",
            Datastore.keyToString(minutesKey));
        tester.start(PATH);
        assertThat(
            "IncrementMemoCountController のインスタンスが使用される",
            tester.getController(),
            instanceOf(IncrementMemoCountController.class));
        assertThat(
            " レスポンスコードが200",
            tester.response.getStatus(),
            is(HttpServletResponse.SC_OK));
        Minutes after = Datastore.get(Minutes.class, minutesKey);
        assertThat(
            " メモ件数が1 増える",
            after.getMemoCount(),
            is(before.getMemoCount() + 1));
    }
View Full Code Here

Examples of gaej2011.model.Minutes

                counter = counterEntitiesMap.get(counterKey);
            } else {
                counter = new AccessCounter();
                counterEntitiesMap.put(counterKey, counter);
                counter.setKey(counterKey);
                Minutes minutes =
                    Datastore.get(
                        Minutes.class,
                        Datastore.createKey(Minutes.class, counterKey.getId()));
                counter.setMinutesTitle(minutes.getTitle());
            }
            counter.setCount(counter.getCount() + next.getValue());
        }
        return counterEntitiesMap.values();
    }
View Full Code Here

Examples of gaej2011.model.Minutes

    @Test
    public void 議事録の一覧を新しい順に表示できる() throws NullPointerException,
            IllegalArgumentException, IOException, ServletException {
        for (int i = 0; i < 5; i++) {
            Minutes minutes = new Minutes();
            minutes.setTitle(" テスト用議事録" + i);
            minutes.setCreatedAt(new Date());
            Datastore.put(minutes);
        }
        tester.request.setMethod("GET");
        tester.start(PATH);
        assertThat(
View Full Code Here

Examples of gaej2011.model.Minutes

        environment.setEmail("test@example.com");
        Key minutesKey = MinutesService.put(" テスト用議事録");
        for (int i = 0; i < 5; i++) {
            MemoService.put(minutesKey, "memo" + i);
        }
        Minutes minutes = Datastore.get(Minutes.class, minutesKey);
        BlobKey blobKey = MinutesService.exportAsTSV(minutes);
        tester.param("download", blobKey.getKeyString());
        tester.start(PATH);
        assertThat(
            "MinutesController のインスタンスが使用される",
View Full Code Here

Examples of gaej2011.model.Minutes

        environment.setEmail("test@example.com");
        Key minutesKey = MinutesService.put(" テスト用議事録");
        for (int i = 0; i < 5; i++) {
            MemoService.put(minutesKey, "memo" + i);
        }
        Minutes minutes = Datastore.get(Minutes.class, minutesKey);
        // メール送信API をフックするApiProxy.Delegate を適用しておく。
        @SuppressWarnings("rawtypes")
        Delegate parentDelegate = ApiProxy.getDelegate();
        MailDelegate mailDelegate = new MailDelegate();
        ApiProxy.setDelegate(mailDelegate);
        tester.param("delete", Datastore.keyToString(minutesKey));
        tester.start(PATH);
        assertThat(
            "MinutesController のインスタンスが使用される",
            tester.getController(),
            instanceOf(MinutesController.class));
        assertThat(
            " レスポンスコードが204",
            tester.response.getStatus(),
            is(HttpServletResponse.SC_NO_CONTENT));
        assertThat(" メールが送信される", mailDelegate.messages.size(), is(1));
        MailMessage mail = mailDelegate.messages.get(0);
        assertThat(
            "From",
            mail.getSender(),
            is("minutes@yourappid.appspotmail.com"));
        assertThat("To", mail.getTo(0), is("test@example.com"));
        assertThat(
            "Subject",
            mail.getSubject(),
            is(" 議事録[" + minutes.getTitle() + "] がTSV に変換されました"));
        assertThat(
            "Body",
            mail.getTextBody(Charset.forName("utf-8")),
            containsString("http://localhost/minutes?download="));
        // ApiProxy.Delegate をもとに戻す。
View Full Code Here

Examples of gaej2011.model.Minutes

            }
        } catch (IllegalArgumentException e) {
            response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
            return null;
        }
        Minutes minutes = Datastore.getOrNull(Minutes.class, minutesKey);
        if (minutes == null) {
            response.setStatus(HttpServletResponse.SC_NOT_FOUND);
            return null;
        }
        if (minutes.getAuthor().equals(currentUser) == false) {
            response.setStatus(HttpServletResponse.SC_FORBIDDEN);
            return null;
        }
        // TSV 作成と削除をする
        BlobKey blobKey = MinutesService.exportAsTSV(minutes);
        MinutesService.deleteMinutes(minutes);
        // ダウンロードURL をメールで送信する
        Message message = new Message();
        message.setSender("minutes@yourappid.appspotmail.com");
        message.setSubject(" 議事録[" + minutes.getTitle() + "] がTSV に変換されました");
        message.setTo(currentUser.getEmail());
        StringBuilder b = new StringBuilder();
        b
            .append(request.getScheme())
            .append("://")
View Full Code Here

Examples of org.joda.time.Minutes

     * @return
     */
    public static Integer getMinutesBetweenDates(final Date startDate){
        final DateTime currentDate = new DateTime();
        final DateTime storedDate = new DateTime(startDate);
        final Minutes minutesBetween = Minutes.minutesBetween(storedDate, currentDate);
        return minutesBetween.getMinutes();
    }
View Full Code Here

Examples of org.joda.time.Minutes

        return now.equals(start.toDateMidnight());
    }

    public long getDuration()
    {
        Minutes m = minutesBetween(start, end);
        long minutes = m.getMinutes() - pause;
        return max(0, minutes);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.