@@ -0,0 +1,3190 @@
+/*%0A * Copyright 2016-2018 shardingsphere.io.%0A * %3Cp%3E%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * %3C/p%3E%0A */%0A%0Apackage io.shardingsphere.transaction.xa.jta.connection;%0A%0Aimport io.shardingsphere.transaction.xa.jta.ShardingXAResource;%0Aimport lombok.SneakyThrows;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0Aimport javax.sql.ConnectionEventListener;%0Aimport javax.sql.StatementEventListener;%0Aimport javax.sql.XAConnection;%0Aimport javax.transaction.xa.XAResource;%0A%0Aimport static org.hamcrest.CoreMatchers.instanceOf;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class ShardingXAConnectionTest %7B%0A    %0A    @Mock%0A    private XAConnection xaConnection;%0A    %0A    private ShardingXAConnection shardingXAConnection;%0A    %0A    @Before%0A    public void setUp() %7B%0A        shardingXAConnection = new ShardingXAConnection(%22ds1%22, xaConnection);%0A    %7D%0A    %0A    @Test%0A    @SneakyThrows%0A    public void assertGetConnection() %7B%0A        shardingXAConnection.getConnection();%0A        verify(xaConnection).getConnection();%0A    %7D%0A    %0A    @Test%0A    @SneakyThrows%0A    public void assertGetXAResource() %7B%0A        XAResource actual = shardingXAConnection.getXAResource();%0A        assertThat(actual, instanceOf(ShardingXAResource.class));%0A    %7D%0A    %0A    @Test%0A    @SneakyThrows%0A    public void close() %7B%0A        shardingXAConnection.close();%0A        verify(xaConnection).close();%0A    %7D%0A    %0A    @Test%0A    public void assertAddConnectionEventListener() %7B%0A        shardingXAConnection.addConnectionEventListener(mock(ConnectionEventListener.class));%0A        verify(xaConnection).addConnectionEventListener(any(ConnectionEventListener.class));%0A    %7D%0A    %0A    @Test%0A    public void assertRemoveConnectionEventListener() %7B%0A        shardingXAConnection.removeConnectionEventListener(mock(ConnectionEventListener.class));%0A        verify(xaConnection).removeConnectionEventListener(any(ConnectionEventListener.class));%0A    %7D%0A    %0A    @Test%0A    public void assertAddStatementEventListener() %7B%0A        shardingXAConnection.addStatementEventListener(mock(StatementEventListener.class));%0A        verify(xaConnection).addStatementEventListener(any(StatementEventListener.class));%0A    %7D%0A    %0A    @Test%0A    public void removeStatementEventListener() %7B%0A        shardingXAConnection.removeStatementEventListener(mock(StatementEventListener.class));%0A        verify(xaConnection).removeStatementEventListener(any(StatementEventListener.class));%0A    %7D%0A%7D%0A

add ShardingXAConnectionTest.