Package ro.isdc.wro.model

Examples of ro.isdc.wro.model.WroModel


    assertEquals(2, model.getGroups().size());
  }
 
  @Test
  public void shouldContainOnlyNonAbstractGroups() {
    final WroModel model = loadModelFromLocation("shouldContainOnlyNonAbstractGroups.xml");
    assertEquals(1, model.getGroups().size());
    final Group group = model.getGroups().iterator().next();
    assertEquals("nonAbstract", group.getName());
    assertEquals(5, group.getResources().size());
  }
View Full Code Here


    assertEquals(5, group.getResources().size());
  }
 
  @Test(expected = WroRuntimeException.class)
  public void shouldDetectInvalidGroupReference() {
    final WroModel model = loadModelFromLocation("shouldDetectInvalidGroupReference.xml");
    assertTrue(model.getGroups().isEmpty());
  }
View Full Code Here

    assertTrue(model.getGroups().isEmpty());
  }
 
  @Test
  public void shouldDetectGroupReferenceFromImportedModel() {
    final WroModel model = loadModelFromLocation("shouldDetectGroupReferenceFromImportedModel.xml");
    assertEquals(2, model.getGroups().size());
  }
View Full Code Here

    assertEquals(2, model.getGroups().size());
  }
 
  @Test
  public void shouldLoadEmptyModel() {
    final WroModel model = loadModelFromLocation("emptyModel.xml");
    assertEquals(0, model.getGroups().size());
  }
View Full Code Here

    return factory.create();
  }
 
  @Test
  public void shouldAllowEmptyGroup() {
    final WroModel model = loadModelFromLocation("emptyGroup.xml");
    assertEquals(1, new WroModelInspector(model).getGroupNames().size());
    assertTrue(model.getGroups().iterator().next().getResources().isEmpty());
    LOG.debug("model: " + model);
  }
View Full Code Here

    protected WroManagerFactory newWroManagerFactory() {
      final WroManagerFactory factory = super.newWroManagerFactory();
      return new WroManagerFactoryDecorator(factory) {
        @Override
        protected void onBeforeBuild(final Builder builder) {
          final WroModelFactory modelFactory = WroTestUtils.simpleModelFactory(new WroModel().addGroup(new Group("some")));
          builder.setModelFactory(modelFactory);
        }
      };
    }
View Full Code Here

          throws IOException {
        return TestXmlModelFactory.class.getResourceAsStream("wroWithWildcardResources.xml");
      };
    }, modelTransformers);
    WroTestUtils.init(victim);
    final WroModel expectedModel = victim.create();
    WroTestUtils.runConcurrently(new ContextPropagatingCallable<Void>(new Callable<Void>() {
      public Void call()
          throws Exception {
        assertEquals(expectedModel, victim.create());
        return null;
View Full Code Here

  /**
   * Instructs the victim to create the model with a single resource
   */
  private void createSampleModel(final String resourceUri) {
    final WroModel model = new WroModel().addGroup(new Group("group").addResource(Resource.create(resourceUri)));
    final WroModelFactory decorated = new WroModelFactory() {
      public WroModel create() {
        return model;
      }

View Full Code Here

        dragomeGroup.addResource(Resource.create("/dragome-resources/css/dragome.css", ResourceType.CSS));

        Group compiledGroup= new Group("compiled");
        compiledGroup.addResource(Resource.create("/compiled-js/webapp.js", ResourceType.JS));

        WroModel wroModel= new WroModel();
        wroModel.addGroup(dragomeGroup);
        wroModel.addGroup(compiledGroup);

        return wroModel;
      }

      public void destroy()
View Full Code Here

          newGroup.add(resource);
        }
        // Keep the original group
        map.put(group.getName(), new LinkedHashSet<Resource>(resources));
      }
      WroModel output = new WroModel();
      for (Entry<String, Set<Resource>> g : map.entrySet()) {
        Group newGroup = new Group(g.getKey());
        Set<Resource> resources = g.getValue();
        for (Resource resource : resources) {
          newGroup.addResource(resource);
        }
        output.addGroup(newGroup);
      }
      return output;
    }
View Full Code Here

TOP

Related Classes of ro.isdc.wro.model.WroModel

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.