Source:
public void testParse() throws Exception { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); docFactory.setNamespaceAware(true); InputStream is = WFS_2_0_0_ParsingTest.class.getResourceAsStream("fmi-DescribeStoredQueries_2_0_0.xml"); try { document = docFactory.newDocumentBuilder().parse(is); } finally { is.close(); } Object o = parse(); DescribeStoredQueriesResponseType response = (DescribeStoredQueriesResponseType)o; assertNotNull(response); List<StoredQueryDescriptionType> descs = response.getStoredQueryDescription(); assertNotNull(descs); assertEquals(1, descs.size()); StoredQueryDescriptionType desc = descs.get(0); assertNotNull(desc); assertEquals("Hirlam Pressure Grid", desc.getTitle().get(0).getValue()); assertEquals("\n Hirlam forecast model's pressure levels as a grid data encoded in GRIB format.\n ", desc.getAbstract().get(0).getValue()); assertEquals(6, desc.getParameter().size()); ParameterExpressionType param1= desc.getParameter().get(0); assertNotNull(param1); assertEquals("starttime", param1.getName()); assertEquals("dateTime", param1.getType().getLocalPart()); assertEquals(1, desc.getQueryExpressionText().size()); QueryExpressionTextType queryExpr = desc.getQueryExpressionText().get(0); assertNotNull(queryExpr); assertEquals(1, queryExpr.getReturnFeatureTypes().size()); QName returnType = queryExpr.getReturnFeatureTypes().get(0); String language = queryExpr.getLanguage(); QName expectedReturnType = new QName("<LINK_0>", "GridSeriesObservation"); String expectedLanguage = "urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"; assertEquals(expectedReturnType, returnType); assertEquals(expectedLanguage, language); }

Target:
public void testParse() throws Exception { DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); docFactory.setNamespaceAware(true); InputStream is = WFS_2_0_0_ParsingTest.class.getResourceAsStream("fmi-DescribeStoredQueries_2_0_0.xml"); try { document = docFactory.newDocumentBuilder().parse(is); } finally { is.close(); } Object o = parse(); DescribeStoredQueriesResponseType response = (DescribeStoredQueriesResponseType)o; assertNotNull(response); List<StoredQueryDescriptionType> descs = response.getStoredQueryDescription(); assertNotNull(descs); assertEquals(1, descs.size()); StoredQueryDescriptionType desc = descs.get(0); assertNotNull(desc); assertEquals("Hirlam Pressure Grid", desc.getTitle().get(0).getValue()); assertEquals("Hirlam forecast model's pressure levels as a grid data encoded in GRIB format.", desc.getAbstract().get(0).getValue()); assertEquals(6, desc.getParameter().size()); ParameterExpressionType param1= desc.getParameter().get(0); assertNotNull(param1); assertEquals("starttime", param1.getName()); assertEquals("dateTime", param1.getType().getLocalPart()); assertEquals(1, desc.getQueryExpressionText().size()); QueryExpressionTextType queryExpr = desc.getQueryExpressionText().get(0); assertNotNull(queryExpr); assertEquals(1, queryExpr.getReturnFeatureTypes().size()); QName returnType = queryExpr.getReturnFeatureTypes().get(0); String language = queryExpr.getLanguage(); QName expectedReturnType = new QName("<LINK_0>", "GridSeriesObservation"); String expectedLanguage = "urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"; assertEquals(expectedReturnType, returnType); assertEquals(expectedLanguage, language); }