uk.me.mjt:crashjvm

Crashes the JVM. Use it to ensure your test runners handle crashes gracefully!

Лицензия

Лицензия

Категории

Категории

CRaSH Универсальные библиотеки Utility
Группа

Группа

uk.me.mjt
Идентификатор

Идентификатор

crashjvm
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

uk.me.mjt:crashjvm
Crashes the JVM. Use it to ensure your test runners handle crashes gracefully!
Ссылка на сайт

Ссылка на сайт

https://github.com/michaeltandy/crashjvm
Система контроля версий

Система контроля версий

https://github.com/michaeltandy/crashjvm

Скачать crashjvm

Как подключить последнюю версию

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

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.10

Модули Проекта

Данный проект не имеет модулей.

crashjvm

Uses JNI to trigger JVM crashes. Use it to ensure your test runners handle crashes gracefully!

The native libraries are bundled into the jar and extracted at runtime, so they should work seamlessly on the supported platforms.

Appveyor build status image Travis CI build status image

How to use

Import the dependency in the normal maven way

        <dependency>
            <groupId>uk.me.mjt</groupId>
            <artifactId>crashjvm</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>

Then in your tests you can trigger various crashes like so:

import uk.me.mjt.CrashJvm;

public class ExampleClass {
    public void exampleMethod() {
        CrashJvm.loadedOk(); // Checks the native library has imported.
        CrashJvm.exit(); // Equivalent to the C stdlib method exit(66)
        CrashJvm.abort(); // Equivalent to the C stdlib method abort()
        CrashJvm.segfault(); // Causes a segmentation fault
    }
}

Platforms supported

Thanks to Travis and Appveyor, native libraries are included for the following platforms:

x86 64-bit x86 32-bit
Linux Compiled & tested (on Ubuntu Trusty) Compiled
Mac Compiled & tested (on 10.12.6) Compiled
Windows Compiled & tested (on Server 2012 R2) Compiled

I've been informed that Windows NT 4.0 isn't compatible. Patches welcome, I suppose?

If you know of a free CI service will allow me to compile and test on other CPU architectures, let me know and I'll integrate it.

Almost-reproducible build

If you're looking to reproduce the build and check for nerfarious deeds on my part, feel free! The native libraries were all built on public CI platforms, and the jar includes the build numbers as well as the versions of the compilers used.

A rebuild won't be byte-for-byte identical, because of timestamps in the windows libraries and zip file timestamps in the jar but other than that I don't know of any reason the build shouldn't reproduce.

Версии библиотеки

Версия
1.0