Skip to content

Commit 80d6ee8

Browse files
committed
[#194] Update to up-spec v1.6.0.alpha-5
Amended code with OpenFastTrace specitems and added configuration for tracing requirements based on up-spec v1.6.0.alpha-5. Added Cucumber based tests that implement the scenarios defined by Gherkin feature files that had been added in v1.6.0.alpha-5. Removed obsolete files and improved cohesion and readability of unit tests. Fixes #194
1 parent a1032e9 commit 80d6ee8

64 files changed

Lines changed: 1275 additions & 1140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.oft-current

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
# The file patterns that specify the relevant parts of the latest uProtocol Specification
1515
# that this component is supposed to implement
16-
UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics"
16+
UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics up-spec/up-l1/README.adoc up-spec/up-l2/api.adoc"
1717

1818
# The file patterns that specify this component's resources which contain specification items
1919
# that cover the requirements
20-
COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src"
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md .github src"
2121

2222
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
23-
OFT_TAGS="_"
23+
OFT_TAGS="_,LanguageLibrary"

.env.oft-latest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics up-spec/up-l1/
1717

1818
# The file patterns that specify this component's resources which contain specification items
1919
# that cover the requirements
20-
COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src"
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md .github src"
2121

2222
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
2323
OFT_TAGS="_,LanguageLibrary"

.github/workflows/build_and_test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
name: Verify PR
1515

1616
on:
17+
# the repository is configured to require a PR for
18+
# making changes to the main branch
19+
# so every check made here is effectively
20+
# made before merging to main
1721
pull_request:
1822
branches:
1923
- '*'
2024

2125
jobs:
26+
# [impl->req~up-language-ci-build~1]
2227
verify-pr:
2328
runs-on: ubuntu-latest
2429

@@ -33,4 +38,8 @@ jobs:
3338
distribution: 'temurin'
3439
cache: maven
3540
- name: Build and Test with Maven
41+
# the package goal includes running the tests
42+
# [impl->req~up-language-ci-test~1]
43+
# and also builds the JavaDocs
44+
# [impl->req~up-language-ci-api-docs~1]
3645
run: mvn -B package --file pom.xml

.github/workflows/coverage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- main
2020

2121
jobs:
22+
# req~up-language-test-coverage~1
2223
test-and-coverage:
2324
name: Test with coverage
2425
runs-on: ubuntu-latest

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ on:
2020
branches: [main]
2121

2222
jobs:
23+
# [impl->req~up-language-ci-linter~1]
2324
lint:
2425
runs-on: ubuntu-latest
2526

README.adoc

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
= Eclipse uProtocol Java Library
22
:toc:
33

4+
[.specitem,oft-sid="uman~up-java-readme~1",oft-covers="req~up-language-documentation~1",tags="LanguageLibrary"]
45
== Overview
56

6-
This is the https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.4/languages.adoc[uProtocol v1.6.0-alpha.4 Language Library] for the Java programming language. The library is organized into packages that are described in <<sdk-packages>> below and organized by the layers of the protocol.
7+
This is the https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.5/languages.adoc[uProtocol v1.6.0-alpha.5 Language Library] for the Java programming language. The library is organized into packages that are described in <<sdk-packages>> below and organized by the layers of the protocol.
78

8-
Each package contains a README.adoc file that describes the purpose of the package and how to use it.
9-
10-
The module contains the factory methods, serializers, and validators for all data types defined in the specifications, and any data models that either haven't or couldn't be defined in up-core-api yet.
9+
Each package folder contains a `README.adoc` file that describes the purpose of the package and how to use it.
1110

1211
== Getting Started
1312

14-
=== Importing the Library
15-
16-
To pull the Library from maven central, setting ${uprotocol.version} to the latest version of this library in your pom.xml file:
17-
[source]
13+
=== Adding the Library
14+
15+
The library is available from [Maven Central](https://search.maven.org/artifact/org.eclipse.uprotocol/up-java) and can be added as a dependency to your Maven or Gradle project.
16+
17+
[.specitem,oft-sid="impl~up-java-deps-resolution~1",oft-covers="req~up-language-build-deps~1",tags="LanguageLibrary"]
18+
----
19+
The following dependency needs to be added to your Maven POM file, setting `${uprotocol.version}` to the desired version of the library:
20+
----
21+
22+
[source,xml]
1823
----
19-
<!-- uProtocol Core -->
2024
<dependency>
2125
<groupId>org.eclipse.uprotocol</groupId>
2226
<artifactId>up-java</artifactId>
@@ -34,21 +38,20 @@ To pull the Library from maven central, setting ${uprotocol.version} to the late
3438

3539
| xref:src/main/java/org/eclipse/uprotocol/client/README.adoc[`*client*`]
3640
| Top level client-facing interfaces to communication with USubscription, UDiscovery, and UTwin services.
37-
| https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.4/up-l3/README.adoc[Application Layer (uP-L3)]
41+
| https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.5/up-l3/README.adoc[Application Layer (uP-L3)]
3842

3943
| xref:src/main/java/org/eclipse/uprotocol/communication/README.adoc[`*communication*`]
4044
| Common implementation of communication messaging patterns (publisher, subscriber, RpcClient, RpcServer, etc..) that are built on top of the L1 transport interface (see below).
41-
| https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.4/up-l2/api.adoc[Communication Layer (uP-L2)]
45+
| https://github.com/eclipse-uprotocol/up-spec/blob/v1.6.0-alpha.5/up-l2/api.adoc[Communication Layer (uP-L2)]
4246

4347
| xref:src/main/java/org/eclipse/uprotocol/transport/README.adoc[`*transport*`]
4448
| Interface and data model for how to send() and receive() messages in a common way across various transport technologies (ex. zenoh, mqtt, http, etc...). the interface is implemented by transports (ex. up-transport-android-java), and the interface is then used to build the uProtocol layer 2 communication layer implementation.
45-
| https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.4/up-l1/README.adoc[Transport Layer (uP-L1)]
49+
| https://github.com/eclipse-uprotocol/uprotocol-spec/blob/v1.6.0-alpha.5/up-l1/README.adoc[Transport Layer (uP-L1)]
4650

4751
| xref:src/main/java/org/eclipse/uprotocol/uri/README.adoc[`*uuri*`]
4852
| uProtocol addressing scheme (UUri) builders, validators, and serializers.
4953
| Basics
5054

51-
5255
| xref:src/main/java/org/eclipse/uprotocol/uuid/README.adoc[`*uuid*`]
5356
| uProtocol unique identifier builders, validators, and serializers.
5457
| Basics
@@ -57,6 +60,11 @@ To pull the Library from maven central, setting ${uprotocol.version} to the late
5760

5861
=== Building from Source
5962

63+
[.specitem,oft-sid="impl~up-java-build-system~1",oft-covers="req~up-language-build-sys~1",tags="LanguageLibrary"]
64+
----
65+
The library is built using the [Apache Maven](https://apache.org/maven) build system and is published to [Maven Central](https://search.maven.org/artifact/org.eclipse.uprotocol/up-java).
66+
----
67+
6068
. Clone the repository:
6169
+
6270
[source,console]

pom.xml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@
9696
<type>pom</type>
9797
<scope>import</scope>
9898
</dependency>
99+
<dependency>
100+
<groupId>io.cucumber</groupId>
101+
<artifactId>cucumber-bom</artifactId>
102+
<version>7.25.0</version>
103+
<type>pom</type>
104+
<scope>import</scope>
105+
</dependency>
99106
</dependencies>
100107
</dependencyManagement>
101108

@@ -144,6 +151,12 @@
144151
<scope>test</scope>
145152
</dependency>
146153

154+
<dependency>
155+
<groupId>org.junit.platform</groupId>
156+
<artifactId>junit-platform-suite</artifactId>
157+
<scope>test</scope>
158+
</dependency>
159+
147160
<dependency>
148161
<groupId>org.mockito</groupId>
149162
<artifactId>mockito-core</artifactId>
@@ -173,6 +186,16 @@
173186
<artifactId>jul-to-slf4j</artifactId>
174187
<scope>test</scope>
175188
</dependency>
189+
<dependency>
190+
<groupId>io.cucumber</groupId>
191+
<artifactId>cucumber-java</artifactId>
192+
<scope>test</scope>
193+
</dependency>
194+
<dependency>
195+
<groupId>io.cucumber</groupId>
196+
<artifactId>cucumber-junit-platform-engine</artifactId>
197+
<scope>test</scope>
198+
</dependency>
176199
</dependencies>
177200

178201
<build>
@@ -294,10 +317,19 @@
294317
</plugin>
295318
<plugin>
296319
<artifactId>maven-surefire-plugin</artifactId>
297-
<version>3.5.3</version>
320+
<!--
321+
do NOT use 3.5.3 as it is incompatible with Cucumber
322+
https://github.com/cucumber/cucumber-jvm/issues/2984
323+
-->
324+
<version>3.5.2</version>
298325
<configuration>
299326
<!-- allow to use unnamed modules -->
300327
<useModulePath>false</useModulePath>
328+
<properties>
329+
<configurationParameters>
330+
cucumber.junit-platform.naming-strategy=surefire
331+
</configurationParameters>
332+
</properties>
301333
</configuration>
302334
</plugin>
303335
<plugin>

src/main/java/org/eclipse/uprotocol/client/usubscription/v3/USubscriptionClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/**
3333
* The client-side interface for interacting with a USubscription service instance.
3434
*
35-
* @see <a href="https://github.com/eclipse-uprotocol/up-spec/tree/v1.6.0-alpha.4/up-l3/usubscription/v3">
35+
* @see <a href="https://github.com/eclipse-uprotocol/up-spec/tree/v1.6.0-alpha.5/up-l3/usubscription/v3">
3636
* USubscription service specification</a>
3737
*/
3838
public interface USubscriptionClient {

src/main/java/org/eclipse/uprotocol/communication/AbstractCommunicationLayerClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.eclipse.uprotocol.transport.LocalUriProvider;
1818
import org.eclipse.uprotocol.transport.UTransport;
1919

20+
// [impl->dsn~communication-layer-impl-default~1]
2021
public class AbstractCommunicationLayerClient {
2122
private final UTransport transport;
2223
private final LocalUriProvider uriProvider;

src/main/java/org/eclipse/uprotocol/communication/CallOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
/**
2222
* This class is used to pass metadata to method invocation on the client side.
2323
*/
24+
// [impl->dsn~communication-layer-api-declaration~1]
2425
public record CallOptions (Integer timeout, UPriority priority, String token) {
2526
public static final int TIMEOUT_DEFAULT = 10000; // Default timeout of 10 seconds
2627

0 commit comments

Comments
 (0)