Package org.ryu22e.nico2cal.model

Examples of org.ryu22e.nico2cal.model.Nicolive


        NamespaceManager.set("test");

        // テストデータを登録する。
        testDataKeys.clear();
        Nicolive nicolinve = new Nicolive();
        nicolinve.setTitle("テスト");
        nicolinve.setDescription(new Text("テスト説明文"));
        DateTime datetime = new DateTime(2012, 5, 12, 0, 0, 0, 0);
        datetime = datetime.minusDays(0);
        nicolinve.setOpenTime(datetime.toDate());
        nicolinve.setLink(new Link("http://ryu22e.org/0"));
        Key key = Datastore.put(nicolinve);
        testDataKeys.add(key);
    }
View Full Code Here


    @Test
    public void データストアに登録したRSSデータを取得する_該当するデータが存在しない() throws Exception {
        assertThat(service, is(notNullValue()));

        Key key = Datastore.allocateId(NicoliveMeta.get());
        Nicolive nicolive = service.find(key);
        assertThat(nicolive, is(nullValue()));
    }
View Full Code Here

    @Test
    public void データストアに登録したRSSデータを取得する_該当するデータが存在する() throws Exception {
        assertThat(service, is(notNullValue()));

        // テストデータを登録する。
        Nicolive testData = new Nicolive();
        testData.setTitle("テストデータ");
        testData.setDescription(new Text("これはテストデータです。"));
        DateTime openTime = new DateTime();
        testData.setOpenTime(openTime.toDate());
        DateTime startTime = openTime.minusMinutes(10);
        testData.setStartTime(startTime.toDate());
        testData.setLink(new Link("http://ryu22e.org/"));
        testData.setType("official");

        Key key = Datastore.put(testData);
        testDataKeys.add(key);

        Nicolive nicolive = service.find(key);
        assertThat(nicolive, is(notNullValue()));
        assertThat(nicolive, is(testData));
    }
View Full Code Here

        Datastore.delete(testDataKeys);
        testDataKeys.clear();

        // テストデータを登録する。
        for (int i = 0; i < 99; i++) {
            Nicolive nicolinve = new Nicolive();
            nicolinve.setTitle("テスト" + i);
            nicolinve.setDescription(new Text("テスト説明文" + i));
            DateTime datetime = new DateTime(2011, 1, 1, 0, 0, 0, 0);
            datetime = datetime.minusDays(i);
            nicolinve.setOpenTime(datetime.toDate());
            nicolinve.setLink(new Link("http://ryu22e.org/" + i));
            Key key = Datastore.put(nicolinve);
            testDataKeys.add(key);
        }

        NicoliveCondition condition = new NicoliveCondition();
View Full Code Here

        Datastore.delete(testDataKeys);
        testDataKeys.clear();

        // テストデータを登録する。
        for (int i = 0; i < 99; i++) {
            Nicolive nicolinve = new Nicolive();
            nicolinve.setTitle("テスト" + i);
            nicolinve.setDescription(new Text("テスト説明文" + i));
            DateTime datetime = new DateTime(2011, 1, 1, 0, 0, 0, 0);
            datetime = datetime.minusDays(i);
            nicolinve.setOpenTime(datetime.toDate());
            nicolinve.setLink(new Link("http://ryu22e.org/" + i));
            Key key = Datastore.put(nicolinve);
            testDataKeys.add(key);
        }

        NicoliveCondition condition = new NicoliveCondition();
View Full Code Here

                        .filter(
                            n.link.equal(new Link("http://ryu22e.org/" + i)))
                        .count();
            assertThat(count, is(1));

            Nicolive nicolive =
                    Datastore
                        .query(n)
                        .filter(n.title.equal("テスト" + i))
                        .asSingle();
            assertThat(nicolive, is(notNullValue()));
            assertThat(nicolive.getTitle(), is("テスト" + i));
            assertThat(nicolive.getDescription(), is(notNullValue()));
            assertThat(nicolive.getDescription().getValue(), is("テスト説明" + i));
            assertThat(nicolive.getOpenTime(), is(notNullValue()));
            assertThat(nicolive.getStartTime(), is(notNullValue()));
            assertThat(nicolive.getType(), is("official"));
            assertThat(nicolive.getLink(), is(notNullValue()));
            assertThat(nicolive.getLink().getValue(), is("http://ryu22e.org/"
                    + i));
        }

        // NicoliveModuleがないエントリーは登録されない。
        int count =
