Package org.dtk.util

Examples of org.dtk.util.MockHttpClient


   
  @Test
  public void willRetrieveInlineScriptContents() throws MalformedURLException, IOException {
    Document document = new Document("");

    RemoteWebPage webPage = new RemoteWebPage(document, new URL("http://localhost/"), new MockHttpClient());   
   
    // Create inline script tag...
    String scriptContents = getResourceAsString("sample_module_libs/non_amd/simple_deps/app.js");
    Attributes attrs = new Attributes();
    Element inlineScript = new Element(Tag.valueOf("script"), "", attrs);       
View Full Code Here


  }
   
  @Test
  public void willRetrieveExternalScriptContents() throws MalformedURLException, IOException {
    Document document = new Document("");
    MockHttpClient mockHttpClient = new MockHttpClient();

    RemoteWebPage webPage = new RemoteWebPage(document, new URL("http://localhost/"), mockHttpClient);   
   
    // Create inline script tag...
    String scriptContents = getResourceAsString("sample_module_libs/non_amd/simple_deps/app.js");
View Full Code Here

    assertEquals(scriptContents, webPage.retrieveScriptContents(inlineScript));   
  }
   
  @Test
  public void willRecursivelyParseAmdModulesDependencies() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();

    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/amd/local_dtk_with_only_dtk_reqs/";    
   
View Full Code Here

        webPage.getModuleSource("dojox/grid/EnhancedGrid"));         
  }
 
  @Test
  public void willRecursivelyParseNonAmdModulesDependencies() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();

    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/non_amd/local_dtk_with_only_dtk_reqs/";    
   
View Full Code Here

        webPage.getModuleSource("dojox.grid.EnhancedGrid"));         
  }
 
  @Test
  public void willRecursivelyParseAmdModulesWithPathsConfig() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();
   
    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/amd/local_dtk_with_custom_modules_paths/";    
   
View Full Code Here

        webPage.getModuleSource("sample/dep_three"));
  }
 
  @Test
  public void willRecursivelyParseNonAmdModulesWithPathsConfig() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();
   
    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/non_amd/local_dtk_with_custom_modules_paths/";    
   
View Full Code Here

  }
 

  @Test
  public void willRecursivelyParseAmdModulesDependenciesWithCustomBaseUrl() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();

    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/amd/local_dtk_with_custom_base_url/";    
   
View Full Code Here

        webPage.getModuleSource("dojox/grid/EnhancedGrid"));         
  }
 
  @Test
  public void willRecursivelyParseNonAmdModulesDependenciesWithCustomBaseUrl() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();

    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/non_amd/local_dtk_with_custom_base_url/";    
   
View Full Code Here

        webPage.getModuleSource("dojox.grid.EnhancedGrid"));         
  }
 
  @Test
  public void willIgnoreExplicitPackagesForRecursivelyParsing() throws MalformedURLException, IOException, FatalAnalysisError, ModuleSourceNotAvailable, UnknownModuleIdentifier {   
    MockHttpClient mockHttpClient = new MockHttpClient();
   
    // Set pre-canned response
    mockHttpClient.hostPrefix = "http://localhost/";
    mockHttpClient.appDir = "sample_apps/amd/local_dtk_with_custom_modules_paths/";    
   
View Full Code Here

TOP

Related Classes of org.dtk.util.MockHttpClient

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.