<commit_before>package io.vrap.rmf.raml.persistence.constructor;

import io.vrap.rmf.raml.persistence.RamlResourceSet;
import io.vrap.rmf.raml.persistence.ResourceFixtures;
import io.vrap.rmf.raml.persistence.antlr.RAMLCustomLexer;
import io.vrap.rmf.raml.persistence.antlr.RAMLParser;
import io.vrap.rmf.raml.persistence.antlr.RAMLParserFixtures;
import org.antlr.v4.runtime.CommonTokenFactory;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.TokenStream;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.URIConverter;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class TypeDeclarationResolverTest implements RAMLParserFixtures, ResourceFixtures {

    @Test
    public void api() {
        final URI apiUri = URI.createFileURI("/Users/mkoester/Development/commercetools-api-reference/api.raml");
        final URIConverter uriConverter = new RamlResourceSet().getURIConverter();
        final RAMLCustomLexer lexer = new RAMLCustomLexer(apiUri, uriConverter);
        lexer.setTokenFactory(CommonTokenFactory.DEFAULT);

        final TokenStream tokenStream = new CommonTokenStream(lexer);

        final RAMLParser parser = new RAMLParser(tokenStream);

        final RAMLParser.ApiContext api = parser.api();
<commit_msg>Run test only on my computer.<commit_after>package io.vrap.rmf.raml.persistence.constructor;

import io.vrap.rmf.raml.persistence.RamlResourceSet;
import io.vrap.rmf.raml.persistence.ResourceFixtures;
import io.vrap.rmf.raml.persistence.antlr.RAMLCustomLexer;
import io.vrap.rmf.raml.persistence.antlr.RAMLParser;
import io.vrap.rmf.raml.persistence.antlr.RAMLParserFixtures;
import org.antlr.v4.runtime.CommonTokenFactory;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.TokenStream;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.URIConverter;
import org.junit.Test;

import java.io.File;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeTrue;

public class TypeDeclarationResolverTest implements RAMLParserFixtures, ResourceFixtures {

    @Test
    public void api() {
        final File apiFile = new File("/Users/mkoester/Development/commercetools-api-reference/api.raml");
        assumeTrue(apiFile.exists());

        final URI apiUri = URI.createURI(apiFile.toURI().toString());
        final URIConverter uriConverter = new RamlResourceSet().getURIConverter();
        final RAMLCustomLexer lexer = new RAMLCustomLexer(apiUri, uriConverter);
        lexer.setTokenFactory(CommonTokenFactory.DEFAULT);

        final TokenStream tokenStream = new CommonTokenStream(lexer);

        final RAMLParser parser = new RAMLParser(tokenStream);

        final RAMLParser.ApiContext api = parser.api();

{'fraction_non_alphanumeric': 0.10098942340498124, 'fraction_numerical': 0.0020470829068577278, 'mean_word_length': 4.829025844930418, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2410410', 'n_tokens_mistral': 941, 'n_tokens_neox': 921, 'n_words': 154}