From 3d72c00418d22adf28ed7c1cef89703bfe0e67d4 Mon Sep 17 00:00:00 2001 From: Klaus Reimer Date: Mon, 7 Feb 2011 21:24:35 +0100 Subject: [PATCH] Removed test stuff. --- pom.xml | 19 ---- .../java/de/ailis/usb4java/ServicesTest.java | 28 ------ .../LibUsbEndpointDescriptorTest.java | 94 ------------------- .../jni/USB_Endpoint_Descriptor_Test.java | 68 -------------- 4 files changed, 209 deletions(-) delete mode 100644 src/test/java/de/ailis/usb4java/ServicesTest.java delete mode 100644 src/test/java/de/ailis/usb4java/descriptors/LibUsbEndpointDescriptorTest.java delete mode 100644 src/test/java/de/ailis/usb4java/jni/USB_Endpoint_Descriptor_Test.java diff --git a/pom.xml b/pom.xml index 23af233..3b5b120 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,6 @@ http://www.ailis.de/nexus/content/repositories/releases/de/ailis/${project.artifactId}/${project.artifactId}/${project.version} http://www.ailis.de/nexus/content/repositories/snapshots/de/ailis/${project.artifactId}/${project.artifactId} - 1.4.7 @@ -135,24 +134,6 @@ - - junit - junit - 4.8.2 - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito - ${powermock.version} - test - javax.usb usb diff --git a/src/test/java/de/ailis/usb4java/ServicesTest.java b/src/test/java/de/ailis/usb4java/ServicesTest.java deleted file mode 100644 index 70bd648..0000000 --- a/src/test/java/de/ailis/usb4java/ServicesTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2011 Klaus Reimer - * See LICENSE.txt for licensing information. - */ - -package de.ailis.usb4java; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - - -/** - * Tests the Services class. - * - * @author Klaus Reimer (k@ailis.de) - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest( { Services.class }) -public class ServicesTest -{ - @Test - public void testConstructor() - { - } -} diff --git a/src/test/java/de/ailis/usb4java/descriptors/LibUsbEndpointDescriptorTest.java b/src/test/java/de/ailis/usb4java/descriptors/LibUsbEndpointDescriptorTest.java deleted file mode 100644 index a416c5b..0000000 --- a/src/test/java/de/ailis/usb4java/descriptors/LibUsbEndpointDescriptorTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011 Klaus Reimer - * See LICENSE.txt for licensing information. - */ - -package de.ailis.usb4java.descriptors; - -import static org.junit.Assert.assertEquals; -import static org.powermock.api.mockito.PowerMockito.when; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import de.ailis.usb4java.jni.USB_Descriptor_Header; -import de.ailis.usb4java.jni.USB_Endpoint_Descriptor; - - -/** - * Tests the LibUsbEndpointDescriptor class. - * - * @author Klaus Reimer (k@ailis.de) - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest( { USB_Endpoint_Descriptor.class, USB_Descriptor_Header.class }) -public class LibUsbEndpointDescriptorTest -{ - /** The descriptor to test. */ - private static LibUsbEndpointDescriptor descriptor; - - - /** - * Prepares the test subject. - */ - - @BeforeClass - public static void beforeClass() - { - final USB_Endpoint_Descriptor mock = PowerMockito.mock(USB_Endpoint_Descriptor.class); - when(mock.bEndpointAddress()).thenReturn(200); - when(mock.bmAttributes()).thenReturn(201); - when(mock.wMaxPacketSize()).thenReturn(40000); - when(mock.bInterval()).thenReturn(202); - descriptor = new LibUsbEndpointDescriptor(mock); - } - - - /** - * Tests the bEndpointAddress() method. - */ - - @Test - public void testBEndpointAddress() - { - assertEquals((byte) 200, descriptor.bEndpointAddress()); - } - - - /** - * Tests the bmAttributes() method. - */ - - @Test - public void testBmAttributes() - { - assertEquals((byte) 201, descriptor.bmAttributes()); - } - - - /** - * Tests the wMaxPacketSize() method. - */ - - @Test - public void testWMaxPacketSize() - { - assertEquals((short) 40000, descriptor.wMaxPacketSize()); - } - - - /** - * Tests the bInterval() method. - */ - - @Test - public void testBInterval() - { - assertEquals((byte) 202, descriptor.bInterval()); - } -} diff --git a/src/test/java/de/ailis/usb4java/jni/USB_Endpoint_Descriptor_Test.java b/src/test/java/de/ailis/usb4java/jni/USB_Endpoint_Descriptor_Test.java deleted file mode 100644 index 2a4a9fd..0000000 --- a/src/test/java/de/ailis/usb4java/jni/USB_Endpoint_Descriptor_Test.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2011 Klaus Reimer - * See LICENSE.txt for licensing information. - */ - -package de.ailis.usb4java.jni; - -import static org.junit.Assert.assertNotNull; -import static org.powermock.api.mockito.PowerMockito.mock; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.nio.ByteBuffer; - -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - - -/** - * Tests the Services class. - * - * @author Klaus Reimer (k@ailis.de) - */ - -@RunWith(PowerMockRunner.class) -@PrepareForTest({ USB_Endpoint_Descriptor.class }) -public class USB_Endpoint_Descriptor_Test -{ - /** The descriptor to test. */ - private static USB_Endpoint_Descriptor descriptor; - - - /** - * Prepares the test class. - */ - - @BeforeClass - public static void beforeClass() - { - descriptor = new USB_Endpoint_Descriptor(ByteBuffer.allocateDirect(18)); - } - - - /** - * Tests the dump method. - * @throws Exception - */ - - @Test - public void testDump() throws Exception - { - final USB_Endpoint_Descriptor descriptor = mock(USB_Endpoint_Descriptor.class); - when(descriptor.bDescriptorType()).thenReturn(1); - when(descriptor.bEndpointAddress()).thenReturn(2); - when(descriptor.bInterval()).thenReturn(3); - when(descriptor.bLength()).thenReturn(4); - when(descriptor.bmAttributes()).thenReturn(5); - when(descriptor.bRefresh()).thenReturn(6); - when(descriptor.bSynchAddress()).thenReturn(7); - when(descriptor.extra()).thenReturn(ByteBuffer.allocateDirect(4)); - when(descriptor.extralen()).thenReturn(2); - when(descriptor.dump()).thenCallRealMethod(); - final String actual = descriptor.dump(); - assertNotNull(actual); - } -}