Coder Social home page Coder Social logo

etf-validator / etf-client Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 2.0 914 KB

Java Client Library for starting, monitoring and controlling test runs on a remote ETF instance

Home Page: https://etf-validator.github.io/etf-client/javadoc/de/interactive_instruments/etf/client/package-summary.html

License: European Union Public License 1.2

Java 100.00%
etf validator test-framework maintainer-ii

etf-client's Introduction

ETF Java Client Library

European Union Public Licence 1.2 API JavaDoc

The ETF Java Client library provides functionality to:

  • query the available Executable Test Suites
  • filter the Executable Test Suites by Tags
  • create Ad hoc test objects
  • start, monitor and control test runs
  • query the results in the ETF results structure, including translated messages

Quickstart

// requires etf.client;
import de.interactive_instruments.etf.client.*;

// Create an endpoint object for the remote ETF instance
final EtfEndpoint etfEndpoint = EtfValidatorClient.create()
	.url(new URL("http://SERVICE/etf-webapp"))
	.locale(Locale.ENGLISH)
	.init();

// Get metadata Tag
final Tag metadataTag = etfEndpoint.tags().itemByLabel("Metadata (TG version 2.0) - BETA").get();

// Get a collection of Executable Test Suites with the Metadata Tag
final EtsCollection metadataTestSuites = etfEndpoint.executableTestSuites().itemsByTag(metadataTag);

// Create a new Test Object
final String METADATA_TEST_URL =
		"https://raw.githubusercontent.com/jonherrmann/community/master/examples/Dataset_metadata_2.0_example.xml";
final AdHocTestObject testObject = etfEndpoint.newAdHocTestObject().fromDataSet(new URL(METADATA_TEST_URL));

// Start the Test Run
final TestRun testRun = metadataTestSuites.execute(testObject);

// Wait until the Test Run finishes and get the result (blocking call)
final TestRunResult result = testRun.result();

// Output the results
for (final TestResult testResult : result) {
	System.out.println(testResult.label()+" - "+testResult.resultStatus());
}

See the API documentation for additional details.

Mapping the results to your own model

ETF result structure

The results are available in a hierarchical structure.

  • Test Run Result : the root level.
  • Test Modules: for some ETS types they are hidden in the HTML report. The ETF Java Client library will skip these items, if they are traversed using the Iterable interface.
  • Test Cases
  • Test Steps: Based on the ETS type, these can also be hidden or possess additional information that are attached to it.
  • Test Assertions: the lowest level result element representing the result of an atomic test.

The result items implement the Iterable interface. The call at a certain level of the result structure includes all sub-elements in the result during iteration.

Result Status Codes

The result status codes are describe here.

Getting the library

The library is written in Java 11. The latest version can be downloaded using the etf snapshot repository.

Gradle dependency configuration

repositories {
	maven {
		url "https://services.interactive-instruments.de/etfdev-af/snapshot"
		// our repository requires authentication
		credentials {
			username 'etf-public-dev'
			password 'etf-public-dev'
		}
	}
}
// ...
dependencies {
	implementation group: 'de.interactive_instruments.etf', name: 'etf-client', version: '1.7.1-SNAPSHOT'
}

Maven dependency configuration

<project>
<!-- ... -->
	<repositories>
		<repository>
		<id>etf-repo</id>
		<url>https://services.interactive-instruments.de/etfdev-af/snapshot</url>
		</repository>
	</repositories>
	<!-- ... -->
	<dependencies>
		<dependency>
		<groupId>de.interactive_instruments.etf</groupId>
		<artifactId>etf-client</artifactId>
		<version>1.7.1-SNAPSHOT</version>
		</dependency>
	</dependencies>
<!-- ... -->
</project>

settings.xml :

<settings>
	<servers>
		<server>
			<id>etf-repo</id>
			<username>etf-public-dev</username>
			<password>etf-public-dev</password>
		</server>
	</servers>
</settings>

Sponsors

This library was funded by terrestris and the german Federal Agency for Cartography (BKG) as part of the development of the GDI-DE Testsuite.

etf-client's People

Contributors

hwbllmnn avatar jonherrmann avatar spalek avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.