Search in sources :

Example 1 with DefaultProcessorFactory

use of com.vodafone360.people.engine.contactsync.DefaultProcessorFactory in project 360-Engine-for-Android by 360.

the class DefaultProcessorFactoryTest method testUnexpectedProcessorType.

/**
     * Checks that the unexpected type of processor creation is handled.
     */
public void testUnexpectedProcessorType() {
    DefaultProcessorFactory factory = new DefaultProcessorFactory();
    Exception exception = null;
    try {
        // with type=-12, an IllegalArgumentException shall be thrown
        factory.create(-12, null, null);
    } catch (IllegalArgumentException e) {
        exception = e;
    }
    // check the exception type
    assertTrue(exception instanceof IllegalArgumentException);
}
Also used : DefaultProcessorFactory(com.vodafone360.people.engine.contactsync.DefaultProcessorFactory)

Example 2 with DefaultProcessorFactory

use of com.vodafone360.people.engine.contactsync.DefaultProcessorFactory in project 360-Engine-for-Android by 360.

the class DefaultProcessorFactoryTest method testProcessorTypeCreation.

/**
     * Tests the type of the created processor depending on the requested type.
     */
@Suppress
public void testProcessorTypeCreation() {
    DefaultProcessorFactory factory = new DefaultProcessorFactory();
    BaseSyncProcessor processor;
    processor = factory.create(ProcessorFactory.DOWNLOAD_SERVER_CONTACTS, null, null);
    assertTrue(processor instanceof DownloadServerContacts);
    processor = factory.create(ProcessorFactory.FETCH_NATIVE_CONTACTS, null, null);
    assertTrue(processor instanceof FetchNativeContacts);
    processor = factory.create(ProcessorFactory.UPDATE_NATIVE_CONTACTS, null, null);
    assertTrue(processor instanceof UpdateNativeContacts);
    processor = factory.create(ProcessorFactory.UPLOAD_SERVER_CONTACTS, null, null);
    assertTrue(processor instanceof UploadServerContacts);
}
Also used : UpdateNativeContacts(com.vodafone360.people.engine.contactsync.UpdateNativeContacts) FetchNativeContacts(com.vodafone360.people.engine.contactsync.FetchNativeContacts) DefaultProcessorFactory(com.vodafone360.people.engine.contactsync.DefaultProcessorFactory) BaseSyncProcessor(com.vodafone360.people.engine.contactsync.BaseSyncProcessor) UploadServerContacts(com.vodafone360.people.engine.contactsync.UploadServerContacts) DownloadServerContacts(com.vodafone360.people.engine.contactsync.DownloadServerContacts) Suppress(android.test.suitebuilder.annotation.Suppress)

Aggregations

DefaultProcessorFactory (com.vodafone360.people.engine.contactsync.DefaultProcessorFactory)2 Suppress (android.test.suitebuilder.annotation.Suppress)1 BaseSyncProcessor (com.vodafone360.people.engine.contactsync.BaseSyncProcessor)1 DownloadServerContacts (com.vodafone360.people.engine.contactsync.DownloadServerContacts)1 FetchNativeContacts (com.vodafone360.people.engine.contactsync.FetchNativeContacts)1 UpdateNativeContacts (com.vodafone360.people.engine.contactsync.UpdateNativeContacts)1 UploadServerContacts (com.vodafone360.people.engine.contactsync.UploadServerContacts)1