Package org.xtreemfs.babudb.api.transaction

Examples of org.xtreemfs.babudb.api.transaction.Operation


        // compare original transaction with deserialized transaction
        assertEquals(txn.getSize(), txn2.getSize());
        assertEquals(txn.getOperations().size(), txn2.getOperations().size());
        for (int i = 0; i < txn.getOperations().size(); i++) {
           
            Operation op1 = txn.getOperations().get(i);
            Operation op2 = txn2.getOperations().get(i);
           
            // count legal parameters
            int count = 0;
            if (op1.getParams() != null) {
                for (Object obj : op1.getParams()) {
                    if (obj != null && !(obj instanceof LSMDatabase)
                        && !(obj instanceof BabuDBRequestResultImpl<?>)) {
                        count++;
                    }
                }
            }
           
            assertEquals(op1.getType(), op2.getType());
            if (count > 0) {
                assertEquals(count, op2.getParams().length);
            } else {
                assertNull(op2.getParams());
            }
            if (op2.getParams() != null) {
                for (int j = 0; j < op2.getParams().length; j++) {
                   
                    Object p1 = op1.getParams()[j];
                    Object p2 = op2.getParams()[j];
                   
                    if (p1 instanceof Number || p1 instanceof String)
                        assertEquals(p1, p2);
                   
                    else if (p1 instanceof byte[]) {
View Full Code Here

TOP

Related Classes of org.xtreemfs.babudb.api.transaction.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.