Removed test stuff.

This commit is contained in:
Klaus Reimer 2011-02-07 21:24:35 +01:00 committed by k
parent 91e2742830
commit 3d72c00418
4 changed files with 0 additions and 209 deletions

19
pom.xml
View File

@ -54,7 +54,6 @@
<properties> <properties>
<releasesUrl>http://www.ailis.de/nexus/content/repositories/releases/de/ailis/${project.artifactId}/${project.artifactId}/${project.version}</releasesUrl> <releasesUrl>http://www.ailis.de/nexus/content/repositories/releases/de/ailis/${project.artifactId}/${project.artifactId}/${project.version}</releasesUrl>
<snapshotsUrl>http://www.ailis.de/nexus/content/repositories/snapshots/de/ailis/${project.artifactId}/${project.artifactId}</snapshotsUrl> <snapshotsUrl>http://www.ailis.de/nexus/content/repositories/snapshots/de/ailis/${project.artifactId}/${project.artifactId}</snapshotsUrl>
<powermock.version>1.4.7</powermock.version>
</properties> </properties>
<build> <build>
@ -135,24 +134,6 @@
</distributionManagement> </distributionManagement>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>javax.usb</groupId> <groupId>javax.usb</groupId>
<artifactId>usb</artifactId> <artifactId>usb</artifactId>

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2011 Klaus Reimer <k@ailis.de>
* 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()
{
}
}

View File

@ -1,94 +0,0 @@
/*
* Copyright (C) 2011 Klaus Reimer <k@ailis.de>
* 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());
}
}

View File

@ -1,68 +0,0 @@
/*
* Copyright (C) 2011 Klaus Reimer <k@ailis.de>
* 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);
}
}