Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.DefinitionCacheConfig


  {
    log.debug( "Caching definition for [" + loader.getBaseURI() + "]" );
    if( getConfig().isSetDefinitionCache() )
      getConfig().unsetDefinitionCache();

    DefinitionCacheConfig definitionCache = null;
    try
    {
      definitionCache = getConfig().addNewDefinitionCache();
      definitionCache.set( WsdlUtils.cacheWsdl( loader ) );
    }
    catch( Throwable e )
    {
      getConfig().unsetDefinitionCache();
      throw e;
View Full Code Here


    if( wsdlContext != null && wsdlContext.isCached() )
    {
      return true;
    }

    DefinitionCacheConfig cacheConfig = getConfig().getDefinitionCache();
    if( cacheConfig == null || cacheConfig.getRootPart() == null || cacheConfig.sizeOfPartArray() == 0 )
      return false;

    return true;
  }
View Full Code Here

    assertTrue( file.exists() );

    WsdlLoader loader = new UrlWsdlLoader( file.toURI().toURL().toString() );

    DefinitionCacheConfig cachedWsdl = WsdlUtils.cacheWsdl( loader );
    assertEquals( 4, cachedWsdl.sizeOfPartArray() );

  }
View Full Code Here

    return false;
  }

  public static DefinitionCacheConfig cacheWsdl( DefinitionLoader loader ) throws Exception
  {
    DefinitionCacheConfig definitionCache = DefinitionCacheConfig.Factory.newInstance();
    definitionCache.setRootPart( loader.getBaseURI() );
    definitionCache.setType( DefinitionCacheTypeConfig.TEXT );

    Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts( loader );

    for( Iterator<String> i = urls.keySet().iterator(); i.hasNext(); )
    {
      DefintionPartConfig definitionPart = definitionCache.addNewPart();
      String url = i.next();
      definitionPart.setUrl( url );
      XmlObject xmlObject = urls.get( url );
      Node domNode = xmlObject.getDomNode();
View Full Code Here

    @Test
    public void cachesWsdl() throws Exception {
        File file = new File(UrlWsdlLoaderTest.class.getResource("/test6/TestService.wsdl").toURI());
        WsdlLoader loader = new UrlWsdlLoader(file.toURI().toURL().toString());

        DefinitionCacheConfig cachedWsdl = WsdlUtils.cacheWsdl(loader);
        assertThat(cachedWsdl.sizeOfPartArray(), is(4));
    }
View Full Code Here

        return false;
    }

    public static DefinitionCacheConfig cacheWsdl(DefinitionLoader loader) throws Exception {
        DefinitionCacheConfig definitionCache = DefinitionCacheConfig.Factory.newInstance();
        definitionCache.setRootPart(loader.getBaseURI());
        definitionCache.setType(DefinitionCacheTypeConfig.TEXT);

        Map<String, XmlObject> urls = SchemaUtils.getDefinitionParts(loader);

        for (Map.Entry<String, XmlObject> urlEntry : urls.entrySet()) {
            DefintionPartConfig definitionPart = definitionCache.addNewPart();
            String url = urlEntry.getKey();
            definitionPart.setUrl(url);
            XmlObject xmlObject = urlEntry.getValue();
            Node domNode = xmlObject.getDomNode();
View Full Code Here

        log.debug("Caching definition for [" + loader.getBaseURI() + "]");
        if (getConfig().isSetDefinitionCache()) {
            getConfig().unsetDefinitionCache();
        }

        DefinitionCacheConfig definitionCache = null;
        try {
            definitionCache = getConfig().addNewDefinitionCache();
            definitionCache.set(WsdlUtils.cacheWsdl(loader));
        } catch (Throwable e) {
            getConfig().unsetDefinitionCache();
            throw e;
        }
View Full Code Here

    public boolean isCached() {
        if (wsdlContext != null && wsdlContext.isCached()) {
            return true;
        }

        DefinitionCacheConfig cacheConfig = getConfig().getDefinitionCache();
        if (cacheConfig == null || cacheConfig.getRootPart() == null || cacheConfig.sizeOfPartArray() == 0) {
            return false;
        }

        return true;
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.config.DefinitionCacheConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.