/** * Returns the birth date. * * @return birth date */ public String getWhen() { return getValue(); }
/** * Returns whether it has the birth date. * * @return whether it has the birth date */ public boolean hasWhen() { return hasValue(); }
/** * Sets the birth date. * * @param when birth date or <code>null</code> to reset */ public void setWhen(String when) { setValue(when); }
/** * Constructor (mutable or immutable). * * @param when immutable birth date or <code>null</code> for a mutable birth * date */ public Birthday(String when) { super(ContactsNamespace.GCONTACT_NS, XML_NAME, WHEN, when); setRequired(false); }
final String birthdayValue = birthdayElem.getText(); if (birthdayValue != null && !birthdayValue.isEmpty()) { contactEntry.setBirthday(new Birthday(birthdayValue));
/** * Constructor (mutable or immutable). * * @param when immutable birth date or <code>null</code> for a mutable birth * date */ public Birthday(String when) { super(ContactsNamespace.GCONTACT_NS, XML_NAME, WHEN, when); setRequired(false); }
SimpleDateFormat dateFormatter = new SimpleDateFormat(Constants.DATE_FORMAT); dateFormatter.parse(birthdayValue); entryToUpdate.setBirthday(new Birthday(birthdayValue));
/** * Returns the birth date. * * @return birth date */ public String getWhen() { return getValue(); }
/** * Sets the birth date. * * @param when birth date or <code>null</code> to reset */ public void setWhen(String when) { setValue(when); }
/** * Returns whether it has the birth date. * * @return whether it has the birth date */ public boolean hasWhen() { return hasValue(); }
SimpleDateFormat dateFormatter = new SimpleDateFormat(Constants.DATE_FORMAT); dateFormatter.parse(birthdayValue); contactEntry.setBirthday(new Birthday(birthdayValue));
/** * Returns the birth date. * * @return birth date */ public String getWhen() { return getValue(); }
/** * Sets the birth date. * * @param when birth date or <code>null</code> to reset */ public void setWhen(String when) { setValue(when); }
/** * Returns whether it has the birth date. * * @return whether it has the birth date */ public boolean hasWhen() { return hasValue(); }
@Override public String toString() { return "{Birthday when=" + getValue() + "}"; }
@Override public String toString() { return "{Birthday when=" + getValue() + "}"; }
@Override public String toString() { return "{Birthday when=" + getValue() + "}"; }
/** * Positive test case for createContact method with optional parameters. */ @Test(priority = 1, groups = { "wso2.esb" }, description = "Google Contacts {createContact} integration test with optional parameters.") public void testCreateContactWithOptionalParameters() throws Exception { SOAPEnvelope esbSoapResponse = sendSOAPRequest(proxyUrl, "esb_createContact_optional.xml"); Assert.assertTrue(esbSoapResponse.getBody().toString().contains("atom:id")); String xPathExp = "string(//atom:id/text())"; String idUrl = (String) xPathEvaluate(esbSoapResponse, xPathExp, nameSpaceMap); contactId = idUrl.substring(idUrl.lastIndexOf("/") + 1, idUrl.length()); ContactEntry directResponseObject = directInvoker.retrieveSingleContact(contactId); Assert.assertEquals(idUrl, directResponseObject.getId()); Assert.assertEquals((String) xPathEvaluate(esbSoapResponse, "string(//gd:givenName/text())", nameSpaceMap), directResponseObject .getName().getGivenName().getValue()); Assert.assertEquals((String) xPathEvaluate(esbSoapResponse, "string(//gContact:birthday/@when)", nameSpaceMap), directResponseObject .getBirthday().getValue()); }