| 1 |
// |
| 2 |
// ======================================================================== |
| 3 |
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others. |
| 4 |
// |
| 5 |
// This program and the accompanying materials are made available under the |
| 6 |
// terms of the Eclipse Public License v. 2.0 which is available at |
| 7 |
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 |
| 8 |
// which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| 9 |
// |
| 10 |
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| 11 |
// ======================================================================== |
| 12 |
// |
| 13 |
|
| 14 |
package org.example; |
| 15 |
|
| 16 |
import javax.naming.Reference; |
| 17 |
|
| 18 |
import jakarta.transaction.HeuristicMixedException; |
| 19 |
import jakarta.transaction.HeuristicRollbackException; |
| 20 |
import jakarta.transaction.NotSupportedException; |
| 21 |
import jakarta.transaction.RollbackException; |
| 22 |
import jakarta.transaction.SystemException; |
| 23 |
import jakarta.transaction.UserTransaction; |
| 24 |
|
| 25 |
/** |
| 26 |
* MockUserTransaction |
| 27 |
*/ |
| 28 |
public class MockUserTransaction extends Reference implements UserTransaction |
| 29 |
{ |
| 30 |
|
| 31 |
public MockUserTransaction() |
| 32 |
{ |
| 33 |
super("org.example.MockUserTransaction", "org.example.MockUserTransactionFactory", null); |
| 34 |
} |
| 35 |
|
| 36 |
@Override |
| 37 |
public void begin() throws NotSupportedException, SystemException |
| 38 |
{ |
| 39 |
} |
| 40 |
|
| 41 |
@Override |
| 42 |
public void commit() throws HeuristicMixedException, |
| 43 |
HeuristicRollbackException, IllegalStateException, |
| 44 |
RollbackException, SecurityException, SystemException |
| 45 |
{ |
| 46 |
} |
| 47 |
|
| 48 |
@Override |
| 49 |
public int getStatus() throws SystemException |
| 50 |
{ |
| 51 |
return 0; |
| 52 |
} |
| 53 |
|
| 54 |
@Override |
| 55 |
public void rollback() throws IllegalStateException, SecurityException, |
| 56 |
SystemException |
| 57 |
{ |
| 58 |
} |
| 59 |
|
| 60 |
@Override |
| 61 |
public void setRollbackOnly() throws IllegalStateException, SystemException |
| 62 |
{ |
| 63 |
} |
| 64 |
|
| 65 |
@Override |
| 66 |
public void setTransactionTimeout(int arg0) throws SystemException |
| 67 |
{ |
| 68 |
} |
| 69 |
} |