/** 
 * 
 * Copyright 2004 Protique Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 * 
 **/
package org.activemq.service.impl;

import org.activemq.message.ActiveMQMessage;
import org.activemq.message.ActiveMQTextMessage;
import org.activemq.message.ActiveMQXid;
import org.activemq.test.SerializationTestSupport;
import org.activemq.test.XidStub;

import javax.jms.JMSException;

/**
 * @version $Revision: 1.1.1.1 $
 */
public class XATransactionTest extends SerializationTestSupport {
    /*
    public void testXATransactionSerialization() throws Exception {
        XATransactionCommand txn = createXATranasction();

        byte[] data = serialize(txn);
        Object value = deserialize(data);

        assertTrue("Should have returned an XATransactionCommend: " + value, value instanceof XATransactionCommand);
    }

    public void testXidSerialization() throws Exception {
        XidStub xidStub = new XidStub(new byte[]{1, 2, 3, 4, 5});
        ActiveMQXid xid = new ActiveMQXid(xidStub);

        byte[] data = serialize(xid);
        Object value = deserialize(data);

        assertEquals("deserialized object is not equal", xid, value);
    }

    public void testXidEquals() throws Exception {
        XidStub xidStub = new XidStub(new byte[]{1, 2, 3, 4, 5});
        ActiveMQXid xid1 = new ActiveMQXid(xidStub);
        ActiveMQXid xid2 = new ActiveMQXid(xidStub);

        assertEquals("object hashes are not equal", xid1.hashCode(), xid2.hashCode());
        assertEquals("objects are not equal", xid1, xid2);
    }

    protected XATransactionCommand createXATranasction() throws JMSException {
        ActiveMQXid xid = new ActiveMQXid("01:23:45");
        XATransactionCommand answer = new XATransactionCommand(null, xid, null, null);
        answer.addPostCommitTask(new SendMessageTransactionTask(null, createMessage()));
        return answer;
    }

    protected ActiveMQMessage createMessage() throws JMSException {
        ActiveMQTextMessage answer = new ActiveMQTextMessage();
        answer.setJMSMessageID("abc:123");
        answer.setText("I'm a test message!");
        return answer;
    }
    */
    public void testX() {}
}
