Examples of stringValueOf()


Examples of ca.ecliptical.emf.xpath.EMFDOMXPath.stringValueOf()

    assertEquals("Book 1", book.getTitle());
  }

  public final void testStringValueOf() throws Exception {
    EMFDOMXPath xpath = new EMFDOMXPath("writers[last()]/@name");
    String result = xpath.stringValueOf(fixture);
    assertEquals("Writer 2", result);
  }

  public final void testSum() throws Exception {
    EMFDOMXPath xpath = new EMFDOMXPath("sum(books/@pages)");
View Full Code Here

Examples of ca.ecliptical.emf.xpath.EMFXPath.stringValueOf()

  }
 
  public final void testStringValueOf() throws Exception {
    EMFXPath xpath = new EMFXPath("lib:writers[lib:books[.=//lib:books[lib:category='Mystery']]]/lib:name");
    xpath.addNamespace("lib", LibraryPackage.eNS_URI);
    String result = xpath.stringValueOf(fixture);
    assertEquals("Writer 1", result);
  }
 
  public final void testSum() throws Exception {
    EMFXPath xpath = new EMFXPath("sum(lib:books/lib:pages)");
View Full Code Here

Examples of ca.ecliptical.emf.xpath.EMFXPath.stringValueOf()

  }

  public final void testEClassFunction() throws Exception {
    EMFXPath xpath = new EMFXPath("eClass()/ecore:name");
    xpath.addNamespace("ecore", EcorePackage.eNS_URI);
    String eClassName = xpath.stringValueOf(fixture);
    assertEquals("Library", eClassName);
  }
 
  public static void main(String[] args) throws Exception {
    EMFXPathTest test = new EMFXPathTest(null);
View Full Code Here

Examples of com.canoo.webtest.engine.xpath.XPathHelper.stringValueOf()

  protected void verifyXPath() throws XPathException, StepFailedException {
    final Page currentResponse = getContext().getCurrentResponse();
    final XPathHelper xpathHelper = getContext().getXPathHelper();

    if (isComparingPathAndValue()) {
      final String actualValue = xpathHelper.stringValueOf(currentResponse, getXpath());
      if (!verifyText(actualValue)) {
        throw new StepFailedException("Wrong result for xpath >" + fXpath + "<", getText(), actualValue, this);
      }
    }
    else
View Full Code Here

Examples of com.google.gdata.data.analytics.DataEntry.stringValueOf()

      DataEntry entry = analyticsData.getEntries().get(i);

      // All dimensions are returned from the API as Strings, but in the case of groupID and
      // criterionID, they're really longs.  Cast as long using Long.parseLong(str).
      Long groupID = Long.parseLong(entry.stringValueOf("ga:adwordsAdGroupID"));
      Long critID = Long.parseLong(entry.stringValueOf("ga:adwordsCriteriaID"));

      // Add AdWords IDs from Google Analytics to criteria filter array.
      AdGroupCriterionIdFilter critFilter = new AdGroupCriterionIdFilter();
      critFilter.setAdGroupId(groupID);
View Full Code Here

Examples of org.apache.axiom.om.xpath.AXIOMXPath.stringValueOf()

                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
        OMElement root2 = AXIOMUtil.stringToOM(
                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
        xpath.addNamespaces(root1.getFirstElement());
        assertEquals("text", xpath.stringValueOf(root2.getParent()));
    }

    public void testAddNamespaces2() throws Exception {
        OMElement root1 = AXIOMUtil.stringToOM(
                "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    public void testMessageContextGetStringValueBody() throws Exception {
        SynapseXPath axiomXpath = new SynapseXPath("$body/ns1:a/ns1:c");
        axiomXpath.addNamespace("ns1", nsNamespace1);
        MessageContext synCtx = TestUtils.getTestContext(sampleBody);

        String result = axiomXpath.stringValueOf(synCtx);
        assertEquals("second", result);
    }

    public void testMessageContextGetStringValueEnvelope() throws Exception {
        SynapseXPath axiomXpath = new SynapseXPath("/s11:Envelope/s11:Body/ns1:a/ns1:c");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

        axiomXpath.addNamespace("s11", nsSoapEnv);
        axiomXpath.addNamespace("ns1", nsNamespace1);

        MessageContext synCtx = TestUtils.getTestContext(sampleBody);

        String result = axiomXpath.stringValueOf(synCtx);
        assertEquals("second", result);
    }

}
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    String message = "This is XPath test";   

    public void testStringXPath() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\">" + message + "</m0:test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testStringXPath2() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test/{http://someother}another");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\"><m1:another xmlns:m1=\"http://someother\">" + message + "</m1:another></m0:test>");
View Full Code Here

Examples of org.apache.synapse.util.xpath.SynapseXPath.stringValueOf()

    }

    public void testStringXPath2() throws Exception {
        SynapseXPath xpath = SynapseXPath.parseXPathString("$body//{http://somens}test/{http://someother}another");
        MessageContext ctx =  TestUtils.getTestContext("<m0:test xmlns:m0=\"http://somens\"><m1:another xmlns:m1=\"http://someother\">" + message + "</m1:another></m0:test>");
        assertEquals(message, xpath.stringValueOf(ctx));
    }

    public void testAbsoluteXPath() throws Exception {
        SynapseXPath xpath = new SynapseXPath("//test");
        MessageContext ctx =  TestUtils.getTestContext("<test>" + message + "</test>");
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.