当前位置: 首页>>代码示例>>Java>>正文


Java Is类代码示例

本文整理汇总了Java中com.threewks.gaetools.search.Is的典型用法代码示例。如果您正苦于以下问题:Java Is类的具体用法?Java Is怎么用?Java Is使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Is类属于com.threewks.gaetools.search包,在下文中一共展示了Is类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided() {
    LongTestEntity testEntity = new LongTestEntity(1, "original");
    LongTestEntity testEntity2 = new LongTestEntity(2, "original");
    LongTestEntity testEntity3 = new LongTestEntity(3, "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasSize(0));

    List<Long> keys = Arrays.asList(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (LongTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:AppleSeed,代码行数:23,代码来源:LongRepositoryTest.java

示例2: shouldReindexEntitiesBasedOnSearch

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearch() {
    KeyTestEntity testEntity = new KeyTestEntity(1, "original");
    KeyTestEntity testEntity2 = new KeyTestEntity(2, "original");
    KeyTestEntity testEntity3 = new KeyTestEntity(3, "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<KeyTestEntity> all = ObjectifyService.ofy().load().type(KeyTestEntity.class).list();
    for (KeyTestEntity e : all) {
        e.setName("other name");
    }
    ObjectifyService.ofy().save().entities(all).now();

    List<Key<KeyTestEntity>> keys = Arrays.asList(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "original").run().getResults().isEmpty(), is(true));
    assertThat(repository.search().field("name", Is.Is, "other name").run().getResults().size(), is(3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:23,代码来源:KeyRepositoryTest.java

示例3: shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided() {
    KeyTestEntity testEntity = new KeyTestEntity(1, "name");
    KeyTestEntity testEntity2 = new KeyTestEntity(2, "name");
    KeyTestEntity testEntity3 = new KeyTestEntity(3, "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("id", Is.GreaterThan, 0).run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<Key<KeyTestEntity>> keys = Arrays.asList(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (KeyTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:22,代码来源:KeyRepositoryTest.java

示例4: shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided() {
    KeyTestEntity testEntity = new KeyTestEntity(1, "original");
    KeyTestEntity testEntity2 = new KeyTestEntity(2, "original");
    KeyTestEntity testEntity3 = new KeyTestEntity(3, "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasSize(0));

    List<Key<KeyTestEntity>> keys = Arrays.asList(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (KeyTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:23,代码来源:KeyRepositoryTest.java

示例5: shouldReindexEntitiesBasedOnSearch

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearch() {
    LongTestEntity testEntity = new LongTestEntity(1, "original");
    LongTestEntity testEntity2 = new LongTestEntity(2, "original");
    LongTestEntity testEntity3 = new LongTestEntity(3, "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    Search<LongTestEntity, Long> search = repository.search().field("name", Is.Is, "original");
    assertThat(search.run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<LongTestEntity> all = ObjectifyService.ofy().load().type(LongTestEntity.class).list();
    for (LongTestEntity e : all) {
        e.setName("other name");
    }
    ObjectifyService.ofy().save().entities(all).now();

    List<Long> keys = list(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(search.run().getResults().isEmpty(), is(true));
    assertThat(repository.search().field("name", Is.Is, "other name").run().getResultIds().size(), is(3));
}
 
开发者ID:monPlan,项目名称:AppleSeed,代码行数:24,代码来源:LongRepositoryTest.java

示例6: shouldReindexEntitiesBasedOnSearch

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearch() {
    StringTestEntity testEntity = new StringTestEntity("1", "original");
    StringTestEntity testEntity2 = new StringTestEntity("2", "original");
    StringTestEntity testEntity3 = new StringTestEntity("3", "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<StringTestEntity> all = ObjectifyService.ofy().load().type(StringTestEntity.class).list();
    for (StringTestEntity e : all) {
        e.setName("other name");
    }
    ObjectifyService.ofy().save().entities(all).now();
    List<String> keys = list(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "original").run().getResultIds().isEmpty(), is(true));
    assertThat(repository.search().field("name", Is.Is, "other name").run().getResultIds().size(), is(3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:22,代码来源:StringRepositoryTest.java

示例7: shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided() {
    StringTestEntity testEntity = new StringTestEntity("1", "name");
    StringTestEntity testEntity2 = new StringTestEntity("2", "name");
    StringTestEntity testEntity3 = new StringTestEntity("3", "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    Search<StringTestEntity, String> search = repository.search();
    assertThat(search.run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<String> keys = list(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (StringTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:23,代码来源:StringRepositoryTest.java

示例8: shouldReindexEntitiesBasedOnKeys

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeys() {
    StringTestEntity testEntity = new StringTestEntity("1", "name");
    StringTestEntity testEntity2 = new StringTestEntity("2", "name");
    StringTestEntity testEntity3 = new StringTestEntity("3", "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "name").run().getResults(), hasSize(0));

    List<String> keys = Arrays.asList("1", "2", "3");
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "name").run().getResultIds().size(), is(3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:17,代码来源:StringRepositoryTest.java

示例9: shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeysAndWriteBackToDatastoreWhenReindexOperationProvided() {
    StringTestEntity testEntity = new StringTestEntity("1", "original");
    StringTestEntity testEntity2 = new StringTestEntity("2", "original");
    StringTestEntity testEntity3 = new StringTestEntity("3", "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasSize(0));

    List<String> keys = Arrays.asList("1", "2", "3");
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (StringTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:23,代码来源:StringRepositoryTest.java

示例10: shouldReindexEntities

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntities() {
    DatastoreKeyTestEntity testEntity = new DatastoreKeyTestEntity(1, "original");
    DatastoreKeyTestEntity testEntity2 = new DatastoreKeyTestEntity(2, "original");
    DatastoreKeyTestEntity testEntity3 = new DatastoreKeyTestEntity(3, "original");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("name", Is.Is, "original").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<DatastoreKeyTestEntity> all = ObjectifyService.ofy().load().type(DatastoreKeyTestEntity.class).list();
    for (DatastoreKeyTestEntity e : all) {
        e.setName("other name");
    }
    ObjectifyService.ofy().save().entities(all).now();

    List<Key> keys = list(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "original").run().getResults().isEmpty(), is(true));
    assertThat(repository.search().field("name", Is.Is, "other name").run().getResults().size(), is(3));
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:23,代码来源:DatastoreKeyRepositoryTest.java

示例11: shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnSearchAndWriteBackToDatastoreWhenReindexOperationProvided() {
    LongTestEntity testEntity = new LongTestEntity(1, "name");
    LongTestEntity testEntity2 = new LongTestEntity(2, "name");
    LongTestEntity testEntity3 = new LongTestEntity(3, "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("id", Is.GreaterThan, 0).run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<Long> keys = list(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (LongTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:monPlan,项目名称:AppleSeed,代码行数:22,代码来源:LongRepositoryTest.java

示例12: shouldReindexEntitiesBasedOnKeys

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeys() {
    KeyTestEntity testEntity = new KeyTestEntity(1, "name");
    KeyTestEntity testEntity2 = new KeyTestEntity(2, "name");
    KeyTestEntity testEntity3 = new KeyTestEntity(3, "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "name").run().getResults(), hasSize(0));

    List<Key<KeyTestEntity>> keys = Arrays.asList(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "name").run().getResultIds().size(), is(3));
}
 
开发者ID:lorderikir,项目名称:googlecloud-techtalk,代码行数:17,代码来源:KeyRepositoryTest.java

示例13: shouldReindexEntitiesAndWriteBackToDatastoreWhenReindexOperationProvided

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesAndWriteBackToDatastoreWhenReindexOperationProvided() {
    DatastoreKeyTestEntity testEntity = new DatastoreKeyTestEntity(1, "name");
    DatastoreKeyTestEntity testEntity2 = new DatastoreKeyTestEntity(2, "name");
    DatastoreKeyTestEntity testEntity3 = new DatastoreKeyTestEntity(3, "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    assertThat(repository.search().field("id", list(1, 2, 3)).run().getResults(), hasItems(testEntity, testEntity2, testEntity3));

    List<Key> keys = list(testEntity.getKey(), testEntity2.getKey(), testEntity3.getKey());
    int reindexed = repository.reindex(keys, 10, batch -> {
        for (DatastoreKeyTestEntity entity : batch) {
            entity.setName("different");
        }
        return batch;
    });
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "different").run().getResults(), hasItems(testEntity, testEntity2, testEntity3));
    assertThat(repository.getByField("name", "different"), hasItems(testEntity, testEntity2, testEntity3));
}
 
开发者ID:lorderikir,项目名称:googlecloud-techtalk,代码行数:22,代码来源:DatastoreKeyRepositoryTest.java

示例14: shouldReindexEntitiesBasedOnKeys

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldReindexEntitiesBasedOnKeys() {
    LongTestEntity testEntity = new LongTestEntity(1, "name");
    LongTestEntity testEntity2 = new LongTestEntity(2, "name");
    LongTestEntity testEntity3 = new LongTestEntity(3, "name");
    repository.putAsync(testEntity, testEntity2, testEntity3).complete();

    repository.searchService.removeAll();
    assertThat(repository.search().field("name", Is.Is, "name").run().getResults(), hasSize(0));

    List<Long> keys = Arrays.asList(testEntity.getId(), testEntity2.getId(), testEntity3.getId());
    int reindexed = repository.reindex(keys, 10, null);
    assertThat(reindexed, is(3));

    assertThat(repository.search().field("name", Is.Is, "name").run().getResultIds().size(), is(3));
}
 
开发者ID:monPlan,项目名称:AppleSeed,代码行数:17,代码来源:LongRepositoryTest.java

示例15: shouldDeleteEntity

import com.threewks.gaetools.search.Is; //导入依赖的package包/类
@Test
public void shouldDeleteEntity() {
    DatastoreKeyTestEntity testEntity = new DatastoreKeyTestEntity(1, "name");
    repository.putAsync(testEntity).complete();

    assertThat(repository.get(testEntity.getKey()), is(testEntity));

    repository.deleteAsync(testEntity).complete();

    assertThat(repository.get(testEntity.getKey()), is(nullValue()));
    assertThat(repository.search().field("name", Is.Is, "name").run().getResults().isEmpty(), is(true));
}
 
开发者ID:monPlan,项目名称:AppleSeed,代码行数:13,代码来源:DatastoreKeyRepositoryTest.java


注:本文中的com.threewks.gaetools.search.Is类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。