Code Review
/
openflowjava.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Improved Facade & integration test
[openflowjava.git]
/
openflow-protocol-impl
/
src
/
test
/
java
/
org
/
opendaylight
/
openflowjava
/
protocol
/
impl
/
integration
/
IntegrationTest.java
diff --git
a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/integration/IntegrationTest.java
b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/integration/IntegrationTest.java
index 363dede6c55c89be2483176e3f99401446dce756..5416a2a05e887ee60b1a7e14631c6c22f82119b7 100644
(file)
--- a/
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/integration/IntegrationTest.java
+++ b/
openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/integration/IntegrationTest.java
@@
-34,7
+34,7
@@
public class IntegrationTest {
private static final long CONNECTION_TIMEOUT = 2000;
\r
\r
private InetAddress startupAddress;
\r
private static final long CONNECTION_TIMEOUT = 2000;
\r
\r
private InetAddress startupAddress;
\r
- private MockPlugin
dummy
Plugin;
\r
+ private MockPlugin
mock
Plugin;
\r
\r
/**
\r
* @throws UnknownHostException
\r
\r
/**
\r
* @throws UnknownHostException
\r
@@
-50,25
+50,30
@@
public class IntegrationTest {
*/
\r
@Test
\r
public void testCommunication() throws Exception {
\r
*/
\r
@Test
\r
public void testCommunication() throws Exception {
\r
-
dummy
Plugin = new MockPlugin();
\r
+
mock
Plugin = new MockPlugin();
\r
SwitchConnectionProviderImpl scpimpl = new SwitchConnectionProviderImpl();
\r
SwitchConnectionProviderImpl scpimpl = new SwitchConnectionProviderImpl();
\r
+ scpimpl.setSwitchConnectionHandler(mockPlugin);
\r
List<ConnectionConfiguration> configs = new ArrayList<>();
\r
configs.add(new TestingConnConfigImpl(startupAddress, DEFAULT_PORT, DEFAULT_TLS_SUPPORT));
\r
scpimpl.configure(configs);
\r
List<ConnectionConfiguration> configs = new ArrayList<>();
\r
configs.add(new TestingConnConfigImpl(startupAddress, DEFAULT_PORT, DEFAULT_TLS_SUPPORT));
\r
scpimpl.configure(configs);
\r
- scpimpl.setSwitchConnectionHandler(dummyPlugin);
\r
scpimpl.startup().get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);
\r
scpimpl.startup().get(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);
\r
+
\r
int amountOfCLients = 1;
\r
int amountOfCLients = 1;
\r
- List<SimpleClient> clients = createAndStartClient(amountOfCLients);
\r
- Thread.sleep(2000);
\r
+ List<SimpleClient> clients = createAndStartClient(amountOfCLients, 24);
\r
+ SimpleClient firstClient = clients.get(0);
\r
+ firstClient.getAutomatedPartDone().get();
\r
+ firstClient.getDataReceived().get();
\r
+ disconnectClients(clients);
\r
}
\r
\r
/**
\r
* @param amountOfCLients
\r
}
\r
\r
/**
\r
* @param amountOfCLients
\r
+ * @param dataLimit TODO
\r
* @return new clients up and running
\r
* @throws InterruptedException
\r
* @throws ExecutionException
\r
*/
\r
* @return new clients up and running
\r
* @throws InterruptedException
\r
* @throws ExecutionException
\r
*/
\r
- private List<SimpleClient> createAndStartClient(int amountOfCLients)
\r
+ private List<SimpleClient> createAndStartClient(int amountOfCLients
, int dataLimit
)
\r
throws InterruptedException, ExecutionException {
\r
List<SimpleClient> clientsHorde = new ArrayList<>();
\r
for (int i = 0; i < amountOfCLients; i++) {
\r
throws InterruptedException, ExecutionException {
\r
List<SimpleClient> clientsHorde = new ArrayList<>();
\r
for (int i = 0; i < amountOfCLients; i++) {
\r
@@
-77,6
+82,7
@@
public class IntegrationTest {
getClass().getResourceAsStream(OF_BINARY_MESSAGE_INPUT_TXT));
\r
sc.setSecuredClient(false);
\r
clientsHorde.add(sc);
\r
getClass().getResourceAsStream(OF_BINARY_MESSAGE_INPUT_TXT));
\r
sc.setSecuredClient(false);
\r
clientsHorde.add(sc);
\r
+ sc.setDataLimit(dataLimit);
\r
sc.start();
\r
}
\r
for (SimpleClient sc : clientsHorde) {
\r
sc.start();
\r
}
\r
for (SimpleClient sc : clientsHorde) {
\r