Skip to content

Commit

Permalink
Initial commit of #93, working for the initial 3 test types - total 3…
Browse files Browse the repository at this point in the history
…3 tests per client/server combo
  • Loading branch information
eswdd committed Jul 15, 2015
1 parent 91a0217 commit 87bae96
Show file tree
Hide file tree
Showing 52 changed files with 3,823 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package com.betfair.cougar.client.socket;

import com.betfair.cougar.api.ExecutionContext;
import com.betfair.cougar.api.security.IdentityResolver;
import com.betfair.cougar.client.CallContextFactory;
import com.betfair.cougar.client.ClientCallContext;
import com.betfair.cougar.client.api.ContextEmitter;
Expand Down Expand Up @@ -223,7 +222,7 @@ public void exceptionCaught(final IoSession session, final Throwable cause) thro
// We arrive here when the output pipe is broken. Broken network connections are not
// really exceptional and should not be reported by dumping the stack trace.
// Instead a summary debug level log message with some relevant info
logger.log(ALL, session, "ExecutionVenueNioClient: IOException received on session - closing");
logger.log(ALL, session, "ExecutionVenueNioClient: IOException received on session - closing",cause);
} else {
logger.log(SESSION, session, "ExecutionVenueNioClient: Unexpected exception from session - see main log for details");
LOG.warn("Unexpected exception from session " + NioUtils.getSessionId(session), cause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2014, The Sporting Exchange Limited
* Copyright 2015, Simon Matić Langford
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -68,6 +69,7 @@ public void initialise() {
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setName("Session Recycler for " + hosts);
t.setDaemon(true);
return t;
}
}).scheduleAtFixedRate(this, 0, sessionRecycleInterval, TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2014, The Sporting Exchange Limited
* Copyright 2015, Simon Matić Langford
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,5 +20,10 @@
import com.betfair.cougar.core.api.ev.OperationKey;

public interface OperationBindingDescriptor {

/**
* Get the key values of the Operation (service name, service version and operation name)
* @return
*/
OperationKey getOperationKey();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2014, The Sporting Exchange Limited
* Copyright 2015, Simon Matić Langford
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,20 +17,15 @@

package com.betfair.cougar.core.api.ev;

import com.betfair.cougar.core.api.OperationBindingDescriptor;
import com.betfair.cougar.core.api.transcription.Parameter;
import com.betfair.cougar.core.api.transcription.ParameterType;

/**
* Defines an Operation, its parameters and its return type.
*
*/
public interface OperationDefinition {

/**
* Get the key values of the Operation (service name, service version and operation name)
* @return
*/
public OperationKey getOperationKey();
public interface OperationDefinition extends OperationBindingDescriptor {

/**
* Get the Parameters (names and ParameterType) for the operation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2013, The Sporting Exchange Limited
~ Copyright 2015, Simon Matić Langford
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -18,7 +19,7 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

<bean class="com.betfair.cougar.util.configuration.PropertyConfigurer">
<constructor-arg index="0" ref="cougar.core.EncryptorRegistry"/>
<property name="defaultConfig" value="classpath:conf/binary-protocol.properties"/>
Expand All @@ -42,29 +43,16 @@
</property>
<property name="namespace" value="pants"/>
</bean>

<bean id="clientIdentityResolver" class="com.betfair.platform.ClientIdentityResolver"/>


<bean id="socketTransport" parent="cougar.client.AbstractSocketTransport">
<constructor-arg index="5" value="$BINARY_CLIENT{baseline.server.binaryProtocol.address}"/>
<property name="identityResolver" ref="clientIdentityResolver"/>
</bean>

<bean id="cougar.core.GeoIPLocator" class="com.betfair.cougar.util.geolocation.GeoIPLocator">
<constructor-arg index="0" value=""/>
<constructor-arg index="1" value="true"/>
<constructor-arg index="2" value="10000"/>
<constructor-arg index="3">
<bean class="com.betfair.cougar.util.geolocation.SuspectNetworkList">
</bean>
</constructor-arg>
<constructor-arg index="4">
<null/>
</constructor-arg>
<constructor-arg index="5">
<null/>
</constructor-arg>
<bean id="cougar.core.GeoIPLocator" class="com.betfair.cougar.util.geolocation.NullGeoIPLocator">
</bean>


Expand Down
23 changes: 12 additions & 11 deletions cougar-test/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014, The Sporting Exchange Limited
~ Copyright 2015, Simon Matić Langford
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,17 +31,17 @@

<properties>
<testFailureIgnore>false</testFailureIgnore>

</properties>

<modules>
<module>cougar-test-utils</module>
<module>cougar-ci-test-listener</module>
<module>cougar-component-code-tests</module>
<module>cougar-client-code-tests</module>
<module>cougar-normal-code-tests</module>
<module>cougar-iddversion-tests</module>
<module>cougar-binaryprotocol-tests</module>
<module>cougar-ci-process-launcher</module>
</modules>
<modules>
<module>cougar-test-utils</module>
<module>cougar-ci-test-listener</module>
<module>cougar-component-code-tests</module>
<module>cougar-client-code-tests</module>
<module>cougar-normal-code-tests</module>
<module>cougar-iddversion-tests</module>
<module>cougar-binaryprotocol-tests</module>
<module>cougar-ci-process-launcher</module>
<module>socket-compatibility-testing</module>
</modules>
</project>
38 changes: 38 additions & 0 deletions cougar-test/socket-compatibility-testing/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2015, Simon Matić Langford
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.betfair.cougar</groupId>
<artifactId>cougar-test</artifactId>
<version>3.3-SNAPSHOT</version>
</parent>

<artifactId>socket-compatibility-testing</artifactId>
<packaging>pom</packaging>

<modules>
<module>socket-tester</module>
<module>socket-testing-app</module>
</modules>



</project>
81 changes: 81 additions & 0 deletions cougar-test/socket-compatibility-testing/socket-tester/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2015, Simon Matić Langford
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.betfair.cougar</groupId>
<artifactId>socket-compatibility-testing</artifactId>
<version>3.3-SNAPSHOT</version>
</parent>

<artifactId>socket-tester</artifactId>

<dependencies>
<dependency>
<groupId>com.betfair.cougar</groupId>
<artifactId>cougar-null-geoip-locator</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.betfair.cougar</groupId>
<artifactId>socket-transport</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.betfair.cougar</groupId>
<artifactId>net-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.betfair.cougar</groupId>
<artifactId>cougar-client</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.betfair.cougar.test.socket.tester.ClientServerTester</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2015, Simon Matić Langford
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.betfair.cougar.test.socket.tester;

import com.betfair.cougar.test.socket.tester.client.ClientMain;
import com.betfair.cougar.test.socket.tester.server.ServerMain;

/**
*
*/
public class ClientServerTester {
public static void main(String[] args) throws Exception {
String clientServer = args[0].toLowerCase();
String[] childArgs = new String[args.length-1];
System.arraycopy(args,1,childArgs,0,childArgs.length);
if (clientServer.equals("client")) {
ClientMain.main(childArgs);
}
else if (clientServer.equals("server")) {
ServerMain.main(childArgs);
}
else {
System.err.println("Unrecognized mode: "+clientServer);
}
}
}
Loading

0 comments on commit 87bae96

Please sign in to comment.