All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke.Baz Maven / Gradle / Ivy

There is a newer version: 2.0.5.SP1
Show newest version
package org.jboss.cdi.tck.interceptors.tests.contract.aroundInvoke;

import static org.testng.Assert.assertEquals;

import javax.interceptor.Interceptors;
import javax.naming.InitialContext;
import javax.transaction.TransactionSynchronizationRegistry;

public class Baz {

    private static Object key;

    public static Object getKey() {
        return key;
    }

    @Interceptors(BazInterceptor.class)
    void ping() throws Exception {
        TransactionSynchronizationRegistry tsr = (TransactionSynchronizationRegistry) InitialContext
                .doLookup("java:comp/TransactionSynchronizationRegistry");
        key = tsr.getTransactionKey();
        assertEquals(key, Bar.getKey());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy