org.objectfabric.BlockWriteTest Maven / Gradle / Ivy
/**
* This file is part of ObjectFabric (http://objectfabric.org).
*
* ObjectFabric is licensed under the Apache License, Version 2.0, the terms
* of which may be found at http://www.apache.org/licenses/LICENSE-2.0.html.
*
* Copyright ObjectFabric Inc.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
package org.objectfabric;
import org.junit.Test;
@SuppressWarnings("unchecked")
public class BlockWriteTest extends TestsHelper {
@Test
public void run1() throws Exception {
for (int test = 0; test < 10; test++) {
Queue queue = new Queue();
int room = 1000;
Buff[] buffs = new Buff[10];
for (int i = 0; i < buffs.length; i++) {
buffs[i] = Buff.getOrCreate();
buffs[i].putLong(42);
buffs[i].limit(buffs[i].position());
buffs[i].position(0);
if (Debug.ENABLED)
buffs[i].lock(buffs[i].position());
}
Buff buff = Buff.getOrCreate();
buff.putByte(TObject.SERIALIZATION_VERSION);
ImmutableWriter writer = new ImmutableWriter(new List