From implements IFrom { public void setQuery(String expr) { unsetQueryAndLiteral(); TQuery tq = from.addNewQuery(); Document doc = tq.getDomNode().getOwnerDocument(); Text exprNode = doc.createTextNode(expr); tq.getDomNode().appendChild(exprNode); } From(TFrom wrappedFrom); List<Documentation> getDocumentation(); Documentation addDocumentation(); Roles getEndpointReference(); String getExpressionLanguage(); String getPart(); String getPartnerLink(); String getVariable(); void setEndpointReference(Roles value); void setQuery(String expr); void setExpressionLanguage(String value); Element setNewLiteral(String namespaceUri, String localName); @Override Element getLiteral(); void setPart(String value); void setPartnerLink(String value); void setVariable(IVariable v); void setVariable(String value); @Override QName getProperty(); @Override void setProperty(QName qname); @Override Query setNewQuery(); @Override Query getQuery(); @Override String getXPathInDocument(); @Override void addGlobalNamespace(String prefix, String namespaceUri); @Override void addLocalNamespace(String prefix, String namespaceUri); @Override String getNamespacePrefix(String namespaceUri);  }
@Test public void testSetQuery() throws Exception { from.setNewLiteral("a", "A"); IQuery query = from.setNewQuery(); assertNotNull(query); assertSame(query, from.getQuery()); assertNull(from.getLiteral()); }