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);
}
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);
}
Aggregations