@Test
public void testGrammar() throws UnsupportedEncodingException {
for (File swiftFile : swiftFiles) {
ByteArrayOutputStream errContent = new ByteArrayOutputStream();
System.setErr(new PrintStream(errContent, false, Charset.defaultCharset().name()));
String[] command = { "--debug", (TEST_INPUT_DIR + swiftFile.getName()) };
Tailor.main(command);
assertThat(errContent.toString(Charset.defaultCharset().name()), IsEmptyString.isEmptyString());
System.setErr(null);
}
}
java类org.hamcrest.text.IsEmptyString的实例源码
GrammarTest.java 文件源码
项目:tailor
阅读 31
收藏 0
点赞 0
评论 0
CodeTests.java 文件源码
项目:JHawtCode
阅读 30
收藏 0
点赞 0
评论 0
@Test
public void runCodeSimple() throws Exception {
ResultActions actions = this.mockMvc.perform(post("/jhawtcode/dynacode").param("code", "jhc.println(true);").param("replacementCP", fullClassPath));
//actions.andDo(print());
actions.andExpect(status().isOk());
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
actions.andExpect(content().string(new IsEqualIgnoringWhiteSpace("true")));
}
CodeTests.java 文件源码
项目:JHawtCode
阅读 30
收藏 0
点赞 0
评论 0
@Test
public void runCodeSimpleWithImport() throws Exception {
ResultActions actions = this.mockMvc.perform(post("/jhawtcode/dynacode").param("code", "jhc.println(Math.pow(3,3));").param("replacementCP", fullClassPath).param("imports", "import java.lang.Math;"));
//actions.andDo(print());
actions.andExpect(status().isOk());
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
actions.andExpect(content().string(new IsEqualIgnoringWhiteSpace("27.0")));
}
CodeTests.java 文件源码
项目:JHawtCode
阅读 30
收藏 0
点赞 0
评论 0
@Test
public void runCodeSimpleWithImportAndMethod() throws Exception {
ResultActions actions = this.mockMvc.perform(post("/jhawtcode/dynacode").param("code", "jhc.println(Math.pow(3,addem(2,1)));").param("replacementCP", fullClassPath).param("imports", "import java.lang.Math;").param("methods", "public int addem(int a, int b) { return a+b; }"));
//actions.andDo(print());
actions.andExpect(status().isOk());
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
actions.andExpect(content().string(new IsEqualIgnoringWhiteSpace("27.0")));
}
CodeTests.java 文件源码
项目:JHawtCode
阅读 24
收藏 0
点赞 0
评论 0
@Test
public void runCodeSimpleWithImportAndMethodAndGlobal() throws Exception {
ResultActions actions = this.mockMvc.perform(post("/jhawtcode/dynacode").param("code", "jhc.println(Math.pow(3,addem(1,1)));").param("replacementCP", fullClassPath).param("imports", "import java.lang.Math;").param("methods", "public int addem(int a, int b) { return a+b+MYVAR; }").param("globals", "private int MYVAR=1;"));
//actions.andDo(print());
actions.andExpect(status().isOk());
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
actions.andExpect(content().string(new IsEqualIgnoringWhiteSpace("27.0")));
}
ConsoleTests.java 文件源码
项目:JHawtCode
阅读 29
收藏 0
点赞 0
评论 0
@Test
public void getCSS() throws Exception {
ResultActions actions = this.mockMvc.perform(get("/jhawtcode/jhc.css").accept(MediaType.TEXT_PLAIN));
//actions.andDo(print());
actions.andExpect(status().isOk());
// actions.andExpect(content().contentType(MediaType.TEXT_PLAIN));
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
}
ConsoleTests.java 文件源码
项目:JHawtCode
阅读 26
收藏 0
点赞 0
评论 0
@Test
public void getJS() throws Exception {
ResultActions actions = this.mockMvc.perform(get("/jhawtcode/jhc.js").accept(MediaType.ALL));
//actions.andDo(print());
actions.andExpect(status().isOk());
// actions.andExpect(content().contentType(MediaType.));
//not the best content test, but works for now until gzip deflate
actions.andExpect(content().string(new IsNot(new IsNull())));
actions.andExpect(content().string(new IsNot(new IsEmptyString())));
}
StringChecker.java 文件源码
项目:GitHub
阅读 30
收藏 0
点赞 0
评论 0
public void isEmpty() {
verifyUsingMatcher(IsEmptyString.isEmptyString());
}
StringChecker.java 文件源码
项目:GitHub
阅读 20
收藏 0
点赞 0
评论 0
public void isNonEmpty() {
verifyUsingMatcher(Matchers.not(IsEmptyString.isEmptyOrNullString()));
}
StringChecker.java 文件源码
项目:GitHub
阅读 27
收藏 0
点赞 0
评论 0
public void isNullOrEmpty() {
verifyUsingMatcher(IsEmptyString.isEmptyOrNullString());
}
StringChecker.java 文件源码
项目:GitHub
阅读 24
收藏 0
点赞 0
评论 0
public void notEmpty() {
verifyUsingMatcher(Matchers.not(IsEmptyString.isEmptyOrNullString()));
}
VersionTest.java 文件源码
项目:dungeon
阅读 35
收藏 0
点赞 0
评论 0
@Test
public void versionStringShouldNotBeEmpty() {
Assert.assertThat(Version.getCurrentVersion().toString(), new IsNot<>(new IsEmptyString()));
}
StringChecker.java 文件源码
项目:immutables
阅读 23
收藏 0
点赞 0
评论 0
public void isEmpty() {
verifyUsingMatcher(IsEmptyString.isEmptyString());
}
StringChecker.java 文件源码
项目:immutables
阅读 30
收藏 0
点赞 0
评论 0
public void isNonEmpty() {
verifyUsingMatcher(Matchers.not(IsEmptyString.isEmptyOrNullString()));
}
StringChecker.java 文件源码
项目:immutables
阅读 28
收藏 0
点赞 0
评论 0
public void isNullOrEmpty() {
verifyUsingMatcher(IsEmptyString.isEmptyOrNullString());
}
StringChecker.java 文件源码
项目:immutables
阅读 25
收藏 0
点赞 0
评论 0
public void notEmpty() {
verifyUsingMatcher(Matchers.not(IsEmptyString.isEmptyOrNullString()));
}