<commit_before>package com.timgroup.tucker.info.component;

import org.junit.Test;

import com.timgroup.tucker.info.Status;
import com.timgroup.tucker.info.component.JarVersionComponent;

import static org.junit.Assert.assertEquals;

public class JarVersionComponentTest {
    
    @Test
    public void defaultIdAndLabelAreSuitable() throws Exception {
        assertEquals("version", new JarVersionComponent(String.class).getId());
        assertEquals("Version", new JarVersionComponent(String.class).getLabel());
    }
    
    @Test
    public void reportStatusIsInfo() throws Exception {
        assertEquals(Status.INFO, new JarVersionComponent(String.class).getReport().getStatus());
    }
    
    @Test
    public void reportValueIsImplementationVersionOfPackageContainingAnchorClass() throws Exception {
        String jdkVersion = System.getProperty("java.version");
        assertEquals(jdkVersion, new JarVersionComponent(String.class).getReport().getValue());
    }
    
}<commit_msg>Java 9 doesn't return the JVM version as the implementation-version of String<commit_after>package com.timgroup.tucker.info.component;

import com.timgroup.tucker.info.Status;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeFalse;

public class JarVersionComponentTest {
    
    @Test
    public void defaultIdAndLabelAreSuitable() throws Exception {
        assertEquals("version", new JarVersionComponent(String.class).getId());
        assertEquals("Version", new JarVersionComponent(String.class).getLabel());
    }
    
    @Test
    public void reportStatusIsInfo() throws Exception {
        assertEquals(Status.INFO, new JarVersionComponent(String.class).getReport().getStatus());
    }
    
    @Test
    public void reportValueIsImplementationVersionOfPackageContainingAnchorClass() throws Exception {
        String jdkVersion = System.getProperty("java.version");
        assumeFalse("Doesn't work like this on Java 9", jdkVersion.startsWith("9."));
        assertEquals(jdkVersion, new JarVersionComponent(String.class).getReport().getValue());
    }
    
}
{'fraction_non_alphanumeric': 0.10197368421052631, 'fraction_numerical': 0.0014097744360902255, 'mean_word_length': 4.309226932668329, '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': '4743293', 'n_tokens_mistral': 557, 'n_tokens_neox': 554, 'n_words': 114}