Skip to content

Commit

Permalink
usability changes, code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Grove committed Dec 6, 2014
1 parent 4eadd1f commit 87a3057
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -7,7 +7,7 @@
<groupId>org.jperf</groupId>
<artifactId>jperf</artifactId>
<name>jperf</name>
<version>2.0.2</version>
<version>2.0.3-SNAPSHOT</version>
<packaging>jar</packaging>

<licenses>
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/jperf/AbstractPerfTest.java
@@ -0,0 +1,13 @@
package org.jperf;

public abstract class AbstractPerfTest implements PerfTest {

@Override
public void setUp() throws Exception {
}

@Override
public void tearDown() throws Exception {
}

}
4 changes: 4 additions & 0 deletions src/main/java/org/jperf/ConfigBuilder.java
Expand Up @@ -7,5 +7,9 @@ public interface ConfigBuilder {
ConfigBuilder duration(int duration);
ConfigBuilder testFactory(PerfTestFactory testFactory);
ConfigBuilder resultWriter(ResultWriter resultWriter);
void run() throws Exception;

@Deprecated
PerfTestConfig build();

}
14 changes: 10 additions & 4 deletions src/main/java/org/jperf/DefaultConfigBuilder.java
Expand Up @@ -14,13 +14,13 @@ public DefaultConfigBuilder() {
}

@Override
public DefaultConfigBuilder minThreads(int minThreads) {
public ConfigBuilder minThreads(int minThreads) {
config.minThreads = minThreads;
return this;
}

@Override
public DefaultConfigBuilder maxThreads(int maxThreads) {
public ConfigBuilder maxThreads(int maxThreads) {
config.maxThreads = maxThreads;
return this;
}
Expand All @@ -32,13 +32,13 @@ public ConfigBuilder threadIncrement(int threadIncrement) {
}

@Override
public DefaultConfigBuilder duration(int duration) {
public ConfigBuilder duration(int duration) {
config.duration = duration;
return this;
}

@Override
public DefaultConfigBuilder testFactory(PerfTestFactory testFactory) {
public ConfigBuilder testFactory(PerfTestFactory testFactory) {
config.testFactory = testFactory;
return this;
}
Expand All @@ -49,8 +49,14 @@ public ConfigBuilder resultWriter(ResultWriter resultWriter) {
return this;
}

@Deprecated // use run() instead
@Override
public PerfTestConfig build() {
return config;
}

@Override
public void run() throws Exception {
JPerf.run(config);
}
}

0 comments on commit 87a3057

Please sign in to comment.