Skip to content

Commit

Permalink
Add Checkstyle check to prohibit IntelliJ-style commented code lines (a…
Browse files Browse the repository at this point in the history
…pache#4220)

* Add Checkstyle check to prohibit IntelliJ-style commented code lines

* Address comment

* Restore issue link
  • Loading branch information
leventov authored and fjy committed Apr 28, 2017
1 parent 631068b commit b9fd30e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 32 deletions.
5 changes: 5 additions & 0 deletions codestyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@
<property name="format" value="com\.google\.common\.io\.Closer"/>
<property name="illegalPattern" value="true"/>
</module>
<module name="Regexp">
<!-- Prohibit IntelliJ-style commented code lines from being committed -->
<property name="format" value="^// {2}"/>
<property name="illegalPattern" value="true"/>
</module>
</module>
</module>
11 changes: 0 additions & 11 deletions integration-tests/src/main/java/org/testng/TestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ public void initializeSuitesAndJarFile()
while (t.getCause() != null) {
t = t.getCause();
}
// t.printStackTrace();
if (t instanceof TestNGException) {
throw (TestNGException) t;
} else {
Expand Down Expand Up @@ -421,7 +420,6 @@ public void initializeSuitesAndJarFile()
Utils.log("TestNG", 2, "Trying to open jar file:" + jarFile);

JarFile jf = new JarFile(jarFile);
// System.out.println(" result: " + jf);
Enumeration<JarEntry> entries = jf.entries();
List<String> classes = Lists.newArrayList();
boolean foundTestngXml = false;
Expand Down Expand Up @@ -1055,10 +1053,6 @@ private void addServiceLoaderListeners()
}
Iterable<ITestNGListener> loader =
(Iterable<ITestNGListener>) loadMethod.invoke(c, parameters.toArray());
// Object loader = c.
// ServiceLoader<ITestNGListener> loader = m_serviceLoaderClassLoader != null
// ? ServiceLoader.load(ITestNGListener.class, m_serviceLoaderClassLoader)
// : ServiceLoader.load(ITestNGListener.class);
for (ITestNGListener l : loader) {
Utils.log("[TestNG]", 2, "Adding ServiceLoader listener:" + l);
addListener(l);
Expand Down Expand Up @@ -1552,11 +1546,6 @@ protected void configure(CommandLineArgs cla)
setTestNames(Arrays.asList(cla.testNames.split(",")));
}

// List<String> testNgXml = (List<String>) cmdLineArgs.get(CommandLineArgs.SUITE_DEF);
// if (null != testNgXml) {
// setTestSuites(testNgXml);
// }

// Note: can't use a Boolean field here because we are allowing a boolean
// parameter with an arity of 1 ("-usedefaultlisteners false")
if (cla.useDefaultListeners != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public static void main(String[] args) throws ParameterException
m_debug = cla.debug;
m_ack = ra.ack;
if (m_debug) {
// while (true) {
initAndRun(args, cla, ra);
// }
} else {
initAndRun(args, cla, ra);
}
Expand Down Expand Up @@ -128,22 +126,9 @@ private static void initAndRun(String[] args, CommandLineArgs cla, RemoteArgs ra
sb.append(s).append(" ");
}
p(sb.toString());
// remoteTestNg.setVerbose(1);
// } else {
// remoteTestNg.setVerbose(0);
}
validateCommandLineParameters(cla);
remoteTestNg.run();
// if (m_debug) {
// // Run in a loop if in debug mode so it is possible to run several launches
// // without having to relauch RemoteTestNG.
// while (true) {
// remoteTestNg.run();
// remoteTestNg.configure(cla);
// }
// } else {
// remoteTestNg.run();
// }
}

private static void p(String s)
Expand All @@ -168,7 +153,6 @@ private void calculateAllSuites(List<XmlSuite> suites, List<XmlSuite> outSuites)
{
for (XmlSuite s : suites) {
outSuites.add(s);
// calculateAllSuites(s.getChildSuites(), outSuites);
}
}

Expand All @@ -189,8 +173,6 @@ public void run()

List<XmlSuite> suites = Lists.newArrayList();
calculateAllSuites(m_suites, suites);
// System.out.println("Suites: " + m_suites.get(0).getChildSuites().size()
// + " and:" + suites.get(0).getChildSuites().size());
if (suites.size() > 0) {

int testCount = 0;
Expand All @@ -207,7 +189,6 @@ public void run()
addListener(new RemoteSuiteListener(msh));
setTestRunnerFactory(new DelegatingTestRunnerFactory(buildTestRunnerFactory(), msh));

// System.out.println("RemoteTestNG starting");
super.run();
} else {
System.err.println("No test suite found. Nothing to run");
Expand All @@ -217,7 +198,6 @@ public void run()
cause.printStackTrace(System.err);
}
finally {
// System.out.println("RemoteTestNG finishing: " + (getEnd() - getStart()) + " ms");
msh.shutDown();
if (!m_debug && !m_dontExit) {
System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public DefaultObjectMapper(JsonFactory factory)

configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
configure(MapperFeature.AUTO_DETECT_GETTERS, false);
// configure(MapperFeature.AUTO_DETECT_CREATORS, false); https://github.com/FasterXML/jackson-databind/issues/170
// See https://github.com/FasterXML/jackson-databind/issues/170
// configure(MapperFeature.AUTO_DETECT_CREATORS, false);
configure(MapperFeature.AUTO_DETECT_FIELDS, false);
configure(MapperFeature.AUTO_DETECT_IS_GETTERS, false);
configure(MapperFeature.AUTO_DETECT_SETTERS, false);
Expand Down

0 comments on commit b9fd30e

Please sign in to comment.