Package com.google.gwt.dev.util

Examples of com.google.gwt.dev.util.UnitTestTreeLogger.assertCorrectLogEntries()


    // Run typeRefDepsChecker.
    typeRefDepsChecker.verifyTypeRefsInModules();

    // Verify results.
    logger.assertCorrectLogEntries();
    assertEquals(
        "BarModule\tcom/google/gwt/BarModule.gwt.xml\tBazModule\tcom/google/gwt/BazModule.gwt.xml"
        + "\tType 'BangType' wants to reference type 'ZingType'.",
        CharMatcher.WHITESPACE.trimFrom(Files.toString(missingDepsFile, Charsets.UTF_8)));
  }
View Full Code Here


    resourceOracleImpl.setPathPrefixes(pathPrefixSet);
    resourceOracleImpl.scanResources(logger);
    resourceOracleImpl.printOverlappingModuleIncludeWarnings(logger);

    logger.assertCorrectLogEntries();
  }

  /**
   * Ensure refresh is stable when multiple classpaths + multiple path prefixes
   * all include the same resource.
View Full Code Here

      fail("Expected compilation to fail");
    } catch (UnableToCompleteException e) {
      // expected
    }

    logger.assertCorrectLogEntries();
  }
}
View Full Code Here

    builder.expectWarn("Unable to process '" + url.toExternalForm()
        + "' for servlet validation", IOException.class);
    UnitTestTreeLogger logger = builder.createLogger();
    ServletValidator validator = ServletValidator.create(logger, url);
    assertNull(validator);
    logger.assertCorrectLogEntries();
  }

  public void testBadWebXml() throws Exception {
    UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
    builder.setLowestLogLevel(TreeLogger.WARN);
View Full Code Here

    builder.expectWarn("Unable to process '" + url.toExternalForm()
        + "' for servlet validation", SAXParseException.class);
    UnitTestTreeLogger logger = builder.createLogger();
    ServletValidator validator = ServletValidator.create(logger, url);
    assertNull(validator);
    logger.assertCorrectLogEntries();
  }

  public void testGoodWebXml() throws Exception {
    createValidator();
  }
View Full Code Here

    builder.expectWarn(ServletValidator.generateMissingMappingMessage(
        "org.test.NoMappings", "/no/mapping", "noMappings"), null);

    UnitTestTreeLogger logger = builder.createLogger();
    validator.validate(logger, "org.test.NoMappings", "/no/mapping");
    logger.assertCorrectLogEntries();
  }

  public void testNoServlet() throws Exception {
    ServletValidator validator = createValidator();
    assertFalse(validator.containsServletClass("not.defined.Class"));
View Full Code Here

    builder.expectWarn(ServletValidator.generateMissingServletMessage(
        "not.defined.Class", "/no/mapping"), null);

    UnitTestTreeLogger logger = builder.createLogger();
    validator.validate(logger, "not.defined.Class", "/no/mapping");
    logger.assertCorrectLogEntries();
  }

  public void testOneMapping() throws Exception {
    ServletValidator validator = createValidator();
    assertTrue(validator.containsServletClass("org.test.OneMapping"));
View Full Code Here

    UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
    builder.setLowestLogLevel(TreeLogger.WARN);

    UnitTestTreeLogger logger = builder.createLogger();
    validator.validate(logger, "org.test.OneMapping", "/one/mapping");
    logger.assertCorrectLogEntries();
  }

  public void testSuggestServletName() throws Exception {
    assertEquals("a", ServletValidator.suggestServletName("A"));
    assertEquals("className", ServletValidator.suggestServletName("ClassName"));
View Full Code Here

    builder.setLowestLogLevel(TreeLogger.WARN);

    UnitTestTreeLogger logger = builder.createLogger();
    validator.validate(logger, "org.test.TwoMappings", "/two/mappings1");
    validator.validate(logger, "org.test.TwoMappings", "/two/mappings2");
    logger.assertCorrectLogEntries();
  }

  private ServletValidator createValidator() {
    UnitTestTreeLogger.Builder builder = new UnitTestTreeLogger.Builder();
    builder.setLowestLogLevel(TreeLogger.WARN);
View Full Code Here

    UnitTestTreeLogger logger = builder.createLogger();
    URL url = this.getClass().getResource("valid.web.xml");
    assertNotNull(url);
    ServletValidator validator = ServletValidator.create(logger, url);
    assertNotNull(validator);
    logger.assertCorrectLogEntries();
    return validator;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.