Any proposition how to test async calls?


On 14 Жов, 15:23, viktor <[email protected]> wrote:
> Hi everyone,
>
> Is it possible to receive notification from activities in a test case?
>
> I want to test async precesses with broadcast messages. If process
> done I  send broadcast and catch it in a test case, but anything
> doesn't happen.
>
> I declared receiver in manifest.
>
> This is my example: MainApp
>  Intent intent = new Intent();
>  intent.putExtra("test_message", "main data received");
>  intent.setAction("test_message");
>  sendBroadcast(intent);
>
> TestReceiver:
>
> public class TestBroadcastReceiver extends  BroadcastReceiver{
>
>         @Override
>         public void onReceive(Context arg0, Intent intent) {
>                 Log.d("TestBroadcastReceiver", "broadcast received");
>                 if(intent.getStringExtra("test_message") != null){
>                         String testMessage = 
> intent.getStringExtra("test_message");
>                         Log.d("TestBroadcastReceiver", "test message: 
> "+testMessage);
>                 }
>
>         }
>
>
>
>
>
>
>
> }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to