Search in sources :

Example 21 with OChannelBinaryAsynchClient

use of com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient in project orientdb by orientechnologies.

the class OStorageRemoteAsyncOperationTest method testNoReadCall.

@Test
public void testNoReadCall() {
    final CallStatus status = new CallStatus();
    storage.asyncNetworkOperation(new OStorageRemoteOperationWrite() {

        @Override
        public void execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session, int mode) throws IOException {
            assertNull(status.status);
            status.status = "write";
        }
    }, new OStorageRemoteOperationRead<Object>() {

        @Override
        public Object execute(OChannelBinaryAsynchClient network, OStorageRemoteSession session) throws IOException {
            fail();
            return null;
        }
    }, 1, new ORecordId(-1, -1), null, "");
    assertEquals(status.status, "write");
}
Also used : IOException(java.io.IOException) OChannelBinaryAsynchClient(com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient) ORecordId(com.orientechnologies.orient.core.id.ORecordId) Test(org.junit.Test)

Aggregations

OChannelBinaryAsynchClient (com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient)21 IOException (java.io.IOException)12 OIOException (com.orientechnologies.common.io.OIOException)9 OModificationOperationProhibitedException (com.orientechnologies.common.concur.lock.OModificationOperationProhibitedException)6 OException (com.orientechnologies.common.exception.OException)6 OOfflineNodeException (com.orientechnologies.common.concur.OOfflineNodeException)4 OInterruptedException (com.orientechnologies.common.concur.lock.OInterruptedException)4 ORecordId (com.orientechnologies.orient.core.id.ORecordId)4 OTokenException (com.orientechnologies.orient.core.metadata.security.OTokenException)4 ODistributedRedirectException (com.orientechnologies.orient.enterprise.channel.binary.ODistributedRedirectException)4 OTokenSecurityException (com.orientechnologies.orient.enterprise.channel.binary.OTokenSecurityException)4 NamingException (javax.naming.NamingException)4 Test (org.testng.annotations.Test)4 Test (org.junit.Test)3 OSBTreeCollectionManager (com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManager)2 OChannelListener (com.orientechnologies.orient.enterprise.channel.binary.OChannelListener)2 HashSet (java.util.HashSet)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 OCommandRequestAsynch (com.orientechnologies.orient.core.command.OCommandRequestAsynch)1 ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)1