package com.openxc.remote;

import com.openxc.remote.RemoteVehicleService;

import com.openxc.remote.sources.ManualVehicleDataSource;

import android.content.Intent;

import android.test.ServiceTestCase;

import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;

public class RemoteVehicleServiceTest
        extends ServiceTestCase<RemoteVehicleService> {
    Intent startIntent;

    public RemoteVehicleServiceTest() {
        super(RemoteVehicleService.class);
    }

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        startIntent = new Intent();
        startIntent.putExtra(RemoteVehicleService.DATA_SOURCE_NAME_EXTRA,
                ManualVehicleDataSource.class.getName());
        startIntent.setClass(getContext(), RemoteVehicleServiceInterface.class);
    }

    @SmallTest
    public void testPreconditions() {
    }

    @SmallTest
    public void testStartable() {
        startService(startIntent);
    }

    @MediumTest
    public void testBindable() {
        assertNotNull(bindService(startIntent));
    }

    @MediumTest
    public void testUsingManualSource() {
        startIntent.putExtra("data_source",
                ManualVehicleDataSource.class.getName());
        assertNotNull(bindService(startIntent));
    }
}

@@ -642,140 +642,8 @@
 ();%0A
-        startIntent.putExtra(RemoteVehicleService.DATA_SOURCE_NAME_EXTRA,%0A                ManualVehicleDataSource.class.getName());%0A
     
@@ -711,32 +711,32 @@
 terface.class);%0A
+
     %7D%0A%0A    @Smal
@@ -917,15 +917,21 @@
 test
-Bindabl
+UsingUsbSourc
 e() 
@@ -1079,21 +1079,51 @@
 tra(
-%22data_source%22
+RemoteVehicleService.DATA_SOURCE_NAME_EXTRA
 ,%0A  

Test remote service with USB data source (and no device plugged in).