Package ro.isdc.wro.model

Examples of ro.isdc.wro.model.WroModel


        final File wroInclude = File.createTempFile(prefix, ".xml");
        FileUtils.write(wroInclude, includeSourcesXML);

        String mainSourcesXml = "<sources><" + INCLUDE_EL + " file=\"" + wroInclude.getName() + "\"/></sources>";
        File mainSourcesFile = File.createTempFile("wro-sources", ".xml", wroInclude.getParentFile());
        final WroModel wroModel = createRequireModel(mainSourcesXml, Optional.of(mainSourcesFile));

        assertRequireModel(wroModel);
    }
View Full Code Here


        final String prefix = "wro-includes";
        final File wroInclude = File.createTempFile(prefix, ".xml");
        FileUtils.write(wroInclude, includeSourcesXML);

        String mainSourcesXml = "<sources><" + INCLUDE_EL + " file=\"" + wroInclude.getAbsolutePath() + "\"/></sources>";
        final WroModel wroModel = createRequireModel(mainSourcesXml);

        assertRequireModel(wroModel);
    }
View Full Code Here

        final String prefix = "wro-includes";
        final File wroInclude = File.createTempFile(prefix, ".xml");
        FileUtils.write(wroInclude, includeSourcesXML);

        String mainSourcesXml = "<sources><" + INCLUDE_EL + " file=\"" + wroInclude.getAbsoluteFile().toURI() + "\"/></sources>";
        final WroModel wroModel = createRequireModel(mainSourcesXml);

        assertRequireModel(wroModel);
    }
View Full Code Here

    }

    @Test
    public void testClasspathPathInclude() throws Exception {
        String mainSourcesXml = "<sources><" + INCLUDE_EL + " file=\"" + CLASSPATH_PREFIX + "included-wro-sources.xml\"/></sources>";
        final WroModel wroModel = createRequireModel(mainSourcesXml);

        assertRequireModel(wroModel);
    }
View Full Code Here

                            + "        <cssSource webappPath=\"anotherCss.less\" pathOnDisk=\"" + PATH_TO_ROOT_OF_TEST_RESOURCES +
                            "\"/>\n"
                            + "    </declarative>\n"
                            + "</sources>";

        final WroModel wroModel = createRequireModel(sourcesXml);

        assertEquals(1, wroModel.getGroups().size());
        final Group group = wroModel.getGroups().iterator().next();

        assertEquals("groupName", group.getName());
        List<Resource> resources = group.getResources();

        assertEquals(4, resources.size());
View Full Code Here

    private WroModelHolder wroModelHolder;
    private MockHttpServletRequest mockHttpServletRequest;

    @Before
    public void setupFixture() {
        WroModel wroModel = new WroModel();

        Group group_one = new Group("group_one");
        Group group_two = new Group("group_two");
        wroModel.setGroups(Arrays.asList(group_one, group_two));

        group_one.addResource(Resource.create("group_one_css_uri_one", ResourceType.CSS));
        group_one.addResource(Resource.create("group_one_css_uri_two", ResourceType.CSS));
        group_one.addResource(Resource.create("group_one_js_uri_one", ResourceType.JS));
        group_one.addResource(Resource.create("group_one_js_uri_two", ResourceType.JS));
View Full Code Here

  private void configureMojoForModelWithImportedCssResource(final String importResource)
      throws Exception {
    final String parentResource = "parent.css";

    final WroModel model = new WroModel();
    model.addGroup(new Group("g1").addResource(Resource.create(parentResource)));
    when(mockLocator.locate(Mockito.anyString())).thenAnswer(answerWithContent(""));
    final String parentContent = String.format("@import url(%s)", importResource);
    when(mockLocator.locate(Mockito.eq(parentResource))).thenAnswer(answerWithContent(parentContent));

    victim = new Wro4jMojo() {
View Full Code Here

      throws Exception {
    final File groupNameMappingFile = WroUtil.createTempFile();

    final Resource g1Resource = spy(Resource.create("1.js"));
    try {
      final WroModel model = new WroModel();
      model.addGroup(new Group("g1").addResource(g1Resource));
      model.addGroup(new Group("g2").addResource(Resource.create("2.js")));
      victim = new Wro4jMojo() {
        @Override
        protected WroManagerFactory newWroManagerFactory()
            throws MojoExecutionException {
          final DefaultStandaloneContextAwareManagerFactory managerFactory = new DefaultStandaloneContextAwareManagerFactory();
View Full Code Here

      throws Exception {
    MockitoAnnotations.initMocks(this);
    when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
    when(mockResponse.getWriter()).thenReturn(new PrintWriter(new StringWriter()));
    victim = new WroFilter();
    victim.setWroManagerFactory(new BaseWroManagerFactory().setModelFactory(WroTestUtils.simpleModelFactory(new WroModel())));
    victim.init(mockFilterConfig);
  }
View Full Code Here

    @Override
    protected WroModelFactory newModelFactory() {
      return new WroModelFactory() {
        public WroModel create() {
          return new WroModel().addGroup(new Group("all"));
        }

        public void destroy() {
        }
      };
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.