public GetCapabilitiesScaleHintTest() {

    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("xlink", "http://www.w3.org/1999/xlink");
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
    xpath = XMLUnit.newXpathEngine();
  }
Exemplo n.º 2
0
 @After
 public void tearDown() throws Exception {
   apim.purgeObject("demo:777", "", false);
   apim.purgeObject("demo:888", "", false);
   apim.purgeObject("demo:777m", "", false);
   apim.purgeObject("demo:888m", "", false);
   XMLUnit.setXpathNamespaceContext(SimpleNamespaceContext.EMPTY_CONTEXT);
 }
Exemplo n.º 3
0
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("wfs", "http://www.opengis.net/wfs");
    namespaces.put("", "http://www.opengis.net/wfs");
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  }
Exemplo n.º 4
0
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("h", "http://www.w3.org/1999/xhtml");
    namespaces.put("atom", "http://www.w3.org/2005/Atom");
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  }
  @BeforeClass
  public static void setupTestClass() {

    // makes xpaths easier to write when prefixes are declared beforehand.
    HashMap map = new HashMap();
    map.put("gml", "http://www.opengis.net/gml");
    map.put("mc", "urn:catalog:metacard");

    NamespaceContext ctx = new SimpleNamespaceContext(map);
    XMLUnit.setXpathNamespaceContext(ctx);
  }
Exemplo n.º 6
0
 /**
  * Creates the various XML test elements. {@inheritDoc}
  *
  * @throws Exception If anything goes wrong.
  */
 @Override
 public void setUp() throws Exception {
   this.fsManager = new StandardFileSystemManager();
   ((StandardFileSystemManager) this.fsManager).init();
   this.fileHandler = new VFSFileHandler(this.fsManager);
   util = new Dom4JUtil(fileHandler);
   manager = new Dom4JXmlFileBuilder(fileHandler);
   namespaces = new HashMap<String, String>();
   namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
   NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
   XMLUnit.setXpathNamespaceContext(ctx);
 }
  @Override
  protected void onSetUp(SystemTestData testData) throws Exception {
    super.onSetUp(testData);

    testData.addWorkspace(SystemTestData.WCS_PREFIX, SystemTestData.WCS_URI, getCatalog());

    // setup the namespace context for this test
    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("gml", "http://www.opengis.net/gml");
    namespaces.put("gf", "http://www.geoserver.org/rest/granules");
    namespaces.put("wfs", "http://www.opengis.net/wfs");
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
  }
Exemplo n.º 8
0
  @Test
  public void exceptionBasicTest() throws Exception {
    final HttpResponse response = executeGetRequest("NoContainer.NoEntitySet()");
    assertEquals(
        HttpStatusCodes.NOT_FOUND.getStatusCode(), response.getStatusLine().getStatusCode());

    final String payload = StringHelper.inputStreamToString(response.getEntity().getContent());

    Map<String, String> prefixMap = new HashMap<String, String>();
    prefixMap.put("a", Edm.NAMESPACE_M_2007_08);
    XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(prefixMap));

    assertXpathExists("a:error", payload);
    assertXpathExists("/a:error/a:code", payload);
    assertXpathExists("/a:error/a:message[@xml:lang=\"en\"]", payload);
  }
  @Override
  protected void setUpInternal() throws Exception {
    super.setUpInternal();

    Map<String, String> namespaces = new HashMap<String, String>();
    namespaces.put("xlink", "http://www.w3.org/1999/xlink");
    namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    namespaces.put("wms", "http://www.opengis.net/wms");
    namespaces.put("ows", "http://www.opengis.net/ows");
    namespaces.put("ogc", "http://www.opengis.net/ogc");
    namespaces.put("wfs", "http://www.opengis.net/wfs");
    namespaces.put("gml", "http://www.opengis.net/gml");
    namespaces.put(WCS_PREFIX, WCS_URI);

    NamespaceContext ctx = new SimpleNamespaceContext(namespaces);
    XMLUnit.setXpathNamespaceContext(ctx);

    Logging.getLogger("org.geoserver.ows").setLevel(Level.OFF);
    WMSInfo wmsInfo = getGeoServer().getService(WMSInfo.class);
    wmsInfo.setMaxBuffer(50);
    getGeoServer().save(wmsInfo);
  }
Exemplo n.º 10
0
  @Before
  public void setUp() throws Exception {
    apim = s_client.getAPIMMTOM();
    Map<String, String> nsMap = new HashMap<String, String>();
    nsMap.put("oai_dc", "http://www.openarchives.org/OAI/2.0/oai_dc/");
    nsMap.put("dc", "http://purl.org/dc/elements/1.1/");
    nsMap.put("foxml", "info:fedora/fedora-system:def/foxml#");
    NamespaceContext ctx = new SimpleNamespaceContext(nsMap);
    XMLUnit.setXpathNamespaceContext(ctx);

    apim.ingest(
        TypeUtility.convertBytesToDataHandler(DEMO_888_FOXML),
        FOXML1_1.uri,
        "ingesting new foxml object");
    apim.ingest(
        TypeUtility.convertBytesToDataHandler(DEMO_777_FOXML),
        FOXML1_1.uri,
        "ingesting new foxml object");

    // managed content versions of above (reserved datastreams translated from X to M)
    ManagedContentTranslator.createManagedClone(apim, "demo:888", "demo:888m");
    ManagedContentTranslator.createManagedClone(apim, "demo:777", "demo:777m");
  }