本文整理汇总了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;未经允许,请勿转载。 |
请发表评论