checkstyle Misc Rules

checkstyle Nesting

checkstyle GenericWhitespace

checkstyle MethodParamPad

checkstyle NoWhiteSpace

checkstyle ParenPad Script

checkstyle ParenPad
This commit is contained in:
Gary Russell
2016-04-05 14:58:29 -04:00
committed by Artem Bilan
parent 05cc7be644
commit 57f96bb759
87 changed files with 737 additions and 628 deletions

View File

@@ -43,8 +43,8 @@ public class DeriveLanguageFromExtensionTests {
@Test
public void testParseLanguage() {
String langs[] = { "ruby", "Groovy", "ECMAScript", "python" };
Class<?> executors[] = {
String[] langs = { "ruby", "Groovy", "ECMAScript", "python" };
Class<?>[] executors = {
RubyScriptExecutor.class,
DefaultScriptExecutor.class,
DefaultScriptExecutor.class,
@@ -71,7 +71,8 @@ public class DeriveLanguageFromExtensionTests {
@Test
public void testBadExtension() {
try {
new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail1-context.xml", this.getClass());
new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail1-context.xml", this.getClass())
.close();
}
catch (Exception e) {
assertTrue(e.getMessage().contains("No suitable scripting engine found for extension 'xx'"));
@@ -81,7 +82,8 @@ public class DeriveLanguageFromExtensionTests {
@Test
public void testNoExtension() {
try {
new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail2-context.xml", this.getClass());
new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail2-context.xml", this.getClass())
.close();
}
catch (Exception e) {
assertTrue(e.getMessage().contains("Unable to determine language for script 'foo'"));

View File

@@ -46,23 +46,23 @@ public class PythonScriptExecutorTests {
@Test
public void testLiteral() {
Object obj = executor.executeScript(new StaticScriptSource("3+4") );
Object obj = executor.executeScript(new StaticScriptSource("3+4"));
assertEquals(7, obj);
obj = executor.executeScript(new StaticScriptSource("'hello,world'") );
obj = executor.executeScript(new StaticScriptSource("'hello,world'"));
assertEquals("hello,world", obj);
}
@Test
public void test1() {
Object obj = executor.executeScript(new StaticScriptSource("x=2") );
Object obj = executor.executeScript(new StaticScriptSource("x=2"));
assertEquals(2, obj);
}
@Test
public void test2() {
Object obj = executor.executeScript(new StaticScriptSource("def foo(y):\n\tx=y\n\treturn y\nz=foo(2)") );
Object obj = executor.executeScript(new StaticScriptSource("def foo(y):\n\tx=y\n\treturn y\nz=foo(2)"));
assertEquals(2, obj);
}