Search in sources :

Example 1 with CentralSystemService

use of ocpp.cs._2015._10.CentralSystemService in project EVSUPERVISION by EnergyTIC.

the class ApplicationTest method testOcpp15.

@Test
public void testOcpp15() {
    CentralSystemService client = getForOcpp15(path);
    ocpp.cs._2012._06.BootNotificationResponse boot = client.bootNotification(new ocpp.cs._2012._06.BootNotificationRequest().withChargePointVendor(getRandomString()).withChargePointModel(getRandomString()), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(boot);
    Assertions.assertEquals(ocpp.cs._2012._06.RegistrationStatus.ACCEPTED, boot.getStatus());
    ocpp.cs._2012._06.AuthorizeResponse auth = client.authorize(new ocpp.cs._2012._06.AuthorizeRequest().withIdTag(REGISTERED_OCPP_TAG), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(auth);
    Assertions.assertEquals(ocpp.cs._2012._06.AuthorizationStatus.ACCEPTED, auth.getIdTagInfo().getStatus());
}
Also used : AuthorizeRequest(ocpp.cs._2010._08.AuthorizeRequest) CentralSystemService(ocpp.cs._2012._06.CentralSystemService) Test(org.junit.jupiter.api.Test)

Example 2 with CentralSystemService

use of ocpp.cs._2015._10.CentralSystemService in project EVSUPERVISION by EnergyTIC.

the class ApplicationTest method testOcpp12.

@Test
public void testOcpp12() {
    ocpp.cs._2010._08.CentralSystemService client = getForOcpp12(path);
    BootNotificationResponse boot = client.bootNotification(new BootNotificationRequest().withChargePointVendor(getRandomString()).withChargePointModel(getRandomString()), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(boot);
    Assertions.assertEquals(RegistrationStatus.ACCEPTED, boot.getStatus());
    AuthorizeResponse auth = client.authorize(new AuthorizeRequest().withIdTag(REGISTERED_OCPP_TAG), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(auth);
    Assertions.assertEquals(AuthorizationStatus.ACCEPTED, auth.getIdTagInfo().getStatus());
}
Also used : BootNotificationResponse(ocpp.cs._2010._08.BootNotificationResponse) AuthorizeResponse(ocpp.cs._2010._08.AuthorizeResponse) AuthorizeRequest(ocpp.cs._2010._08.AuthorizeRequest) BootNotificationRequest(ocpp.cs._2010._08.BootNotificationRequest) Test(org.junit.jupiter.api.Test)

Example 3 with CentralSystemService

use of ocpp.cs._2015._10.CentralSystemService in project EVSUPERVISION by EnergyTIC.

the class OperationalTestSoapOCPP16 method testRegisteredIdTag.

@Test
public void testRegisteredIdTag() {
    CentralSystemService client = getForOcpp16(path);
    AuthorizeResponse auth = client.authorize(new AuthorizeRequest().withIdTag(REGISTERED_OCPP_TAG), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(auth);
    Assertions.assertEquals(AuthorizationStatus.ACCEPTED, auth.getIdTagInfo().getStatus());
}
Also used : AuthorizeResponse(ocpp.cs._2015._10.AuthorizeResponse) AuthorizeRequest(ocpp.cs._2015._10.AuthorizeRequest) CentralSystemService(ocpp.cs._2015._10.CentralSystemService) Test(org.junit.jupiter.api.Test)

Example 4 with CentralSystemService

use of ocpp.cs._2015._10.CentralSystemService in project EVSUPERVISION by EnergyTIC.

the class OperationalTestSoapOCPP16 method testInTransactionStatusOfIdTag.

@Test
public void testInTransactionStatusOfIdTag() {
    CentralSystemService client = getForOcpp16(path);
    StartTransactionResponse start = client.startTransaction(new StartTransactionRequest().withConnectorId(2).withIdTag(REGISTERED_OCPP_TAG).withTimestamp(DateTime.now()).withMeterStart(0), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(start);
    Assertions.assertTrue(start.getTransactionId() > 0);
    Assertions.assertTrue(__DatabasePreparer__.getOcppTagRecord(REGISTERED_OCPP_TAG).getInTransaction());
    StopTransactionResponse stop = client.stopTransaction(new StopTransactionRequest().withTransactionId(start.getTransactionId()).withTimestamp(DateTime.now()).withIdTag(REGISTERED_OCPP_TAG).withMeterStop(30), REGISTERED_CHARGE_BOX_ID);
    Assertions.assertNotNull(stop);
    Assertions.assertFalse(__DatabasePreparer__.getOcppTagRecord(REGISTERED_OCPP_TAG).getInTransaction());
}
Also used : StopTransactionRequest(ocpp.cs._2015._10.StopTransactionRequest) StartTransactionRequest(ocpp.cs._2015._10.StartTransactionRequest) StopTransactionResponse(ocpp.cs._2015._10.StopTransactionResponse) CentralSystemService(ocpp.cs._2015._10.CentralSystemService) StartTransactionResponse(ocpp.cs._2015._10.StartTransactionResponse) Test(org.junit.jupiter.api.Test)

Example 5 with CentralSystemService

use of ocpp.cs._2015._10.CentralSystemService in project EVSUPERVISION by EnergyTIC.

the class OperationalTestSoapOCPP16 method testUnregisteredCP.

@Test
public void testUnregisteredCP() {
    Assertions.assertFalse(SteveConfiguration.CONFIG.getOcpp().isAutoRegisterUnknownStations());
    CentralSystemService client = getForOcpp16(path);
    BootNotificationResponse boot = client.bootNotification(new BootNotificationRequest().withChargePointVendor(getRandomString()).withChargePointModel(getRandomString()), getRandomString());
    Assertions.assertNotNull(boot);
    Assertions.assertNotEquals(RegistrationStatus.ACCEPTED, boot.getStatus());
}
Also used : BootNotificationResponse(ocpp.cs._2015._10.BootNotificationResponse) CentralSystemService(ocpp.cs._2015._10.CentralSystemService) BootNotificationRequest(ocpp.cs._2015._10.BootNotificationRequest) Test(org.junit.jupiter.api.Test)

Aggregations

CentralSystemService (ocpp.cs._2015._10.CentralSystemService)22 Test (org.junit.jupiter.api.Test)20 StartTransactionRequest (ocpp.cs._2015._10.StartTransactionRequest)16 StartTransactionResponse (ocpp.cs._2015._10.StartTransactionResponse)16 BootNotificationRequest (ocpp.cs._2015._10.BootNotificationRequest)14 BootNotificationResponse (ocpp.cs._2015._10.BootNotificationResponse)14 AuthorizeRequest (ocpp.cs._2015._10.AuthorizeRequest)12 ChargePoint (de.rwth.idsg.steve.repository.dto.ChargePoint)10 Helpers.getRandomString (de.rwth.idsg.steve.utils.Helpers.getRandomString)10 AuthorizeResponse (ocpp.cs._2015._10.AuthorizeResponse)10 StressTester (de.rwth.idsg.steve.utils.StressTester)8 MeterValuesRequest (ocpp.cs._2015._10.MeterValuesRequest)8 MeterValuesResponse (ocpp.cs._2015._10.MeterValuesResponse)8 StatusNotificationRequest (ocpp.cs._2015._10.StatusNotificationRequest)8 StatusNotificationResponse (ocpp.cs._2015._10.StatusNotificationResponse)8 StopTransactionRequest (ocpp.cs._2015._10.StopTransactionRequest)8 StopTransactionResponse (ocpp.cs._2015._10.StopTransactionResponse)8 DateTime (org.joda.time.DateTime)6 CentralSystemService (ocpp.cs._2012._06.CentralSystemService)5 List (java.util.List)4