Package ro.isdc.wro.extensions.processor.js

Examples of ro.isdc.wro.extensions.processor.js.CJsonProcessor


public class TestCJsonProcessor {

  @Test
  public void testPackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = new CJsonProcessor(true) {
      @Override
      protected void onException(final WroRuntimeException e) {
        throw e;
      }
    };
View Full Code Here


  }

  @Test
  public void testUnpackFromFolder()
      throws Exception {
    final ResourcePostProcessor processor = new CJsonProcessor(false) {
      @Override
      protected void onException(final WroRuntimeException e) {
        throw e;
      }
    };
View Full Code Here

    genericThreadSafeTest(false);
  }

  private void genericThreadSafeTest(boolean pack)
      throws Exception {
    final CJsonProcessor processor = new CJsonProcessor(pack) {
      @Override
      protected void onException(final WroRuntimeException e) {
        throw e;
      }
    };
    final Callable<Void> task = new Callable<Void>() {
      public Void call() {
        try {
          processor.process(new StringReader("{\"p\" : 1}"), new StringWriter());
        } catch (final Exception e) {
          throw new RuntimeException(e);
        }
        return null;
      }
View Full Code Here

  }
 

  @Test
  public void shouldSupportCorrectResourceTypes() {
    WroTestUtils.assertProcessorSupportResourceTypes(new CJsonProcessor(true), ResourceType.JS);
  }
View Full Code Here

   * Compress JSON objects using CJson algorithm.
   *
   * @return A new {@link CJsonProcessor}.
   */
  public static CJsonProcessor cJsonPack() {
    return new CJsonProcessor(true);
  }
View Full Code Here

   * Uncompress JSON objects previously compressed with CJson algorithm.
   *
   * @return A new {@link CJsonProcessor}.
   */
  public static CJsonProcessor cJsonUnpack() {
    return new CJsonProcessor(false);
  }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.extensions.processor.js.CJsonProcessor

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.