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

📄 splitcamelcaseidentifiertest.java

📁 A static analysis tool to find bugs in Java programs
💻 JAVA
字号:
package edu.umd.cs.findbugs.ml;import java.util.Collection;import junit.framework.Assert;import junit.framework.TestCase;public class SplitCamelCaseIdentifierTest extends TestCase {	SplitCamelCaseIdentifier splitter;	SplitCamelCaseIdentifier splitter2;	SplitCamelCaseIdentifier splitterLong;	SplitCamelCaseIdentifier allLower;	SplitCamelCaseIdentifier allUpper;	SplitCamelCaseIdentifier capitalized;	@Override	protected void setUp() throws Exception {		splitter = new SplitCamelCaseIdentifier("displayGUIWindow");		splitter2 = new SplitCamelCaseIdentifier("DisplayGUIWindow");		splitterLong = new SplitCamelCaseIdentifier("nowIsTheWINTEROfOURDiscontent");		allLower = new SplitCamelCaseIdentifier("foobar");		allUpper = new SplitCamelCaseIdentifier("NSA");		capitalized = new SplitCamelCaseIdentifier("Maryland");	}	public void testSplit() {		Collection<String> words = splitter.split();		checkContents(words, new String[]{"display","gui","window"});	}	public void testSplit2() {		Collection<String> words = splitter2.split();		checkContents(words, new String[]{"display","gui","window"});	}	public void testSplitLong() {		Collection<String> words = splitterLong.split();		checkContents(words, new String[]{"now","is","the","winter","of","our","discontent"});	}	public void testAllLower() {		Collection<String> words = allLower.split();		checkContents(words, new String[]{"foobar"});	}	public void testAllUpper() {		Collection<String> words = allUpper.split();		checkContents(words, new String[]{"nsa"});	}	public void testCapitalized() {		Collection<String> words = capitalized.split();		checkContents(words, new String[]{"maryland"});	}	private void checkContents(Collection<String> words, String[] expected) {		Assert.assertEquals( expected.length, words.size());		for (String anExpected : expected) {			Assert.assertTrue(words.contains(anExpected));		}	}}

⌨️ 快捷键说明

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