• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TestIOUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testSerdeWebPage

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an WebPage object in-memory setting several fields to dirty. 
 * Run a query over the persistent data.
 * Asserts that the results can be serialized and 
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * Also simple assertion for equal number of URL's in WebPage 
 * and results.
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testSerdeWebPage() throws Exception {

  MemStore<String, WebPage> store = DataStoreFactory.getDataStore(
      MemStore.class, String.class, WebPage.class, new Configuration());
  WebPageDataCreator.createWebPageData(store);

  Result<String, WebPage> result = store.newQuery().execute();

  int i = 0;
  while (result.next()) {
    WebPage page = result.get();
    TestIOUtils.testSerializeDeserialize(page);
    i++;
  }
  assertEquals(WebPageDataCreator.URLS.length, i);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:29,代码来源:TestPersistentSerialization.java


示例2: testSerdeMultipleWebPages

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates multiple WebPage objects setting several fields to dirty. 
 * Asserts that the data can be serialized and 
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * @throws Exception
 */
@Test
public void testSerdeMultipleWebPages() throws Exception {
  WebPage page1 = WebPage.newBuilder().build();
  WebPage page2 = WebPage.newBuilder().build();
  WebPage page3 = WebPage.newBuilder().build();

  page1.setUrl(new Utf8("foo"));
  page2.setUrl(new Utf8("baz"));
  page3.setUrl(new Utf8("bar"));
  page1.setParsedContent(new ArrayList<CharSequence>());
  page1.getParsedContent().add(new Utf8("coo"));
  page2.setOutlinks(new HashMap<CharSequence, CharSequence>());
  page2.getOutlinks().put(new Utf8("a"), new Utf8("b"));

  TestIOUtils.testSerializeDeserialize(page1, page2, page3);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:24,代码来源:TestPersistentSerialization.java


示例3: testSerdeWebPage

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an WebPage object in-memory setting several fields to dirty.
 * Run a query over the persistent data.
 * Asserts that the results can be serialized and
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * Also simple assertion for equal number of URL's in WebPage
 * and results.
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testSerdeWebPage() throws Exception {

  MemStore<String, WebPage> store = DataStoreFactory.getDataStore(
          MemStore.class, String.class, WebPage.class, new Configuration());
  WebPageDataCreator.createWebPageData(store);

  Result<String, WebPage> result = store.newQuery().execute();

  int i = 0;
  while (result.next()) {
    WebPage page = result.get();
    TestIOUtils.testSerializeDeserialize(page);
    i++;
  }
  assertEquals(WebPageDataCreator.URLS.length, i);
}
 
开发者ID:apache,项目名称:gora,代码行数:29,代码来源:TestPersistentSerialization.java


示例4: testSerdeMultipleWebPages

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates multiple WebPage objects setting several fields to dirty.
 * Asserts that the data can be serialized and
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * @throws Exception
 */
@Test
public void testSerdeMultipleWebPages() throws Exception {
  WebPage page1 = WebPage.newBuilder().build();
  WebPage page2 = WebPage.newBuilder().build();
  WebPage page3 = WebPage.newBuilder().build();

  page1.setUrl(new Utf8("foo"));
  page2.setUrl(new Utf8("baz"));
  page3.setUrl(new Utf8("bar"));
  page1.setParsedContent(new ArrayList<CharSequence>());
  page1.getParsedContent().add(new Utf8("coo"));
  page2.setOutlinks(new HashMap<CharSequence, CharSequence>());
  page2.getOutlinks().put(new Utf8("a"), new Utf8("b"));

  TestIOUtils.testSerializeDeserialize(page1, page2, page3);
}
 
开发者ID:apache,项目名称:gora,代码行数:24,代码来源:TestPersistentSerialization.java


示例5: testSerdeWebPage

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testSerdeWebPage() throws Exception {

  MemStore<String, WebPage> store = DataStoreFactory.getDataStore(
      MemStore.class, String.class, WebPage.class, new Configuration());
  WebPageDataCreator.createWebPageData(store);

  Result<String, WebPage> result = store.newQuery().execute();

  int i=0;
  while(result.next()) {
    WebPage page = result.get();
    TestIOUtils.testSerializeDeserialize(page);
    i++;
  }
  Assert.assertEquals(WebPageDataCreator.URLS.length, i);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:19,代码来源:TestPersistentSerialization.java


示例6: testSerdeMultipleWebPages

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testSerdeMultipleWebPages() throws Exception {
  WebPage page1 = new WebPage();
  WebPage page2 = new WebPage();
  WebPage page3 = new WebPage();

  page1.setUrl(new Utf8("foo"));
  page2.setUrl(new Utf8("baz"));
  page3.setUrl(new Utf8("bar"));

  page1.addToParsedContent(new Utf8("coo"));

  page2.putToOutlinks(new Utf8("a"), new Utf8("b"));

  TestIOUtils.testSerializeDeserialize(page1, page2, page3);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:17,代码来源:TestPersistentSerialization.java


示例7: testSerdeWebPage

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testSerdeWebPage() throws Exception {

  MemStore<String, WebPage> store = DataStoreFactory.getDataStore(
      MemStore.class, String.class, WebPage.class, new Configuration());
  WebPageDataCreator.createWebPageData(store);

  Result<String, WebPage> result = store.newQuery().execute();

  int i=0;
  while(result.next()) {
    WebPage page = result.get();
    TestIOUtils.testSerializeDeserialize(page);
    i++;
  }
  assertEquals(WebPageDataCreator.URLS.length, i);
}
 
开发者ID:maestros,项目名称:gora-oraclenosql,代码行数:19,代码来源:TestPersistentSerialization.java


示例8: testReadWrite

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testReadWrite() throws Exception {
  query.setFields(FIELDS);
  query.setKeyRange(START_KEY, END_KEY);
  TestIOUtils.testSerializeDeserialize(query);
  
  assertNotNull(query.getDataStore());
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:9,代码来源:TestQueryBase.java


示例9: testSerdeEmployee

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object in-memory setting several fields to dirty. 
 * Asserts that it can be serialized and 
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testSerdeEmployee() throws Exception {

  MemStore<String, Employee> store = DataStoreFactory.getDataStore(
      MemStore.class, String.class, Employee.class, new Configuration());

  Employee employee = DataStoreTestUtil.createEmployee(store);

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:19,代码来源:TestPersistentSerialization.java


示例10: testSerdeEmployeeOneField

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object but only sets one field as dirty.
 * We then do (de)serialization and check 'before' and 'after'
 * states. 
 * @throws Exception
 */
@Test
public void testSerdeEmployeeOneField() throws Exception {
  Employee employee = Employee.newBuilder().build();
  employee.setSsn(new Utf8("11111"));

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:14,代码来源:TestPersistentSerialization.java


示例11: testSerdeEmployeeTwoFields

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object setting only two fields as dirty.
 * We then do (de)serialization and check 'before' and 'after'
 * states. 
 * @throws Exception
 */
@Test
public void testSerdeEmployeeTwoFields() throws Exception {
  Employee employee = Employee.newBuilder().build();
  employee.setSsn(new Utf8("11111"));
  employee.setSalary(100);

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:jianglibo,项目名称:gora-boot,代码行数:15,代码来源:TestPersistentSerialization.java


示例12: testQueryMarshability

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testQueryMarshability() throws Exception {
   Utils.populateEmployeeStore(employeeStore, 100);
   InfinispanQuery<String,Employee> query = new InfinispanQuery<>(employeeDataStore);
   query.setFields("field");
   query.setLimit(1);
   query.setOffset(1);
   query.build();
   TestIOUtils.testSerializeDeserialize(query);
}
 
开发者ID:leads-project,项目名称:gora-infinispan,代码行数:11,代码来源:InfinispanStoreTest.java


示例13: testQueryMarshability

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testQueryMarshability() throws Exception {
  Utils.populateEmployeeStore(employeeStore, 100);
  InfinispanQuery<String,Employee> query = new InfinispanQuery<>(employeeDataStore);
  query.setFields("field");
  query.setLimit(1);
  query.setOffset(1);
  query.build();
  TestIOUtils.testSerializeDeserialize(query);
}
 
开发者ID:apache,项目名称:gora,代码行数:11,代码来源:InfinispanStoreTest.java


示例14: testSerdeEmployee

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object in-memory setting several fields to dirty. 
 * Asserts that it can be serialized and 
 * deserialzed without loosing data. We do this by asserting
 * what we get 'before' and 'after' (de)serialization processes.
 * @throws Exception
 */
@SuppressWarnings("unchecked")
@Test
public void testSerdeEmployee() throws Exception {

  MemStore<String, Employee> store = DataStoreFactory.getDataStore(
          MemStore.class, String.class, Employee.class, new Configuration());

  Employee employee = DataStoreTestUtil.createEmployee();

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:apache,项目名称:gora,代码行数:19,代码来源:TestPersistentSerialization.java


示例15: testSerdeEmployeeOneField

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object but only sets one field as dirty.
 * We then do (de)serialization and check 'before' and 'after'
 * states.
 * @throws Exception
 */
@Test
public void testSerdeEmployeeOneField() throws Exception {
  Employee employee = Employee.newBuilder().build();
  employee.setSsn(new Utf8("11111"));

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:apache,项目名称:gora,代码行数:14,代码来源:TestPersistentSerialization.java


示例16: testSerdeEmployeeTwoFields

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
/**
 * Creates an Employee object setting only two fields as dirty.
 * We then do (de)serialization and check 'before' and 'after'
 * states.
 * @throws Exception
 */
@Test
public void testSerdeEmployeeTwoFields() throws Exception {
  Employee employee = Employee.newBuilder().build();
  employee.setSsn(new Utf8("11111"));
  employee.setSalary(100);

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:apache,项目名称:gora,代码行数:15,代码来源:TestPersistentSerialization.java


示例17: testReadWrite

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testReadWrite() throws Exception {
  query.setFields(FIELDS);
  query.setKeyRange(START_KEY, END_KEY);
  TestIOUtils.testSerializeDeserialize(query);
  
  Assert.assertNotNull(query.getDataStore());
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:9,代码来源:TestQueryBase.java


示例18: testSerdeEmployee

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void testSerdeEmployee() throws Exception {

  MemStore<String, Employee> store = DataStoreFactory.getDataStore(
      MemStore.class, String.class, Employee.class, new Configuration());

  Employee employee = DataStoreTestUtil.createEmployee(store);

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:12,代码来源:TestPersistentSerialization.java


示例19: testSerdeEmployeeOneField

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testSerdeEmployeeOneField() throws Exception {
  Employee employee = new Employee();
  employee.setSsn(new Utf8("11111"));

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:8,代码来源:TestPersistentSerialization.java


示例20: testSerdeEmployeeTwoFields

import org.apache.gora.util.TestIOUtils; //导入依赖的package包/类
@Test
public void testSerdeEmployeeTwoFields() throws Exception {
  Employee employee = new Employee();
  employee.setSsn(new Utf8("11111"));
  employee.setSalary(100);

  TestIOUtils.testSerializeDeserialize(employee);
}
 
开发者ID:galaxyeye,项目名称:gora-0.3-simplified,代码行数:9,代码来源:TestPersistentSerialization.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GenericVersionScheme类代码示例发布时间:2022-05-22
下一篇:
Java State类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap