diff options
Diffstat (limited to 'android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle')
2 files changed, 35 insertions, 26 deletions
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java index 6ed606648..61edcf87d 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/LifecycleConfigurationUpdateTest.java @@ -35,44 +35,43 @@ package com.smartdevicelink.managers.lifecycle; -import com.smartdevicelink.AndroidTestCase2; -import com.smartdevicelink.test.Test; +import android.support.test.runner.AndroidJUnit4; -public class LifecycleConfigurationUpdateTest extends AndroidTestCase2 { +import com.smartdevicelink.test.TestValues; - @Override - public void setUp() throws Exception { - super.setUp(); - } +import org.junit.Test; +import org.junit.runner.RunWith; - @Override - public void tearDown() throws Exception { - super.tearDown(); - } +import static junit.framework.TestCase.assertEquals; + +@RunWith(AndroidJUnit4.class) +public class LifecycleConfigurationUpdateTest { + @Test public void testIndividualSettersAndGetters(){ LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(); - lifecycleConfigurationUpdate.setAppName(Test.GENERAL_STRING); - lifecycleConfigurationUpdate.setShortAppName(Test.GENERAL_STRING); - lifecycleConfigurationUpdate.setTtsName(Test.GENERAL_VECTOR_TTS_CHUNKS); - lifecycleConfigurationUpdate.setVoiceRecognitionCommandNames(Test.GENERAL_VECTOR_STRING); + lifecycleConfigurationUpdate.setAppName(TestValues.GENERAL_STRING); + lifecycleConfigurationUpdate.setShortAppName(TestValues.GENERAL_STRING); + lifecycleConfigurationUpdate.setTtsName(TestValues.GENERAL_VECTOR_TTS_CHUNKS); + lifecycleConfigurationUpdate.setVoiceRecognitionCommandNames(TestValues.GENERAL_VECTOR_STRING); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); - assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); - assertEquals(Test.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); + assertEquals(TestValues.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); + assertEquals(TestValues.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); } + @Test public void testHelperConstructor(){ - LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(Test.GENERAL_STRING, Test.GENERAL_STRING, Test.GENERAL_VECTOR_TTS_CHUNKS, Test.GENERAL_VECTOR_STRING); + LifecycleConfigurationUpdate lifecycleConfigurationUpdate = new LifecycleConfigurationUpdate(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_VECTOR_TTS_CHUNKS, TestValues.GENERAL_VECTOR_STRING); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); - assertEquals(Test.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); - assertEquals(Test.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); - assertEquals(Test.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getAppName()); + assertEquals(TestValues.GENERAL_STRING, lifecycleConfigurationUpdate.getShortAppName()); + assertEquals(TestValues.GENERAL_VECTOR_TTS_CHUNKS, lifecycleConfigurationUpdate.getTtsName()); + assertEquals(TestValues.GENERAL_VECTOR_STRING, lifecycleConfigurationUpdate.getVoiceRecognitionCommandNames()); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java index 34b3f71aa..1031fc652 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/RpcConverterTest.java @@ -1,6 +1,7 @@ package com.smartdevicelink.managers.lifecycle; -import com.smartdevicelink.AndroidTestCase2; +import android.support.test.runner.AndroidJUnit4; + import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.protocol.ProtocolMessage; import com.smartdevicelink.protocol.enums.FunctionID; @@ -9,9 +10,16 @@ import com.smartdevicelink.protocol.enums.SessionType; import com.smartdevicelink.proxy.RPCMessage; import com.smartdevicelink.util.Version; +import org.junit.Test; +import org.junit.runner.RunWith; + import java.lang.reflect.InvocationTargetException; -public class RpcConverterTest extends AndroidTestCase2 { +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertNotNull; + +@RunWith(AndroidJUnit4.class) +public class RpcConverterTest { private static final String RPC_PACKAGE = "com.smartdevicelink.proxy.rpc."; private static final String RESPONSE_KEY = "Response"; @@ -21,6 +29,7 @@ public class RpcConverterTest extends AndroidTestCase2 { * The RPC converter relies on the function id json name to match the class name exactly. * Therefore we will test to ensure that they match up first. */ + @Test public void testFunctionIdsAgainstFileNames(){ FunctionID[] functionIDs = FunctionID.values(); for(FunctionID functionID : functionIDs) { @@ -87,6 +96,7 @@ public class RpcConverterTest extends AndroidTestCase2 { return null; } + @Test public void testRpcCreation(){ FunctionID[] functionIDs = FunctionID.values(); |