assertEquals(new MediaLocator(":").toExternalForm(), ":");
}
public void testCaptureDeviceInfo()
{
assertFalse(new CaptureDeviceInfo().equals(new CaptureDeviceInfo()));
assertFalse(new CaptureDeviceInfo("xyz", null, null).equals(
new CaptureDeviceInfo("xyz", null, null)));
assertFalse(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null).equals(
new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null)));
assertFalse(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()}).equals(
new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()})));
{
MediaLocator m = new MediaLocator("abc");
Format[] f = new Format[] {new RGBFormat()};
assertTrue(new CaptureDeviceInfo("xyz", m, f).equals(
new CaptureDeviceInfo("xyz", m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f1 = new Format[] {new RGBFormat()};
Format[] f2 = new Format[] {new RGBFormat()};
assertFalse(new CaptureDeviceInfo("xyz", m, f1).equals(
new CaptureDeviceInfo("xyz", m, f2)));
}
{
MediaLocator m = new MediaLocator("abc");
RGBFormat r = new RGBFormat();
Format[] f1 = new Format[] {r};
Format[] f2 = new Format[] {r};
assertFalse(new CaptureDeviceInfo("xyz", m, f1).equals(
new CaptureDeviceInfo("xyz", m, f2)));
}
{
MediaLocator m1 = new MediaLocator("abc");
MediaLocator m2 = new MediaLocator("abc");
Format[] f = new Format[] {new RGBFormat()};
assertFalse(new CaptureDeviceInfo("xyz", m1, f).equals(
new CaptureDeviceInfo("xyz", m2, f)));
}
{
MediaLocator m = null;
Format[] f = new Format[] {new RGBFormat()};
assertFalse(new CaptureDeviceInfo("xyz", m, f).equals(
new CaptureDeviceInfo("xyz", m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f = new Format[] {};
assertTrue(new CaptureDeviceInfo("xyz", m, f).equals(
new CaptureDeviceInfo("xyz", m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f = null;
assertFalse(new CaptureDeviceInfo("xyz", m, f).equals(
new CaptureDeviceInfo("xyz", m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f = new Format[] {new RGBFormat()};
assertFalse(new CaptureDeviceInfo(null, m, f).equals(
new CaptureDeviceInfo(null, m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f = new Format[] {new RGBFormat()};
assertTrue(new CaptureDeviceInfo("", m, f).equals(
new CaptureDeviceInfo("", m, f)));
}
{
MediaLocator m = new MediaLocator("abc");
Format[] f = new Format[] {new RGBFormat()};
assertFalse(new CaptureDeviceInfo("", m, f).equals(
"test"));
}
assertTrue(new CaptureDeviceInfo().getFormats() == null);
assertEquals(new CaptureDeviceInfo().toString(), "null : null\n");
if (false)
{
System.out.println(new CaptureDeviceInfo().toString()); // null : null
System.out.println(new CaptureDeviceInfo("xyz", null, null).toString()); // xyz : null
System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), null).toString()); // xyz : abc
System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {}).toString()); // xyz : abc
System.out.println(new CaptureDeviceInfo("xyz", new MediaLocator("abc"), new Format[] {new RGBFormat()}).toString());
// xyz : abc
//RGB, -1-bit, Masks=-1:-1:-1, PixelStride=-1, LineStride=-1
}
}