package com.fca.uconnect.global.test;

import static org.junit.Assert.assertFalse;

import java.util.List;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import com.fca.uconnect.global.GlobalUconnectControl.UconnectAny;
import com.fca.uconnect.global.GlobalUconnectExtECall;
import com.fca.uconnect.global.SDPExampleForECall;
import com.fca.uconnect.global.TBMExampleForECall;

public class ECallTest {
	static SDPExampleForECall referenceService = new SDPExampleForECall();
	static TBMExampleForECall referenceClient =new TBMExampleForECall();

	@BeforeClass
	public  static  void setUpClass(){
		try {
			
			referenceService.process();
			  Thread.sleep(1000);
		} catch (Exception e) {
			e.printStackTrace();
		}				
	}	 

	 
	@Test
	public void testECallSuccess() throws Exception{
		     referenceClient.process();
		    List<UconnectAny> messages = referenceService.getECallDataMsg();
		    for(UconnectAny message:messages){
	 			if(message.hasExtension(GlobalUconnectExtECall.ecallDataUpload)) {	
				assertFalse(false);
	 			}
		    }
	}
	@AfterClass
	public  static  void disconnectClass(){
		try {
			referenceService.disconnect();
			referenceClient.disconnect();
		} catch (Exception e) {
			e.printStackTrace();
		}				
	}
	
}
