<commit_before>package org.libelektra;

import static org.junit.Assert.*;
import org.junit.Test;
import org.libelektra.exception.KDBException;
import org.libelektra.exception.OutOfMemoryException;
import org.libelektra.exception.ResourceException;
import org.libelektra.exception.SemanticValidationException;

public class ErrorCodeTest {

    private Key parentKey = Key.create("user/tests/javabinding");
    private final String errorMeta = "trigger/error";
    private final String warningMeta = "trigger/warnings";
    private final Plugin errorPlugin;

    @Before
    public void setup(){
        errorPlugin = new Plugin("error", parentKey);
    }

    @Test(expected = OutOfMemoryException.class)
    public void kdbSetWithError_shouldMapOutOfMemoryError() throws Exception {
        Key errorKey = Key.create("user/tests/myError");
        errorKey.setMeta(errorMeta, OutOfMemoryException.errorCode());
        final KeySet ks = KeySet.create(10, KeySet.KS_END);
        ks.append(errorKey);<commit_msg>jna: nullp fix with final<commit_after>package org.libelektra;

import static org.junit.Assert.*;
import org.junit.Test;
import org.libelektra.exception.KDBException;
import org.libelektra.exception.OutOfMemoryException;
import org.libelektra.exception.ResourceException;
import org.libelektra.exception.SemanticValidationException;

public class ErrorCodeTest {

    private Key parentKey = Key.create("user/tests/javabinding");
    private final String errorMeta = "trigger/error";
    private final String warningMeta = "trigger/warnings";
    private Plugin errorPlugin;

    @Before
    public void setup(){
        errorPlugin = new Plugin("error", parentKey);
    }

    @Test(expected = OutOfMemoryException.class)
    public void kdbSetWithError_shouldMapOutOfMemoryError() throws Exception {
        Key errorKey = Key.create("user/tests/myError");
        errorKey.setMeta(errorMeta, OutOfMemoryException.errorCode());
        final KeySet ks = KeySet.create(10, KeySet.KS_END);
        ks.append(errorKey);
{'fraction_non_alphanumeric': 0.09704433497536946, 'fraction_numerical': 0.0019704433497536944, 'mean_word_length': 4.459677419354839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2772503', 'n_tokens_mistral': 589, 'n_tokens_neox': 574, 'n_words': 126}