-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a Grid_Meter Test - 73092e3
- Loading branch information
1 parent
03a3cf5
commit 86a5442
Showing
3 changed files
with
28 additions
and
22 deletions.
There are no files selected for viewing
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
22 changes: 20 additions & 2 deletions
22
....edge.batteryinverter.deye/test/io/openems/edge/deye/gridmeter/DeyeGridMeterImplTest.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 |
---|---|---|
@@ -1,7 +1,25 @@ | ||
package io.openems.edge.deye.gridmeter; | ||
|
||
import junit.framework.TestCase; | ||
import org.junit.Test; | ||
|
||
public class DeyeGridMeterImplTest extends TestCase { | ||
import io.openems.edge.bridge.modbus.test.DummyModbusBridge; | ||
import io.openems.edge.common.test.ComponentTest; | ||
import io.openems.edge.common.test.DummyConfigurationAdmin; | ||
|
||
public class DeyeGridMeterImplTest { | ||
|
||
private static final String METER_ID = "meter0"; | ||
private static final String MODBUS_ID = "modbus0"; | ||
|
||
@Test | ||
public void test() throws Exception { | ||
new ComponentTest(new DeyeGridMeterImpl()) // | ||
.addReference("cm", new DummyConfigurationAdmin()) // | ||
.addReference("setModbus", new DummyModbusBridge(MODBUS_ID)) // | ||
.activate(MyConfig.create() // | ||
.setId(METER_ID) // | ||
.setModbusId(MODBUS_ID) // | ||
.build()) // | ||
; | ||
} | ||
} |
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