当前位置: 首页>>代码示例>>Java>>正文


Java Provider.provider方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:22,代码来源:JaxWsProviderWrapperTest.java

示例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();
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:22,代码来源:ProviderWrapperTest.java

示例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);
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:9,代码来源:Helper.java

示例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);
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:8,代码来源:ProviderImplTest.java

示例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);
   }
}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:31,代码来源:ProviderImplTest.java

示例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());
}
 
开发者ID:e-Contract,项目名称:mycarenet,代码行数:8,代码来源:CXFTest.java


注:本文中的javax.xml.ws.spi.Provider.provider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。