Package org.apache.shindig.gadgets.spec

Examples of org.apache.shindig.gadgets.spec.SpecParserException


    specFactory.getGadgetSpec(createContext(SPEC_URL, true));
  }

  @Test(expected = SpecParserException.class)
  public void negativeCachingEnforced() throws Exception {
    specFactory.cache.addElement(SPEC_URL, new SpecParserException("broken"), 1000);
    specFactory.getGadgetSpec(createContext(SPEC_URL, false));
  }
View Full Code Here


    try {
      String content = response.getResponseAsString();
      return parse(content, query);
    } catch (XmlException e) {
      throw new SpecParserException(e);
    }
  }
View Full Code Here

      // via raw XML (eg. via POST) to be rendered on a locked domain of any other
      // gadget whose spec is hosted non-locally.
      try {
        return new GadgetSpec(RAW_GADGET_URI, XmlUtil.parse(rawxml), rawxml);
      } catch (XmlException e) {
        throw new SpecParserException(e);
      }
    }

    return fetchObject(context.getUrl(), context, false);
  }
View Full Code Here

      return (GadgetSpec) obj;
    }

    if (obj instanceof ApplicationManifest) {
      if (noManifests) {
        throw new SpecParserException("Manifests may not reference other manifests.");
      }

      return getSpecFromManifest((ApplicationManifest) obj, context);
    }
View Full Code Here

      if (ApplicationManifest.NAMESPACE.equals(element.getNamespaceURI())) {
        return new ApplicationManifest(uri, element);
      }
      return new GadgetSpec(uri, element, content);
    } catch (XmlException e) {
      throw new SpecParserException(e);
    }
  }
View Full Code Here

    if (RAW_GADGET_URI.equals(gadgetUri)) {
      try {
        String rawxml = context.getParameter(RAW_GADGETSPEC_XML_PARAM_NAME);
        return new GadgetSpec(gadgetUri, XmlUtil.parse(rawxml), rawxml);
      } catch (XmlException e) {
        throw new SpecParserException(e);
      }
    }

    Query query = new Query()
        .setSpecUri(gadgetUri)
View Full Code Here

    specFactory.getGadgetSpec(createContext(SPEC_URL, true));
  }

  @Test(expected = SpecParserException.class)
  public void negativeCachingEnforced() throws Exception {
    specFactory.cache.addElement(SPEC_URL, new SpecParserException("broken"), 1000);
    specFactory.getGadgetSpec(createContext(SPEC_URL, false));
  }
View Full Code Here

        try {
            String content = response.getResponseAsString();
            return parse(content, query);
        } catch (XmlException e) {
            throw new SpecParserException(e);
        }
    }
View Full Code Here

                if (HtmlAccelServlet.isAccel(context)) {
                    uri = context.getUrl();
                }
                return new GadgetSpec(uri, XmlUtil.parse(rawxml), rawxml);
            } catch (XmlException e) {
                throw new SpecParserException(e);
            }
        }

        Uri gadgetUri = context.getUrl();
View Full Code Here

    specFactory.getGadgetSpec(createContext(SPEC_URL, true));
  }

  @Test(expected = SpecParserException.class)
  public void negativeCachingEnforced() throws Exception {
    specFactory.cache.addElement(SPEC_URL, new SpecParserException("broken"), 1000);
    specFactory.getGadgetSpec(createContext(SPEC_URL, false));
  }
View Full Code Here

TOP

Related Classes of org.apache.shindig.gadgets.spec.SpecParserException

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.