Skip to content

Commit

Permalink
Merge pull request #1 in SYMPHONYP/symphony-java-toolkit-temp from ma…
Browse files Browse the repository at this point in the history
…ster to production

* commit '8c977be513cbf8ef279d1638e19c653645cccdf7': (143 commits)
  Fix for #50
  Improved code coverage
  Moving images
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  Changed https://www.kite9.org/github-content/robmoffat/symphony-java-client-parent/images/chat-workflow3.png?media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor&media=editor in Kite9 Editor
  ...
  • Loading branch information
sureshrupnar committed Oct 19, 2020
2 parents de08874 + 8c977be commit fef84a2
Show file tree
Hide file tree
Showing 68 changed files with 1,098 additions and 343 deletions.
53 changes: 0 additions & 53 deletions .github/CONTRIBUTING.md

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: sjt-build

env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PGP_SKIP: ${{ secrets.PGP_SKIP }}
BOT1PRIVATEKEY: ${{ secrets.BOT1PRIVATEKEY }}
BOT2PRIVATEKEY: ${{ secrets.BOT2PRIVATEKEY }}
BOT2CERTIFICATE: ${{ secrets.BOT2CERTIFICATE }}

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Cache Maven dependencies
uses: actions/cache@v2
env:
cache-name: cache-mvn-modules
with:
path: ~/.m2
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
- name: Download deps and plugins
run: mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies
- name: Build + Test (on master)
if: github.ref == 'refs/heads/master'
run: mvn install --settings .github/workflows/settings.xml
- name: Build (not on master)
if: github.ref != 'refs/heads/master'
run: mvn install -DskipTests
- name: Coverage (on master)
if: github.ref == 'refs/heads/master'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

9 changes: 5 additions & 4 deletions .travis.settings.xml → .github/workflows/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
<properties>
<symphony-develop-bot1-identity>
{
"privateKey": "-----BEGIN PRIVATE KEY-----\n${env.BOT1PRIVATEKEY}\n-----END PRIVATE KEY-----",
"privateKey": "${env.BOT1PRIVATEKEY}",
"email": "symphony.practice.bot1@list.db.com",
"commonName": "symphony.practice.bot1"
}
</symphony-develop-bot1-identity>
<symphony-develop-bot2-identity>
{
"privateKey": "-----BEGIN PRIVATE KEY-----\n${env.BOT2PRIVATEKEY}\n-----END PRIVATE KEY-----",
"privateKey": "${env.BOT2PRIVATEKEY}",
"email": "symphony.practice.bot2@list.db.com",
"commonName": "symphony.practice.bot2",
"chain": [ "-----BEGIN CERTIFICATE-----\n${env.BOT2CERTIFICATE}\n-----END CERTIFICATE-----" ]
"chain": [ "${env.BOT2CERTIFICATE}" ]
}
</symphony-develop-bot2-identity>
<symphony-test-identity>
{
"privateKey": "-----BEGIN PRIVATE KEY-----\n${env.BOT1PRIVATEKEY}\n-----END PRIVATE KEY-----",
"privateKey": "${env.BOT1PRIVATEKEY}",
"email": "symphony.practice.bot1@list.db.com",
"commonName": "symphony.practice.bot1"
}
Expand All @@ -33,5 +33,6 @@
</profiles>
<activeProfiles>
<activeProfile>develop-pod-profile</activeProfile>
<activeProfile>symphony-ci</activeProfile>
</activeProfiles>
</settings>
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Symphony Java Toolkit Contribution and Governance Policies

