Search in sources :

Example 61 with Name

use of com.vodafone360.people.datatypes.VCardHelper.Name in project 360-Engine-for-Android by 360.

the class NowPlusDatatypesTests method testIdentity.

public void testIdentity() {
    Identity input = new Identity();
    input.mPluginId = "pluginid";
    input.mNetwork = "network";
    input.mIdentityId = "identityId";
    input.mDisplayName = "displayname";
    input.mCreated = new Long(12);
    input.mUpdated = new Long(23);
    input.mActive = true;
    input.mAuthType = "none";
    input.mIdentityType = "chat";
    input.mUserId = new Integer(1234);
    input.mUserName = "bob";
    input.mCountryList = new ArrayList<String>();
    input.mName = "bob";
    String urlString = "http://www.mobica.com/";
    try {
        input.mNetworkUrl = new URL(urlString);
    } catch (MalformedURLException e) {
        input.mNetworkUrl = null;
    }
    assertFalse("Input identity Name or Network is Empty or NULL", input.isIdentityFieldBlankorNull());
    Hashtable<String, Object> hash = new Hashtable<String, Object>();
    hash.put("pluginid", input.mPluginId);
    hash.put("network", input.mNetwork);
    hash.put("identityid", input.mIdentityId);
    hash.put("displayname", input.mDisplayName);
    hash.put("networkurl", urlString);
    hash.put("created", input.mCreated);
    hash.put("updated", input.mUpdated);
    hash.put("active", true);
    hash.put("authtype", input.mAuthType);
    hash.put("identitytype", input.mIdentityType);
    hash.put("userid", new Long(1234));
    hash.put("username", input.mUserName);
    hash.put("countrylist", input.mCountryList);
    hash.put("name", input.mName);
    Identity helper = new Identity();
    Identity output = helper.createFromHashtable(hash);
    assertFalse("Output identity Name or Network is Empty or NULL", output.isIdentityFieldBlankorNull());
    assertEquals(input.getType(), output.getType());
    assertEquals(input.toString(), output.toString());
    assertTrue(input.isSameAs(output));
}
Also used : MalformedURLException(java.net.MalformedURLException) Hashtable(java.util.Hashtable) Identity(com.vodafone360.people.datatypes.Identity) URL(java.net.URL)

Aggregations

ContactDetail (com.vodafone360.people.datatypes.ContactDetail)23 ServiceStatus (com.vodafone360.people.service.ServiceStatus)20 VCardHelper (com.vodafone360.people.datatypes.VCardHelper)13 Cursor (android.database.Cursor)12 Contact (com.vodafone360.people.datatypes.Contact)12 ArrayList (java.util.ArrayList)11 Name (com.vodafone360.people.datatypes.VCardHelper.Name)9 ContentValues (android.content.ContentValues)7 Uri (android.net.Uri)7 ContactSummary (com.vodafone360.people.datatypes.ContactSummary)7 SQLException (android.database.SQLException)6 Organisation (com.vodafone360.people.datatypes.VCardHelper.Organisation)6 QueueManager (com.vodafone360.people.service.io.QueueManager)6 Request (com.vodafone360.people.service.io.Request)6 TimelineSummaryItem (com.vodafone360.people.database.tables.ActivitiesTable.TimelineSummaryItem)5 ActivityItem (com.vodafone360.people.datatypes.ActivityItem)5 Hashtable (java.util.Hashtable)5 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)4 Suppress (android.test.suitebuilder.annotation.Suppress)4 Date (java.util.Date)4