Examples of XMLPermutationProvider


Examples of com.data2semantics.yasgui.mgwtlinker.linker.XMLPermutationProvider

  private XMLPermutationProvider permutationProvider;

  private Map<String, PropertyProvider> propertyProviders = new HashMap<String, PropertyProvider>();

  public Html5ManifestServletBase() {
    permutationProvider = new XMLPermutationProvider();

  }
View Full Code Here

Examples of com.data2semantics.yasgui.mgwtlinker.linker.XMLPermutationProvider

  }


  public Set<String> getFilesForPermutation(String baseUrl, String moduleName, String permutation) throws ServletException {
    String fileName = baseUrl + moduleName + "/" + permutation + PermutationMapLinker.PERMUTATION_FILE_ENDING;
    XMLPermutationProvider xmlPermutationProvider = new XMLPermutationProvider();

    InputStream inputStream = null;
    try {
      File file = new File(getServletContext().getRealPath(fileName));
      inputStream = new FileInputStream(file);
      return xmlPermutationProvider.getPermutationFiles(inputStream);
    } catch (XMLPermutationProviderException e) {
      log("can not read permutation file");
      throw new ServletException("can not read permutation file", e);
    } catch (FileNotFoundException e) {
      log("can not read permutation file");
View Full Code Here

Examples of com.googlecode.mgwt.linker.linker.XMLPermutationProvider

  public void setUp() throws Exception {
  }

  @Test
  public void testReadFile() throws XMLPermutationProviderException {
    XMLPermutationProvider xmlPermutationProvider = new XMLPermutationProvider();

    InputStream stream = getClass().getResourceAsStream("resources/example.manifestmap.xml");

    Map<String, List<BindingProperty>> map = xmlPermutationProvider.getBindingProperties(stream);

    Assert.assertEquals(15, map.size());
    Assert.assertNotNull(map.get("C83A451EFE8ADF0BDB46AEAAC44B0063"));
    Assert.assertNotNull(map.get("C5038CC6700BE1E13984B0C9B1C1CF39"));
    Assert.assertNotNull(map.get("BC0FBD6E19A643C849F55798FBDC6B7C"));
View Full Code Here

Examples of com.googlecode.mgwt.linker.linker.XMLPermutationProvider

  }

  @Test
  public void testReadPermutationFilesFromXml() throws XMLPermutationProviderException {
    XMLPermutationProvider xmlPermutationProvider = new XMLPermutationProvider();

    InputStream stream = getClass().getResourceAsStream("resources/example_permutation.perm.xml");

    Set<String> files = xmlPermutationProvider.getPermutationFiles(stream);

    Assert.assertEquals(7, files.size());

    Assert.assertTrue(files.contains("showcase/01366743E08C511EF8DB208174B33C6F.cache.html"));
    Assert.assertTrue(files.contains("index.html"));
View Full Code Here

Examples of com.googlecode.mgwt.linker.linker.XMLPermutationProvider

  }

  @Test
  public void testReadWritePermInformation() throws XMLPermutationProviderException, UnsupportedEncodingException {
    XMLPermutationProvider xmlPermutationProvider = new XMLPermutationProvider();

    HashSet<String> set = new HashSet<String>();
    set.add("1");
    set.add("2");
    set.add("3");
    set.add("4");
    set.add("5");

    HashSet<BindingProperty> bpSet = new HashSet<BindingProperty>();
    bpSet.add(new BindingProperty("mgwt.os", "iphone"));
    bpSet.add(new BindingProperty("user.agent", "safari"));

    String permutationInformation = xmlPermutationProvider.writePermutationInformation("permTest", bpSet, set);

    ByteArrayInputStream inputStream = new ByteArrayInputStream(permutationInformation.getBytes("UTf-8"));

    Set<String> files = xmlPermutationProvider.getPermutationFiles(inputStream);

    Assert.assertEquals(set, files);

  }
View Full Code Here

Examples of com.googlecode.mgwt.linker.linker.XMLPermutationProvider

  private XMLPermutationProvider permutationProvider;

  private Map<String, PropertyProvider> propertyProviders = new HashMap<String, PropertyProvider>();

  public Html5ManifestServletBase() {
    permutationProvider = new XMLPermutationProvider();
  }
View Full Code Here

Examples of com.googlecode.mgwt.linker.linker.XMLPermutationProvider

    return false;
  }

  public Set<String> getFilesForPermutation(String baseUrl, String moduleName, String permutation) throws ServletException {
    String fileName = baseUrl + moduleName + "/" + permutation + PermutationMapLinker.PERMUTATION_FILE_ENDING;
    XMLPermutationProvider xmlPermutationProvider = new XMLPermutationProvider();

    InputStream inputStream = null;
    try {
      File file = new File(getServletContext().getRealPath(fileName));
      inputStream = new FileInputStream(file);
      return xmlPermutationProvider.getPermutationFiles(inputStream);
    } catch (XMLPermutationProviderException e) {
      log("can not read permutation file");
      throw new ServletException("can not read permutation file", e);
    } catch (FileNotFoundException e) {
      log("can not read permutation file");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.