Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/projectnessie/nessie-apprunner
https://github.com/projectnessie/nessie-apprunner
gradle java maven nessie test
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/projectnessie/nessie-apprunner
- Owner: projectnessie
- License: apache-2.0
- Created: 2022-03-03T15:04:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T16:29:15.000Z (2 months ago)
- Last Synced: 2024-10-22T00:48:33.092Z (2 months ago)
- Topics: gradle, java, maven, nessie, test
- Language: Java
- Size: 970 KB
- Stars: 1
- Watchers: 8
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Nessie Apprunner plugins for Maven and Gradle
[![Build Status](https://github.com/projectnessie/nessie-apprunner/actions/workflows/ci.yml/badge.svg)](https://github.com/projectnessie/nessie-apprunner/actions/workflows/ci.yml)
[![Maven Central](https://img.shields.io/maven-central/v/org.projectnessie.nessie-runner/nessie-runner-maven-plugin)](https://search.maven.org/artifact/org.projectnessie.nessie-runner/nessie-runner-maven-plugin)See https://github.com/projectnessie/nessie
See https://projectnessie.org
## Usage
The _Nessie Apprunner plugins_ are available for [Maven](#maven) and [Gradle](#Gradle). A
rudimentary integration test is shown below.### Java integration tests
```java
import org.projectnessie.client.api.NessieApiV2;
import org.projectnessie.client.http.HttpClientBuilder;
import org.projectnessie.model.Branch;public class ITWorksWithNessie {
static URI NESSIE_SERVER_URI =
String.format(
"%s/api/v2",
requireNonNull(
System.getProperty("quarkus.http.test-url"),
"Required system property quarkus.http.test-url is not set"));static NessieApiV2 nessieApi;
@BeforeAll
static void setupNessieClient() {
nessieApi = HttpClientBuilder.builder()
.fromSystemProperties()
.withUri(NESSIE_SERVER_URI)
.build(NessieApiV2.class);
}
@AfterAll
static void closeNessieClient() {
nessieApiV1.close();
}
@Test
public void pingNessie() {
Branch defaultBranch = nessieApiV1.getDefaultBranch();
// do some more stuff
}
}
```### Gradle
#### Kotlin DSL
`build.gradle.kts`
```kotlin
plugins {
java
id("org.projectnessie") version "0.29.0"
}dependencies {
// your dependencies// specify the GAV of the Nessie Quarkus server runnable (uber-jar)
nessieQuarkusServer("org.projectnessie:nessie-quarkus:0.49.0:runner")
}nessieQuarkusApp {
// Ensure that the `test` task has a Nessie Server available.
includeTask(tasks.named("test"))
// Note: prefer setting up separate `integrationTest` tasks, see https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html// These system properties will be available in your integration tests and will contain the
// port and full URL of the Nessie Quarkus server's HTTP server.
// httpListenPortProperty.set("quarkus.http.port") // quarkus.http.port is the default
// httpListenUrlProperty.set("quarkus.http.test-url") // quarkus.http.test-url is the default
}
```#### Groovy DSL
`build.gradle`
```groovy
plugins {
id 'java'
id 'org.projectnessie' version "0.29.0"
}dependencies {
// your dependencies// specify the GAV of the Nessie Quarkus server runnable (uber-jar)
nessieQuarkusServer "org.projectnessie:nessie-quarkus:0.49.0:runner"
}nessieQuarkusApp {
// Ensure that the `test` task has a Nessie Server available.
includeTask(tasks.named("test"))
// Note: prefer setting up separate `integrationTest` tasks, see https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html// These system properties will be available in your integration tests and will contain the
// port and full URL of the Nessie Quarkus server's HTTP server.
// httpListenPortProperty.set("quarkus.http.port") // quarkus.http.port is the default
// httpListenUrlProperty.set("quarkus.http.test-url") // quarkus.http.test-url is the default
}
```### Maven
The `org.projectnessie.nessie-runner:nessie-runner-maven-plugin` Maven plugin can be used together with the
standard `maven-failsafe-plugin`(POM snippet)
```xml
0.49.0
org.projectnessie
nessie-client
${nessie.version}
org.apache.maven.plugins
maven-failsafe-plugin
org.projectnessie.nessie-runner
nessie-runner-maven-plugin
0.29.0
org.projectnessie:nessie-quarkus:jar:runner:${nessie.version}
bar
world
quarkus.http.port
quarkus.http.test-url
start
pre-integration-test
start
stop
post-integration-test
stop
```
## Build requirements
* Java 11
## Build instructions
```basb
./mvnw clean install
(cd gradle-plugin ; ./gradlew build)
```