Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JUnit test framework for OpenEMS Backend (#1884)
Move AbstractComponentConfig from `io.openems.edge.common` to `io.openems.common`. This is the first step to use the existing JUnit test framework also for OpenEMS Backend.
- Loading branch information
1 parent
19c4e40
commit 2d6bd15
Showing
117 changed files
with
237 additions
and
112 deletions.
There are no files selected for viewing
117 changes: 117 additions & 0 deletions
117
...s.backend.timedata.timescaledb/test/io/openems/backend/timedata/timescaledb/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
package io.openems.backend.timedata.timescaledb; | ||
|
||
import io.openems.common.test.AbstractComponentConfig; | ||
|
||
@SuppressWarnings("all") | ||
public class MyConfig extends AbstractComponentConfig implements Config { | ||
|
||
protected static class Builder { | ||
private String id = null; | ||
public String host; | ||
public int port; | ||
public String user; | ||
public String password; | ||
public String database; | ||
public boolean isReadOnly; | ||
public WriteConfig betaWriteConfig; | ||
|
||
private Builder() { | ||
} | ||
|
||
public Builder setId(String id) { | ||
this.id = id; | ||
return this; | ||
} | ||
|
||
public Builder setHost(String host) { | ||
this.host = host; | ||
return this; | ||
} | ||
|
||
public Builder setPort(int port) { | ||
this.port = port; | ||
return this; | ||
} | ||
|
||
public Builder setUser(String user) { | ||
this.user = user; | ||
return this; | ||
} | ||
|
||
public Builder setPassword(String password) { | ||
this.password = password; | ||
return this; | ||
} | ||
|
||
public Builder setDatabase(String database) { | ||
this.database = database; | ||
return this; | ||
} | ||
|
||
public Builder setReadOnly(boolean isReadOnly) { | ||
this.isReadOnly = isReadOnly; | ||
return this; | ||
} | ||
|
||
public Builder setBetaWriteConfig(WriteConfig betaWriteConfig) { | ||
this.betaWriteConfig = betaWriteConfig; | ||
return this; | ||
} | ||
|
||
public MyConfig build() { | ||
return new MyConfig(this); | ||
} | ||
} | ||
|
||
/** | ||
* Create a Config builder. | ||
* | ||
* @return a {@link Builder} | ||
*/ | ||
public static Builder create() { | ||
return new Builder(); | ||
} | ||
|
||
private final Builder builder; | ||
|
||
private MyConfig(Builder builder) { | ||
super(Config.class, builder.id); | ||
this.builder = builder; | ||
} | ||
|
||
@Override | ||
public String host() { | ||
return this.builder.host; | ||
} | ||
|
||
@Override | ||
public int port() { | ||
return this.builder.port; | ||
} | ||
|
||
@Override | ||
public String user() { | ||
return this.builder.user; | ||
} | ||
|
||
@Override | ||
public String password() { | ||
return this.builder.password; | ||
} | ||
|
||
@Override | ||
public String database() { | ||
return this.builder.database; | ||
} | ||
|
||
@Override | ||
public boolean isReadOnly() { | ||
return this.builder.isReadOnly; | ||
} | ||
|
||
@Override | ||
public WriteConfig betaWriteConfig() { | ||
return this.builder.betaWriteConfig; | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../common/test/AbstractComponentConfig.java → .../common/test/AbstractComponentConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
io.openems.common/src/io/openems/common/test/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@org.osgi.annotation.versioning.Version("1.0.0") | ||
@org.osgi.annotation.bundle.Export | ||
package io.openems.common.test; |
2 changes: 1 addition & 1 deletion
2
io.openems.edge.battery.bmw/test/io/openems/edge/battery/bmw/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...enems.edge.battery.bydcommercial/test/io/openems/edge/battery/bydcommercial/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....battery.fenecon.commercial/test/io/openems/edge/battery/fenecon/commercial/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.battery.fenecon.home/test/io/openems/edge/battery/fenecon/home/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....edge.battery.soltaro/test/io/openems/edge/battery/soltaro/cluster/versionb/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
....edge.battery.soltaro/test/io/openems/edge/battery/soltaro/cluster/versionc/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s.edge.battery.soltaro/test/io/openems/edge/battery/soltaro/single/versiona/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s.edge.battery.soltaro/test/io/openems/edge/battery/soltaro/single/versionb/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s.edge.battery.soltaro/test/io/openems/edge/battery/soltaro/single/versionc/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...planetgridsave/test/io/openems/edge/batteryinverter/kaco/blueplanetgridsave/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s.edge.batteryinverter.refu88k/test/io/openems/edge/batteryinverter/refu88k/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...edge.batteryinverter.sinexcel/test/io/openems/edge/batteryinverter/sinexcel/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bosch.bpts5hybrid/test/io/openems/edge/bosch/bpts5hybrid/core/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bosch.bpts5hybrid/test/io/openems/edge/bosch/bpts5hybrid/ess/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bosch.bpts5hybrid/test/io/openems/edge/bosch/bpts5hybrid/meter/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bosch.bpts5hybrid/test/io/openems/edge/bosch/bpts5hybrid/pv/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bridge.modbus/test/io/openems/edge/bridge/modbus/MyConfigSerial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.bridge.modbus/test/io/openems/edge/bridge/modbus/MyConfigTcp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.controller.api.mqtt/test/io/openems/edge/controller/api/mqtt/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...edge.controller.api.rest/test/io/openems/edge/controller/api/rest/readwrite/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ymmetric.peakshaving/test/io/openems/edge/controller/asymmetric/peakshaving/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.controller.chp.soc/test/io/openems/edge/controller/chp/soc/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
io.openems.edge.controller.debug.log/test/io/openems/edge/controller/debuglog/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ristic/test/io/openems/edge/controller/ess/activepowervoltagecharacteristic/MyConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.