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

📄 nonnullparampropertytest.java

📁 A static analysis tool to find bugs in Java programs
💻 JAVA
字号:
package edu.umd.cs.findbugs.ba.npe;import junit.framework.Assert;import junit.framework.TestCase;public class NonNullParamPropertyTest extends TestCase {	ParameterNullnessProperty empty;	ParameterNullnessProperty nonEmpty;	ParameterNullnessProperty extremes;	@Override		 protected void setUp() throws Exception {		empty = new ParameterNullnessProperty();		nonEmpty = new ParameterNullnessProperty();		nonEmpty.setNonNull(11, true);		nonEmpty.setNonNull(25, true);		extremes = new ParameterNullnessProperty();		extremes.setNonNull(0, true);		extremes.setNonNull(31, true);	}	public void testEmpty() {		for (int i = 0; i < 32; ++i) {			Assert.assertFalse(empty.isNonNull(i));		}	}	public void testIsEmpty() {		Assert.assertTrue(empty.isEmpty());		Assert.assertFalse(nonEmpty.isEmpty());		Assert.assertFalse(extremes.isEmpty());	}	public void testNonEmpty() {		Assert.assertTrue(nonEmpty.isNonNull(11));		Assert.assertTrue(nonEmpty.isNonNull(25));		Assert.assertFalse(nonEmpty.isNonNull(5));	}	public void testExtremes() {		Assert.assertTrue(extremes.isNonNull(0));		Assert.assertTrue(extremes.isNonNull(31));		Assert.assertFalse(extremes.isNonNull(10));	}	public void testOutOfBounds() {		Assert.assertFalse(nonEmpty.isNonNull(-1));		Assert.assertFalse(nonEmpty.isNonNull(32));	}}

⌨️ 快捷键说明

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