Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5 cleanup spec added to json tests #55

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ecc8a67
Implementation fixed accroding to comments from Thomas Volden:
Apr 17, 2018
1fd0d3d
Javadoc added for WSS related methods and classes
Apr 17, 2018
e1f0a48
@Overide annotations fixed
Apr 17, 2018
dbd7ad7
Merge branch '0.5_cleanup'
Apr 17, 2018
bc8437c
Merge remote-tracking branch 'upstream/master'
Apr 17, 2018
ef0dcf1
Merge branch '0.5_test_coverage_for_utilities'
eupakhomov Apr 17, 2018
26fe7b2
Cleanup spec added to JSON tests
eupakhomov Apr 17, 2018
60209c5
WebSocketListener: refactored to provide more reliable shutdown
Apr 18, 2018
971bff7
Merge remote-tracking branch 'upstream/master' into 0.5_cleanup_spec_…
Apr 18, 2018
74d16e5
Timeout for server shutdown increased (so far just to test if it will…
Apr 18, 2018
70a392a
Base test class made abstract
Apr 18, 2018
5edd89e
Port for test server changed to check travis server for hanging conne…
Apr 18, 2018
eb54edc
Ports for JSON integration tests changed for both server and client
Apr 18, 2018
d711dba
Ports are reverted back
Apr 18, 2018
05d3d38
To debug if server socket doesn't close at all or it's just slow
eupakhomov Apr 18, 2018
5e78a9e
Same but waiting before starting test
eupakhomov Apr 18, 2018
bd3e619
Thread pause placed correctly for debugging purposes
eupakhomov Apr 18, 2018
5f36176
Pause before connecting from client side
eupakhomov Apr 18, 2018
ea4e527
Try to revert usage of TIME_WAIT connections
eupakhomov Apr 18, 2018
864d3ad
JSONConfiguration added to API to be able to provide custom set of fe…
eupakhomov Apr 19, 2018
2553100
JSONConfiguration added to API to be able to provide custom set of fe…
eupakhomov Apr 19, 2018
bd1a018
SOAP integration tests are refactored
eupakhomov Apr 21, 2018
4ece94f
`reuseAddr` flag set by default to `true` for the server
eupakhomov Apr 21, 2018
6790105
Master merged
eupakhomov Apr 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONAuthorizeSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends Authorize request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONBootNotificationSpec extends Specification
def cleanup() {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends Boot Notification and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class JSONChangeAvailabilitySpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a ChangeAvailability request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONChangeConfigurationSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a ChangeConfiguration request and receives a response"() {
def conditions = new PollingConditions(timeout: 10)
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONClearCacheSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a ClearCache request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONDataTransferSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a DataTransfer request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONGetConfigurationSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a GetConfiguration request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONHeartbeatSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends Heartbeat and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONMeterValuesSpec extends Specification
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends MeterValues request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONRemoteStartTransactionSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a RemoteStartTransaction request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONRemoteStopTransactionSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a RemoteStopTransaction request and receives a response"() {
def conditions = new PollingConditions(timeout: 10)
given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class JSONResetSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a Reset request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONStartTransactionSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends StartTransaction request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONStatusNotificationSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends StatusNotification request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONStopTransactionSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Charge point sends StopTransaction request and receives a response"() {
def conditions = new PollingConditions(timeout: 1)
when:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class JSONUnlockConnectorSpec extends Specification {
chargePoint.disconnect()
}

def cleanupSpec() {
centralSystem.stopped()
}

def "Central System sends a UnlockConnector request and receives a response"() {
def conditions = new PollingConditions(timeout: 10)
given:
Expand Down
5 changes: 5 additions & 0 deletions ocpp-v1_6/src/main/java/eu/chargetime/ocpp/JSONClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ public JSONClient enableWSS(WssSocketBuilder wssSocketBuilder) {
return this;
}

/**
* Set WebSocket ping interval.
*
* @param interval ping interval in seconds.
*/
public void setPingInterval(int interval) {
// Set ping interval in seconds
transmitter.setPingInterval(interval);
Expand Down
7 changes: 7 additions & 0 deletions ocpp-v1_6/src/main/java/eu/chargetime/ocpp/JSONServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ of this software and associated documentation files (the "Software"), to deal
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.net.ssl.SSLContext;
import java.io.IOException;
import java.util.Collections;
import javax.net.ssl.SSLContext;
import java.io.IOException;
Expand Down Expand Up @@ -102,6 +104,11 @@ public JSONServer enableWSS(WssFactoryBuilder wssFactoryBuilder) {
return this;
}

/**
* Set WebSocket ping interval.
*
* @param interval ping interval in seconds.
*/
public void setPingInterval(int interval) {
// Set ping interval in seconds
listener.setPingInterval(interval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public void onError(Exception ex) {
};

if(WSS_SCHEME.equals(resource.getScheme())) {
if(wssSocketBuilder == null) {

if(wssSocketBuilder == null) {
throw new IllegalStateException("wssSocketBuilder must be set to support " + WSS_SCHEME + " scheme");
}

Expand Down