Shields4J client

Lightweight java HTTP-client for the shields.io service

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

org.touchbit.shields4j
ArtifactId

ArtifactId

client
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Shields4J client
Lightweight java HTTP-client for the shields.io service
Project Organization

Project Organization

TouchBIT

Download client

How to add to project

<!-- https://jarcasting.com/artifacts/org.touchbit.shields4j/client/ -->
<dependency>
    <groupId>org.touchbit.shields4j</groupId>
    <artifactId>client</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.touchbit.shields4j/client/
implementation 'org.touchbit.shields4j:client:1.0.1'
// https://jarcasting.com/artifacts/org.touchbit.shields4j/client/
implementation ("org.touchbit.shields4j:client:1.0.1")
'org.touchbit.shields4j:client:jar:1.0.1'
<dependency org="org.touchbit.shields4j" name="client" rev="1.0.1">
  <artifact name="client" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.touchbit.shields4j', module='client', version='1.0.1')
)
libraryDependencies += "org.touchbit.shields4j" % "client" % "1.0.1"
[org.touchbit.shields4j/client "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25

test (1)

Group / Artifact Type Version
org.touchbit.shields4j » test-core jar 1.0.1

Project Modules

There are no modules declared in this project.

Shields4j Master MavenCentral DocumentationStatus AlertStatus Coverage

Lightweight java HTTP-client for the shields.io service.

Full documentation is available on the shields4j.readthedocs.io

Briefly

Java client

Add dependency

<dependency>
    <groupId>org.touchbit.shields4j</groupId>
    <artifactId>client</artifactId>
    <version>${shields4j.version}</version>
</dependency>

If you need to get Shields4j versions that are not uploaded to maven central (snapshot/staging), add the Sonatype repository to your pom.xml

<repositories>
    <repository>
        <id>SonatypeNexus</id>
        <url>https://oss.sonatype.org/content/groups/staging/</url>
    </repository>
</repositories>

Minimal minimal

class Example {
    public static void main (String[] arg) {
        new ShieldsIO()
            .withLabel("Shields4J")
            .withMessage("1.0")
            .writeShieldToFile("minimal.svg");
    }
}

With logo and color background withlogo

class Example {
    public static void main (String[] arg) {
        new ShieldsIO()
            .withLabel("Shields4J")
            .withLabelColor(Color.BLUE)
            .withMessage("with Raspberry PI logo")
            .withMessageColor(Color.GREEN)
            .withStyle(Style.POPOUT)
            .withLogo(Logo.RASPBERRY_PI)
            .withLogoColor(Color.RED)
            .withLogoWidth(30)
            .writeShieldToFile("with-logo.svg");
    }
}

With custom logo and color background withcustomlogo

class Example {
    public static void main (String[] arg) {
         new ShieldsIO()
            .withLabel("Shields4J")
            .withLabelColor(Color.BLUE)
            .withMessage("with custom logo")
            .withMessageColor(Color.GREEN)
            .withStyle(Style.POPOUT)
            .withBase64Logo(new File("docs/img/status_success.svg"))
            .writeShieldToFile("with-custom-logo.svg");
    }
}

TestNG listener

Add dependency

<dependency>
    <groupId>org.touchbit.shields4j</groupId>
    <artifactId>testng</artifactId>
    <version>${shields4j.version}</version>
</dependency>

Add IShieldsListener to testNG iteststotal itestssuccesspercent

class Example {
    public static void main (String[] arg) {
         TestNG testNG = new TestNG();
         testNG.addListener(new IShieldsListener());
    }
}

or add IShieldsListener in your testng.xml file

<suite>
  <listeners>
    <listener class-name="org.touchbit.shields4j.testng.IShieldsListener" />
  </listeners>
</suite>

To customize the prefixes, create your own listener inherited from IShieldsListener integrationtesttotal integrationtestsuccesspercent

public class ShieldsListener extends IShieldsListener {
    public ShieldsListener() {
        withLabelPefix("Integration test");
        withFilePefix("testng");
    }
}
org.touchbit.shields4j

TouchBIT

Projects are mirrored from https://gitlab.com/TouchBIT

Versions

Version
1.0.1
1.0.0