Package ro.isdc.wro

Examples of ro.isdc.wro.WroRuntimeException


  /**
   * Checks if the {@link Context} is accessible from current request cycle.
   */
  private static void validateContext() {
    if (!isContextSet()) {
      throw new WroRuntimeException("No context associated with CURRENT request cycle!");
    }
  }
View Full Code Here


  private void identifyDuplicateGroupNames(final Collection<Group> groups) {
    LOG.debug("identifyDuplicateGroupNames");
    final List<String> groupNames = new ArrayList<String>();
    for (final Group group : groups) {
      if (groupNames.contains(group.getName())) {
        throw new WroRuntimeException("Duplicate group name detected: " + group.getName());
      }
      groupNames.add(group.getName());
    }
  }
View Full Code Here

  public void merge(final WroModel importedModel) {
    Validate.notNull(importedModel, "imported model cannot be null!");
    LOG.debug("merging importedModel: {}", importedModel);
    for (final String groupName : new WroModelInspector(importedModel).getGroupNames()) {
      if (new WroModelInspector(this).getGroupNames().contains(groupName)) {
        throw new WroRuntimeException("Duplicate group name detected: " + groupName);
      }
      final Group importedGroup = new WroModelInspector(importedModel).getGroupByName(groupName);
      addGroup(importedGroup);
    }
  }
View Full Code Here

  }

  private CacheKey getSafeCacheKey(final HttpServletRequest request) {
    final CacheKey cacheKey = cacheKeyFactory.create(request);
    if (cacheKey == null) {
      throw new WroRuntimeException("Cannot build valid CacheKey from request: " + request.getRequestURI());
    }
    return cacheKey;
  }
View Full Code Here

    try {
      return Long.valueOf(valueAsString(object));
    } catch (final NumberFormatException e) {
      final String message = "Invalid long value: " + object + ". Using defaultValue: " + defaultValue;
      LOG.error(message);
      throw new WroRuntimeException(message);
    }
  }
View Full Code Here

  private Callable<Void> createFailingCallable() {
    return new Callable<Void>() {
      public Void call()
          throws Exception {
        throw new WroRuntimeException("BOOM!");
      }
    };
  }
View Full Code Here

    final List<S> strategies = new ArrayList<S>();
    final List<String> aliasList = getAliasList(getConfiguredValue());
    for (String alias : aliasList) {
      final S strategy = getStrategyForAlias(alias);
      if (strategy == null) {
        throw new WroRuntimeException("Invalid strategy alias provided: <" + alias + ">. Available aliases are: "
            + getAvailableAliases());
      }
      strategies.add(strategy);
    }
    LOG.debug("using strategies: {}", strategies);
View Full Code Here

    try {
      final InputStream stream = WroUtil.class.getResourceAsStream("regexp.properties");
      final Properties props = new RegexpProperties().load(stream);
      return props.getProperty(key);
    } catch (final IOException e) {
      throw new WroRuntimeException("Could not load pattern with key: " + key + " from property file", e);
    }
  }
View Full Code Here

  private ResourcePreProcessor createProcessorWhichFails() {
    return new ResourcePreProcessor() {
      public void process(final Resource resource, final Reader reader, final Writer writer)
          throws IOException {
        LOG.debug("executing failing processor...");
        throw new WroRuntimeException("Boom!");
      }
    };
  }
View Full Code Here

      {{
        contextMapRef.set(getContextMap());
      }}
      @Override
      protected void onRecursiveImportDetected() {
        throw new WroRuntimeException("Recursion detected");
      }
    };
    WroTestUtils.initProcessor(victim);
    WroTestUtils.runConcurrently(new ContextPropagatingCallable<Void>(new Callable<Void>() {
      public Void call()
View Full Code Here

TOP

Related Classes of ro.isdc.wro.WroRuntimeException

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.