⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 processormodeltest.java

📁 FMJ(freedom media for java)是java视频开发的新选择
💻 JAVA
字号:
package net.sf.fmj.test.compat.misc;import javax.media.Format;import javax.media.ProcessorModel;import javax.media.protocol.ContentDescriptor;import junit.framework.TestCase;/** * Unit test for ProcessorModel. * @author Ken Larson * */public class ProcessorModelTest extends TestCase{	public void testProcessorModel()	{		{			final ProcessorModel p = new ProcessorModel();			for (int i = 0; i < 4; ++i)				assertEquals(p.getTrackCount(i), -1);						assertEquals(p.getOutputTrackFormat(0), null);			assertEquals(p.getInputLocator(), null);			assertTrue(p.isFormatAcceptable(0, new Format("xyz")));		}				{						final ProcessorModel p = new ProcessorModel(					new Format[] {						new Format("abc"),						new Format("xyz")					},					new ContentDescriptor("abc"));			for (int i = 0; i < 4; ++i)				assertEquals(p.getTrackCount(i), 2);						assertTrue(p.getOutputTrackFormat(0).equals(new Format("abc")));			assertTrue(p.getOutputTrackFormat(1).equals(new Format("xyz")));			assertEquals(p.getOutputTrackFormat(2), null);			assertTrue(p.isFormatAcceptable(0, new Format("abc")));			assertTrue(p.isFormatAcceptable(0, new Format(null)));			assertFalse(p.isFormatAcceptable(0, new Format("xyz")));			assertTrue(p.isFormatAcceptable(2, new Format(null)));			try			{				p.isFormatAcceptable(0, null);				assertTrue(false);			}			catch (NullPointerException e)			{			}			final StringBuffer b = new StringBuffer();			assertTrue(p.isFormatAcceptable(0, new Format("abc"){				//@Override				public boolean matches(Format arg0)				{					b.append("matches called");					return super.matches(arg0);				}}));						assertEquals(b.toString(), "matches called");		}			}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -