本文整理汇总了Java中javax.xml.ws.spi.Provider.provider方法的典型用法代码示例。如果您正苦于以下问题:Java Provider.provider方法的具体用法?Java Provider.provider怎么用?Java Provider.provider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.ws.spi.Provider
的用法示例。
在下文中一共展示了Provider.provider方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
public void test() throws Exception {
System.setProperty(Provider.class.getName(), MockProvider.class.getName());
Provider provider = Provider.provider();
assertNotNull("provider is null", provider);
assertFalse("provider should not be an instance of ProviderWrapper", provider instanceof JaxWsProviderWrapper);
JaxWsProviderWrapper.beforeCreate(null);
try {
provider = Provider.provider();
assertNotNull("provider is null", provider);
assertTrue("provider should be an instance of ProviderWrapper", provider instanceof JaxWsProviderWrapper);
final JaxWsProviderWrapper providerWrapper = (JaxWsProviderWrapper) provider;
// check delegate
final Provider delegate = providerWrapper.getDelegate();
assertNotNull("providerWrapper delegate is null", delegate);
assertFalse("providerWrapper delegate should not be an instance of ProviderWrapper", delegate instanceof JaxWsProviderWrapper);
} finally {
JaxWsProviderWrapper.afterCreate();
}
}
示例2: test
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
public void test() throws Exception {
System.setProperty(Provider.class.getName(), MockProvider.class.getName());
Provider provider = Provider.provider();
assertNotNull("provider is null", provider);
assertFalse("provider should not be an instance of ProviderWrapper", provider instanceof ProviderWrapper);
ProviderWrapper.beforeCreate(null, null, null);
try {
provider = Provider.provider();
assertNotNull("provider is null", provider);
assertTrue("provider should be an instance of ProviderWrapper", provider instanceof ProviderWrapper);
final ProviderWrapper providerWrapper = (ProviderWrapper) provider;
// check delegate
final Provider delegate = providerWrapper.getDelegate();
assertNotNull("providerWrapper delegate is null", delegate);
assertFalse("providerWrapper delegate should not be an instance of ProviderWrapper", delegate instanceof ProviderWrapper);
} finally {
ProviderWrapper.afterCreate();
}
}
示例3: verifyJaxWsSpiProvider
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
public static void verifyJaxWsSpiProvider(String expectedProviderClass)
{
Provider provider = Provider.provider();
String clazz = provider.getClass().getName();
if (!clazz.equals(expectedProviderClass)) {
throw new RuntimeException("Expected " + expectedProviderClass + " but got " + clazz);
}
}
示例4: testGetProvider
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
@Test
public void testGetProvider()
{
//just check we get the jbossws-cxf provider impl when the default maven tccl is set
Provider providerImpl = Provider.provider();
assertTrue(providerImpl instanceof ProviderImpl);
}
示例5: testGetProviderWithCustomClassLoaderIsBackwardCompatibility
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
@Test
public void testGetProviderWithCustomClassLoaderIsBackwardCompatibility()
{
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
try
{
//overwrite the TCCL so that no Provider configuration is specified,
//hence the JAXWS RI default is tried (given this test is run
//out of container); this verifies the additions due to JBEE-75 and
//JBWS-3223 are backward compatible.
TestClassLoader cl = new TestClassLoader();
Thread.currentThread().setContextClassLoader(cl);
try
{
Provider.provider();
fail("Exception due to class not found expected!");
}
catch (Exception e)
{
//check the default ProviderImpl was being looked up given no configuration was provided
List<String> list = cl.getLoadClassRequests();
assertTrue(list.contains("com.sun.xml.internal.ws.spi.ProviderImpl"));
assertEquals(1, list.size());
}
}
finally
{
Thread.currentThread().setContextClassLoader(tccl);
}
}
示例6: testProvider
import javax.xml.ws.spi.Provider; //导入方法依赖的package包/类
@Test
public void testProvider() {
Provider provider = Provider.provider();
LOG.debug("provider class: " + provider.getClass().getName());
assertEquals("org.apache.cxf.jaxws22.spi.ProviderImpl", provider
.getClass().getName());
}