Skip to content

Commit

Permalink
Tests passing, need to add command line
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeust committed Aug 22, 2010
1 parent fc77faa commit b7a8c39
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom-test.xml
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.13.1</version>
<version>5.13.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/testng/TestNG.java
Expand Up @@ -941,6 +941,7 @@ public List<ISuite> runSuitesLocally() {
suiteRunnerWorkers.add(srw);
}

// ThreadUtil.execute(suiteRunnerWorkers, 1, Integer.MAX_VALUE, true /* start now */);
for (Runnable r : suiteRunnerWorkers) {
r.run();
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/testng/reporters/XMLReporter.java
Expand Up @@ -139,10 +139,12 @@ private Properties getSuiteAttributes(ISuite suite) {
minStartDate = startDate;
}
if (maxEndDate == null || maxEndDate.before(endDate)) {
maxEndDate = endDate;
maxEndDate = endDate != null ? endDate : startDate;
}
}

// The suite could be completely empty
if (maxEndDate == null) maxEndDate = minStartDate;
addDurationAttributes(config, props, minStartDate, maxEndDate);
return props;
}
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/test/thread/BaseThreadTest.java
Expand Up @@ -9,17 +9,18 @@
public class BaseThreadTest extends SimpleBaseTest {
static private Set<Long> m_threadIds;

protected void initThreadLog() {
static void initThreadLog() {
m_threadIds = Sets.newHashSet();
}

protected void logThread(long threadId) {
synchronized(m_threadIds) {
log("BaseThreadTest", "Logging thread:" + threadId);
m_threadIds.add(threadId);
}
}

public static int getThreadCount() {
static int getThreadCount() {
synchronized(m_threadIds) {
return m_threadIds.size();
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/suite1-1.xml
Expand Up @@ -2,7 +2,10 @@

<test name="Suite 1-1 Tests">
<classes>
<!--
<class name="foo.bar.NonExistentClass"/>
-->
<class name="test.sample.Sample1"/>
</classes>
</test>
</suite>
2 changes: 1 addition & 1 deletion src/test/resources/testng-single.xml
Expand Up @@ -26,7 +26,7 @@
</groups>
<parameter name="count" value="10"/>
<classes>
<class name="test.preserveorder.PreserveOrderTest"/>
<class name="test.thread.ParallelSuiteTest"/>
<!--
<class name="test.preserveorder.SibTest"/>
<class name="test.preserveorder.EdnTest"/>
Expand Down
5 changes: 4 additions & 1 deletion src/test/resources/testng.xml
Expand Up @@ -80,7 +80,10 @@
<class name="test.thread.FactoryTest" />
<class name="test.thread.DataProviderThreadPoolSizeTest" />
<class name="test.thread.MultiThreadedDependentTest" />
<class name="test.simple.IncludedExcludedTest" />
<!--
<class name="test.thread.ParallelSuiteTest"/>
-->
<class name="test.simple.IncludedExcludedTest" />
<class name="test.reports.ReportTest" />
<class name="test.annotationtransformer.AnnotationTransformerTest" />
<class name="test.jar.JarTest" />
Expand Down

0 comments on commit b7a8c39

Please sign in to comment.