View Full Code Here

        testDataKeys.clear();
        List<Nicolive> nicolives = new LinkedList<Nicolive>();
        List<NicoliveIndex> indexes = new LinkedList<NicoliveIndex>();
        DateTime datetime = new DateTime();
        for (int i = 0; i < 4; i++) {
            Nicolive nicolive = new Nicolive();
            nicolive.setKey(Datastore.allocateId(NicoliveMeta.get()));
            nicolive.setTitle("テスト" + i);
            nicolive.setDescription(new Text("テスト説明文" + i));
            nicolive.setOpenTime(datetime.minusWeeks(i).toDate());
            nicolive.setLink(new Link("http://ryu22e.org/" + i));
            nicolives.add(nicolive);

            NicoliveIndex index1 = new NicoliveIndex();
            index1.setKeyword("テスト");
            index1.setNicoliveKey(nicolive.getKey());
            indexes.add(index1);

            NicoliveIndex index2 = new NicoliveIndex();
            index2.setKeyword("説明");
            index2.setNicoliveKey(nicolive.getKey());
            indexes.add(index2);

            NicoliveIndex index3 = new NicoliveIndex();
            index3.setKeyword("文");
            index3.setNicoliveKey(nicolive.getKey());
            indexes.add(index3);

            NicoliveIndex index4 = new NicoliveIndex();
            index4.setKeyword(Integer.toString(i));
            index4.setNicoliveKey(nicolive.getKey());
            indexes.add(index4);
        }
        testDataKeys.addAll(Datastore.put(nicolives));
        testDataKeys.addAll(Datastore.put(indexes));
    }
View Full Code Here

        assertThat(service, is(notNullValue()));

        // テストデータを作成する。
        DateTime datetime = new DateTime();
        datetime = datetime.minusDays(3);
        Nicolive nicolinve1 = new Nicolive();
        nicolinve1.setTitle("テスト");
        nicolinve1.setDescription(new Text("本日は晴天なり。"));
        nicolinve1.setOpenTime(datetime.toDate());
        nicolinve1.setStartTime(datetime.plusMinutes(10).toDate());
        nicolinve1.setLink(new Link("http://ryu22e.org/1"));
        Key key1 = Datastore.put(nicolinve1);
        testDataKeys.add(key1);
        Nicolive nicolinve2 = new Nicolive();
        nicolinve2.setTitle("テスト");
        nicolinve2.setDescription(new Text("本日は晴天なり。"));
        nicolinve2.setOpenTime(datetime.toDate());
        nicolinve2.setStartTime(datetime.plusMinutes(10).toDate());
        nicolinve2.setLink(new Link("http://ryu22e.org/2"));
        Key key2 = Datastore.put(nicolinve2);
        testDataKeys.add(key2);
        NicoliveIndex nicoliveIndex = new NicoliveIndex();
        nicoliveIndex.setKeyword("テスト");
        nicoliveIndex.setNicoliveKey(key2);
View Full Code Here

        // テストデータを登録する。
        testDataKeys.clear();
        List<Nicolive> nicolives = new LinkedList<Nicolive>();
        for (int i = 0; i < 10; i++) {
            Nicolive nicolive = new Nicolive();
            nicolive.setTitle("テスト" + i);
            nicolive.setDescription(new Text("テスト説明文" + i));
            DateTime datetime = new DateTime();
            datetime = datetime.minusHours(i);
            nicolive.setOpenTime(datetime.toDate());
            nicolive.setLink(new Link("http://ryu22e.org/" + i));
            nicolives.add(nicolive);
        }
        testDataKeys.addAll(Datastore.put(nicolives));
    }
View Full Code Here

        NamespaceManager.set("test");

        // テストデータを登録する。
        testDataKeys.clear();
        for (int i = 0; i < 99; i++) {
            Nicolive nicolinve = new Nicolive();
            nicolinve.setTitle("テスト" + i);
            nicolinve.setDescription(new Text("テスト説明文" + i));
            DateTime datetime = new DateTime(2011, 1, 1, 0, 0, 0, 0);
            datetime = datetime.minusDays(i);
            nicolinve.setOpenTime(datetime.toDate());
            nicolinve.setLink(new Link("http://ryu22e.org/" + i));
            Key key = Datastore.put(nicolinve);
            testDataKeys.add(key);
            NicoliveIndex nicoliveIndex1 = new NicoliveIndex();
            nicoliveIndex1.setKeyword("テスト");
            nicoliveIndex1.setNicoliveKey(key);
            NicoliveIndex nicoliveIndex2 = new NicoliveIndex();
            nicoliveIndex2.setKeyword("説明");
            nicoliveIndex2.setNicoliveKey(key);
            NicoliveIndex nicoliveIndex3 = new NicoliveIndex();
            nicoliveIndex3.setKeyword("文");
            nicoliveIndex3.setNicoliveKey(key);
            testDataKeys.addAll(Datastore.put(
                nicoliveIndex1,
                nicoliveIndex2,
                nicoliveIndex3));
        }

        Nicolive nicolive = new Nicolive();
        nicolive.setTitle("テスト");
        nicolive.setDescription(new Text("テスト"));
        DateTime datetime = new DateTime(2011, 1, 1, 0, 0, 0, 0);
        nicolive.setOpenTime(datetime.toDate());
        nicolive.setLink(new Link("http://ryu22e.org/"));
        testDataKeys.add(Datastore.put(nicolive));
        NicoliveIndex nicoliveIndex = new NicoliveIndex();
        nicoliveIndex.setKeyword("テスト");
        nicoliveIndex.setNicoliveKey(nicolive.getKey());
        testDataKeys.add(Datastore.put(nicoliveIndex));
    }
View Full Code Here

TOP

Related Classes of org.ryu22e.nico2cal.model.Nicolive

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.