Search in sources :

Example 1 with StartServiceLog

use of com.microsoft.azure.mobile.ingestion.models.StartServiceLog in project mobile-center-sdk-android by Microsoft.

the class SessionTrackerTest method ignoreStartService.

@Test
public void ignoreStartService() {
    Log startServiceLog = spy(new StartServiceLog());
    mSessionTracker.onEnqueuingLog(startServiceLog, TEST_GROUP);
    verify(mChannel, never()).enqueue(any(Log.class), anyString());
    verify(startServiceLog, never()).setSid(any(UUID.class));
}
Also used : StartServiceLog(com.microsoft.azure.mobile.ingestion.models.StartServiceLog) StartSessionLog(com.microsoft.azure.mobile.analytics.ingestion.models.StartSessionLog) Log(com.microsoft.azure.mobile.ingestion.models.Log) EventLog(com.microsoft.azure.mobile.analytics.ingestion.models.EventLog) StartServiceLog(com.microsoft.azure.mobile.ingestion.models.StartServiceLog) UUID(java.util.UUID) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 2 with StartServiceLog

use of com.microsoft.azure.mobile.ingestion.models.StartServiceLog in project mobile-center-sdk-android by Microsoft.

the class LogSerializerAndroidTest method startServiceLog.

@Test
public void startServiceLog() throws JSONException {
    StartServiceLog log = new StartServiceLog();
    List<String> services = new ArrayList<>();
    services.add("FIRST");
    services.add("SECOND");
    log.setServices(services);
    UUID sid = UUIDUtils.randomUUID();
    log.setSid(sid);
    /* Verify serialize and deserialize. */
    LogSerializer serializer = new DefaultLogSerializer();
    serializer.addLogFactory(StartServiceLog.TYPE, new StartServiceLogFactory());
    String payload = serializer.serializeLog(log);
    Log actualContainer = serializer.deserializeLog(payload);
    Assert.assertEquals(log, actualContainer);
}
Also used : Log(com.microsoft.azure.mobile.ingestion.models.Log) CustomPropertiesLog(com.microsoft.azure.mobile.ingestion.models.CustomPropertiesLog) StartServiceLog(com.microsoft.azure.mobile.ingestion.models.StartServiceLog) ArrayList(java.util.ArrayList) StartServiceLog(com.microsoft.azure.mobile.ingestion.models.StartServiceLog) UUID(java.util.UUID) Test(org.junit.Test)

Example 3 with StartServiceLog

use of com.microsoft.azure.mobile.ingestion.models.StartServiceLog in project mobile-center-sdk-android by Microsoft.

the class MobileCenter method queueStartService.

/**
     * Send started services.
     *
     * @param services started services.
     */
private synchronized void queueStartService(@NonNull List<String> services) {
    StartServiceLog startServiceLog = new StartServiceLog();
    startServiceLog.setServices(services);
    mChannel.enqueue(startServiceLog, CORE_GROUP);
}
Also used : StartServiceLog(com.microsoft.azure.mobile.ingestion.models.StartServiceLog)

Aggregations

StartServiceLog (com.microsoft.azure.mobile.ingestion.models.StartServiceLog)3 Log (com.microsoft.azure.mobile.ingestion.models.Log)2 UUID (java.util.UUID)2 Test (org.junit.Test)2 EventLog (com.microsoft.azure.mobile.analytics.ingestion.models.EventLog)1 StartSessionLog (com.microsoft.azure.mobile.analytics.ingestion.models.StartSessionLog)1 CustomPropertiesLog (com.microsoft.azure.mobile.ingestion.models.CustomPropertiesLog)1 ArrayList (java.util.ArrayList)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1