@@ -0,0 +1,2248 @@
+package com.ibm.iotf.client.device.test;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.IOException;%0Aimport java.util.Properties;%0A%0Aimport org.junit.Test;%0A%0A%0A%0A%0Aimport com.ibm.iotf.client.app.ApplicationClient;%0Aimport com.ibm.iotf.client.app.ApplicationStatus;%0Aimport com.ibm.iotf.client.app.Command;%0Aimport com.ibm.iotf.client.app.DeviceStatus;%0Aimport com.ibm.iotf.client.app.Event;%0Aimport com.ibm.iotf.client.app.EventCallback;%0Aimport com.ibm.iotf.client.app.StatusCallback;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class TestSubscriptionInvalidAuthKey extends TestCase%7B%0A%09%0A%09@Test%0A%09public void testSubscribe()%7B%0A%09%09try%7B%0A%09%09Properties opt = new Properties();%0A%09%09ApplicationClient client = null;%0A%09%09%0A%09%09%0A%09%09%0A%09%09%09%0A%09%09File file = new File(%22src/com/ibm/iotf/client/device/test/test.properties%22);%0A%09%09FileInputStream fileInput = new FileInputStream(file);%0A%09%09Properties properties = new Properties();%0A%09%09properties.load(fileInput);%0A%09%09fileInput.close();%0A%0A%09%09%0A%09%09%0A%0A%09%09opt.put(%22auth-key%22, %22authKey%22);%0A%09%09opt.put(%22auth-token%22, properties.getProperty(%22authToken%22));%0A%09%09opt.put(%22id%22, properties.getProperty(%22id%22));%0A%09%09opt.put(%22auth-method%22, properties.getProperty(%22auth-method%22));%0A%09%0A%09%0A%09%09client = new ApplicationClient(opt);%0A%09%09client.connect();%0A%09%09%0A%09%09%0A%09%09client.setEventCallback(new MyEventCallback());%0A%09%09client.setStatusCallback(new MyStatusCallback());%0A%09%09client.subscribeToDeviceStatus();%0A%09%09%0A%09%09%7D catch (FileNotFoundException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09%7D%0A%0A%09private class MyEventCallback implements EventCallback %7B%0A%0A%09%09@Override%0A%09%09public void processEvent(Event e) %7B%0A%09%09%09System.out.println(%22Event %22 + e.getPayload());%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void processCommand(Command cmd) %7B%0A%09%09%09System.out.println(%22Command %22 + cmd.getPayload());%09%09%09%0A%09%09%7D%0A%0A%0A%09%09%0A%09%7D%0A%09%0A%09private class MyStatusCallback implements StatusCallback %7B%0A%0A%09%09@Override%0A%09%09public void processApplicationStatus(ApplicationStatus status) %7B%0A%09%09%09System.out.println(%22Application Status = %22 + status.getPayload());%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void processDeviceStatus(DeviceStatus status) %7B%0A%09%09%09System.out.println(%22Device Status = %22 + status.getPayload());%0A%09%09%7D%0A%09%7D%0A%0A%0A%0A%7D%0A

Adding negative testcase