Add unit tests for adapter classes

This commit is contained in:
Klaus Reimer 2013-04-18 18:58:59 +02:00
parent 4d586e0cb8
commit 668d7cd6b1
3 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,37 @@
/*
* Copyright (C) 2013 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
package de.ailis.usb4java.adapter;
import javax.usb.event.UsbDeviceDataEvent;
import javax.usb.event.UsbDeviceErrorEvent;
import javax.usb.event.UsbDeviceEvent;
import javax.usb.event.UsbDeviceListener;
import org.junit.Test;
/**
* Test the {@link UsbDeviceAdapter} class. There is not really anything to
* test there. This class just ensures that the class exists and provides
* the needed methods.
*
* @author Klaus Reimer (k@ailis.de)
*/
public class UsbDeviceAdapterTest
{
/**
* Ensure the existence of the needed methods.
*/
@Test
public void testAbstractMethods()
{
final UsbDeviceListener adapter = new UsbDeviceAdapter()
{
// Empty
};
adapter.usbDeviceDetached((UsbDeviceEvent) null);
adapter.dataEventOccurred((UsbDeviceDataEvent) null);
adapter.errorEventOccurred((UsbDeviceErrorEvent) null);
}
}

View File

@ -0,0 +1,35 @@
/*
* Copyright (C) 2013 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
package de.ailis.usb4java.adapter;
import javax.usb.event.UsbPipeDataEvent;
import javax.usb.event.UsbPipeErrorEvent;
import javax.usb.event.UsbPipeListener;
import org.junit.Test;
/**
* Test the {@link UsbPipeAdapter} class. There is not really anything to
* test there. This class just ensures that the class exists and provides
* the needed methods.
*
* @author Klaus Reimer (k@ailis.de)
*/
public class UsbPipeAdapterTest
{
/**
* Ensure the existence of the needed methods.
*/
@Test
public void testAbstractMethods()
{
final UsbPipeListener adapter = new UsbPipeAdapter()
{
// Empty
};
adapter.dataEventOccurred((UsbPipeDataEvent) null);
adapter.errorEventOccurred((UsbPipeErrorEvent) null);
}
}

View File

@ -0,0 +1,34 @@
/*
* Copyright (C) 2013 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
package de.ailis.usb4java.adapter;
import javax.usb.event.UsbServicesEvent;
import javax.usb.event.UsbServicesListener;
import org.junit.Test;
/**
* Test the {@link UsbServicesAdapter} class. There is not really anything to
* test there. This class just ensures that the class exists and provides
* the needed methods.
*
* @author Klaus Reimer (k@ailis.de)
*/
public class UsbServicesAdapterTest
{
/**
* Ensure the existence of the needed methods.
*/
@Test
public void testAbstractMethods()
{
final UsbServicesListener adapter = new UsbServicesAdapter()
{
// Empty
};
adapter.usbDeviceAttached((UsbServicesEvent) null);
adapter.usbDeviceDetached((UsbServicesEvent) null);
}
}