This document describes the contribution process and governance policies of the FINOS Symphony Java Toolkit project. The project is also governed by the [Linux Foundation Antitrust Policy](https://www.linuxfoundation.org/antitrust-policy/), and the FINOS [IP Policy](IP-Policy.pdf), [Code of Conduct](Code-of-Conduct.md), [Collaborative Principles](Collaborative-Principles.md), and [Meeting Procedures](Meeting-Procedures.md).

## Contribution Process

Before making a contribution, please take the following steps:
1. Check whether there's already an open issue related to your proposed contribution. If there is, join the discussion and propose your contribution there.
2. If there isn't already a relevant issue, create one, describing your contribution and the problem you're trying to solve.
3. Respond to any questions or suggestions raised in the issue by other developers.
4. Fork the project repository and prepare your proposed contribution.
5. Submit a pull request.

NOTE: All contributors must have a contributor license agreement (CLA) on file with FINOS before their pull requests will be merged. Please review the FINOS [contribution requirements](https://finosfoundation.atlassian.net/wiki/spaces/FINOS/pages/75530375/Contribution+Compliance+Requirements) and submit (or have your employer submit) the required CLA before submitting a pull request.

## Governance

### Roles

The project community consists of Contributors and Maintainers:
* A **Contributor** is anyone who submits a contribution to the project. (Contributions may include code, issues, comments, documentation, media, or any combination of the above.)
* A **Maintainer** is a Contributor who, by virtue of their contribution history, has been given write access to project repositories and may merge approved contributions.
* The **Lead Maintainer** is the project's interface with the FINOS team and Board. They are responsible for approving [quarterly project reports](https://finosfoundation.atlassian.net/wiki/spaces/FINOS/pages/93225748/Board+Reporting+and+Program+Health+Checks) and communicating on behalf of the project. The Lead Maintainer is elected by a vote of the Maintainers.

### Contribution Rules

Anyone is welcome to submit a contribution to the project. The rules below apply to all contributions. (The key words "MUST", "SHALL", "SHOULD", "MAY", etc. in this document are to be interpreted as described in [IETF RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).)

* All contributions MUST be submitted as pull requests, including contributions by Maintainers.
* All pull requests SHOULD be reviewed by a Maintainer (other than the Contributor) before being merged.
* Pull requests for non-trivial contributions SHOULD remain open for a review period sufficient to give all Maintainers a sufficient opportunity to review and comment on them.
* After the review period, if no Maintainer has an objection to the pull request, any Maintainer MAY merge it.
* If any Maintainer objects to a pull request, the Maintainers SHOULD try to come to consensus through discussion. If not consensus can be reached, any Maintainer MAY call for a vote on the contribution.

### Maintainer Voting

The Maintainers MAY hold votes only when they are unable to reach consensus on an issue. Any Maintainer MAY call a vote on a contested issue, after which Maintainers SHALL have 36 hours to register their votes. Votes SHALL take the form of "+1" (agree), "-1" (disagree), "+0" (abstain). Issues SHALL be decided by the majority of votes cast. If there is only one Maintainer, they SHALL decide any issue otherwise requiring a Maintainer vote. If a vote is tied, the Lead Maintainer MAY cast an additional tie-breaker vote.

The Maintainers SHALL decide the following matters by consensus or, if necessary, a vote:
* Contested pull requests
* Election and removal of the Lead Maintainer
* Election and removal of Maintainers

All Maintainer votes MUST be carried out transparently, with all discussion and voting occurring in public, either:
* in comments associated with the relevant issue or pull request, if applicable;
* on the project mailing list or other official public communication channel; or
* during a regular, minuted project meeting.

### Maintainer Qualifications

Any Contributor who has made a substantial contribution to the project MAY apply (or be nominated) to become a Maintainer. The existing Maintainers SHALL decide whether to approve the nomination according to the Maintainer Voting process above.

### Changes to this Document

This document MAY be amended by a vote of the Maintainers according to the Maintainer Voting process above.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![BuildStatus](https://img.shields.io/travis/deutschebank/symphony-java-client-parent)](https://travis-ci.org/deutschebank/symphony-java-client-parent)
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://finosfoundation.atlassian.net/wiki/display/FINOS/Incubating)
[![BuildStatus](https://github.com/finos/symphony-java-toolkit/workflows/sjt-build/badge.svg)](https://github.com/finos/symphony-java-toolkit/workflows)
![Version](https://img.shields.io/bintray/v/deutschebank/SymphonyPractice/symphony-java-client-parent)
[![Coverage](https://img.shields.io/codecov/c/github/deutschebank/symphony-java-client-parent)](https://codecov.io/gh/deutschebank/symphony-java-client-parent)
[![Coverage](https://img.shields.io/codecov/c/github/finos/symphony-java-toolkit)](https://codecov.io/gh/finos/symphony-java-toolkit)
![License](https://img.shields.io/github/license/deutschebank/symphony-java-client-parent)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.deutschebank.symphony/symphony-java-client-parent)](https://search.maven.org/search?q=com.github.deutschebank.symphony)

Expand Down Expand Up @@ -112,8 +113,9 @@ In order to do a release:
1. On Releaser's machine:

```
mvn test
mvn versions:set -DnewVersion=<our breaking change no>.<symphony-api-version>.<our-release-no> -DartifactId=* -DgroupId=*
mvn -pl '!demos/demo-bot,!demos/demo-app' clean test source:jar javadoc:javadoc deploy
mvn -DskipTests -pl '!demos/demo-bot,!demos/demo-app' clean test source:jar javadoc:javadoc deploy -P symphony-release
mvn versions:set -DnewVersion=<our breaking change no>.<symphony-api-version>.<our-release-no+1>-SNAPSHOT -DartifactId=* -DgroupId=*
# then push to git
```
Expand All @@ -124,3 +126,5 @@ Jcenter release is performed automatically.
To release to maven central: https://bintray.com/package/central/deutschebank/SymphonyPractice/symphony-java-client-parent#central
Enter details and click sync.

- **NB:**: This seems to be somewhat unreliable. If it fails, un-check "Close and release repository when done." and instead do the close + release process via the interface at [oss.sonatype.org](https://oss.sonatype.org).

4 changes: 2 additions & 2 deletions bindings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<artifactId>symphony-java-client-bindings</artifactId>
<packaging>jar</packaging>
<name>Symphony Java Client Bindings</name>
<version>4.59.1-SNAPSHOT</version>
<version>4.59.7-SNAPSHOT</version>

<parent>
<groupId>com.github.deutschebank.symphony</groupId>
<artifactId>symphony-java-client-parent</artifactId>
<version>4.59.1-SNAPSHOT</version>
<version>4.59.7-SNAPSHOT</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public abstract class AbstractTest {
// @DataPoint
// public static TestClientStrategy cxf = TestPodConfig.CXF_CERT;
//
// @DataPoint
// public static TestClientStrategy jersey = TestPodConfig.JERSEY_RSA;
@DataPoint
public static TestClientStrategy jersey = TestPodConfig.JERSEY_RSA;

@DataPoint
public static TestClientStrategy cxf = TestPodConfig.CXF_RSA;
Expand Down
62 changes: 62 additions & 0 deletions bindings/src/test/java/com/symphony/api/bindings/AgentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
import java.util.function.Supplier;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.experimental.theories.Theory;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.symphony.api.agent.DatafeedApi;
import com.symphony.api.agent.MessagesApi;
import com.symphony.api.agent.SystemApi;
import com.symphony.api.bindings.Streams.Worker;
import com.symphony.api.model.AckId;
import com.symphony.api.model.Datafeed;
import com.symphony.api.model.V2HealthCheckResponse;
import com.symphony.api.model.V4Event;
import com.symphony.api.model.V5Datafeed;
import com.symphony.api.model.V5EventList;

/**
* Tests of some Agent endpoints.
Expand Down Expand Up @@ -76,6 +80,64 @@ public void testStreamsV4(TestClientStrategy s) throws Exception {
}
}

class V5Supplier implements Supplier<List<V4Event>> {

String lastAck = "";

private V5Datafeed datafeed;
private DatafeedApi api;

public V5Supplier(DatafeedApi api, V5Datafeed datafeed) {
super();
this.api = api;
this.datafeed = datafeed;
}

@Override
public List<V4Event> get() {
AckId ackId = new AckId().ackId(lastAck);
V5EventList el = api.readDatafeed(null, null, datafeed.getId(), ackId);
System.out.println("Recieved event list containing "+el.getEvents().size()+" events ackId "+el.getAckId());
this.lastAck = el.getAckId();
return el.getEvents();
}


}

@Ignore("Doesn't appear to work yet on develop pod")
@Theory
public void testStreamsV5(TestClientStrategy s) throws Exception {
DatafeedApi dfApi = s.getAgentApi(DatafeedApi.class);
MessagesApi messageAPi = s.getAgentApi(MessagesApi.class);

V5Datafeed datafeed = dfApi.createDatafeed(null, null);

System.out.println("Datafeed ID: "+datafeed.getId());

Supplier<List<V4Event>> supplier = new V5Supplier(dfApi, datafeed);

final int[] count = { 0 };
final Worker<V4Event> w = Streams.createWorker(supplier, e -> e.printStackTrace());

Thread t = new Thread(() -> {
w.stream().forEach(e -> count[0]++);
});

t.setDaemon(true);
t.start();

Thread.sleep(1000);

String toSend = "Trigger Listener."+new Random().nextInt();
messageAPi.v4StreamSidMessageCreatePost(null, ROOM, "<messageML>"+toSend+"</messageML>", null, null, null, null, null);

// wait for roundtrip
while (count[0] == 0) {
Thread.yield();
}
}

@Theory
public void testHealthEndpoint(TestClientStrategy s) throws Exception {
SystemApi systemApi = s.getAgentApi(SystemApi.class);
Expand Down
Loading

0 comments on commit fef84a2

Please sign in to comment.