Package ro.isdc.wro.model

Examples of ro.isdc.wro.model.WroModel


 
  @Test
  public void shouldSetCallback()
      throws Exception {
    final LifecycleCallback callback = Mockito.spy(new LifecycleCallbackSupport());
    victim = new BaseWroManagerFactory().setModelFactory(WroUtil.factoryFor(new WroModel()));
    final WroManager manager = victim.create();
    InjectorBuilder.create(victim).build().inject(manager);
   
    manager.registerCallback(new ObjectFactory<LifecycleCallback>() {
      public LifecycleCallback create() {
View Full Code Here


          });
        };

        @Override
        protected WroModelFactory newModelFactory() {
          return WroTestUtils.simpleModelFactory(new WroModel().addGroup(new Group("group").addResource(resource)));
        }
      };
    }
View Full Code Here

    // have to reset it, otherwise a test fails when testing entire project.
    Mockito.reset(mockResourceWatcher);
  }

  public Injector createInjector() {
    final WroModel model = new WroModel().addGroup(new Group(GROUP_NAME).addResource(Resource.create(RESOURCE_URI)));
    final WroModelFactory modelFactory = WroTestUtils.simpleModelFactory(model);
    final UriLocatorFactory locatorFactory = WroTestUtils.createResourceMockingLocatorFactory();
    final BaseWroManagerFactory factory = new BaseWroManagerFactory().setModelFactory(modelFactory).setUriLocatorFactory(
        locatorFactory);
    factory.setProcessorsFactory(new SimpleProcessorsFactory());
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public synchronized WroModel create() {
    model = new WroModel();
    final StopWatch stopWatch = new StopWatch("Create Wro Model from XML");
    try {
      stopWatch.start("createDocument");
      final Document document = createDocument();
      stopWatch.stop();
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public WroModel create() {
    WroModel model = super.create();
    LOG.debug("using {} transformers", modelTransformers);
    for (final Transformer<WroModel> transformer : modelTransformers) {
      injector.inject(transformer);
      LOG.debug("using transformer: {}", transformer.getClass());
      try {
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public WroModel create() {
    WroModel newModel = null;
    try {
      newModel = super.create();
    } catch (final WroRuntimeException e) {
      LOG.error("Error while creating the model", e);
    }
View Full Code Here

  }

  private static class EmptyModelFactory
      implements WroModelFactory {
    public WroModel create() {
      return new WroModel();
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public synchronized WroModel transform(final WroModel input) {
    final WroModel model = input;

    for (final Group group : model.getGroups()) {
      final List<Resource> resources = group.getResources();
      for (final Resource resource : resources) {
        processResource(group, resource);
      }
    }
View Full Code Here

    final WroConfiguration config = new WroConfiguration();
    config.setIgnoreEmptyGroup(false);
    Context.unset();
    Context.set(Context.webContext(request, response, Mockito.mock(FilterConfig.class)), config);

    final WroModel model = new WroModel();
    model.addGroup(new Group("noResources"));
    final WroManagerFactory managerFactory = new BaseWroManagerFactory().setModelFactory(WroUtil.factoryFor(model));
    managerFactory.create().process();
  }
View Full Code Here

 
  @Before
  public void setUp() {
    Context.set(Context.standaloneContext());
    MockitoAnnotations.initMocks(this);
    Mockito.when(mockFactory.create()).thenReturn(new WroModel());
  }
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.