<commit_before>package org.estatio.services.documents;

import java.util.List;
import java.util.Map;
import com.google.common.collect.Maps;
import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.chemistry.opencmis.client.api.ItemIterable;
import org.apache.chemistry.opencmis.client.api.QueryResult;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.data.PropertyData;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

public class DocumentContributionsTest_relevantDocuments {

    private DocumentContributions documentContributions;
    private DocumentViewModelFactory documentViewModelFactory;
    private CmisRepository cmisRepository;

    private boolean pingSucceeded;

    @Before
    public void setUp() throws Exception {
        cmisRepository = new CmisRepository();
        Map<String, String> properties = Maps.newLinkedHashMap();

        documentViewModelFactory = new DocumentViewModelFactory();
        documentContributions = new DocumentContributions();
        documentContributions.cmisRepository = cmisRepository;

        try {
            cmisRepository.init(properties);
            pingSucceeded = true;
        } catch (Exception e) {
            pingSucceeded = false;
        }
        Assume.assumeTrue("Ping to CMIS repository", pingSucceeded);
    }
    
    @Test
    public void testRelevantDocuments() {
//        Property property = new Property();
//        property.setCity("Oxford");
        String queryFor = "SELECT * FROM cmis:document WHERE CONTAINS('Oxford')"; 
        ItemIterable<QueryResult> results = cmisRepository.query(queryFor);
        for (QueryResult qr : results) {
            System.out.println("--------------");
            System.out.println(qr.toString());
            List<PropertyData<?>> properties = qr.getProperties();
            for (PropertyData<?> propertyData : properties) {
                System.out.println("  " + propertyData.getId() + ": " + propertyData.getValues());
            }
            ;
            String cmisId = qr.getPropertyValueById(PropertyIds.OBJECT_ID);
            CmisObject obj = cmisRepository.findById(cmisId);
            //String name = obj.getName();
            Object name = obj.getPropertyValue(PropertyIds.NAME);
            System.out.println("  NAME = " + name);
        }
    }

}
<commit_msg>Marking the DocumentationContributions test to @Ignore<commit_after>package org.estatio.services.documents;

import java.util.List;
import java.util.Map;
import com.google.common.collect.Maps;
import org.apache.chemistry.opencmis.client.api.CmisObject;
import org.apache.chemistry.opencmis.client.api.ItemIterable;
import org.apache.chemistry.opencmis.client.api.QueryResult;
import org.apache.chemistry.opencmis.commons.PropertyIds;
import org.apache.chemistry.opencmis.commons.data.PropertyData;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

public class DocumentContributionsTest_relevantDocuments {

    private DocumentContributions documentContributions;
    private DocumentViewModelFactory documentViewModelFactory;
    private CmisRepository cmisRepository;

    private boolean pingSucceeded;

    @Before
    public void setUp() throws Exception {
        cmisRepository = new CmisRepository();
        Map<String, String> properties = Maps.newLinkedHashMap();

        documentViewModelFactory = new DocumentViewModelFactory();
        documentContributions = new DocumentContributions();
        documentContributions.cmisRepository = cmisRepository;

        try {
            cmisRepository.init(properties);
            pingSucceeded = true;
        } catch (Exception e) {
            pingSucceeded = false;
        }
        Assume.assumeTrue("Ping to CMIS repository", pingSucceeded);
    }

    @Ignore("just a spike...")
    @Test
    public void testRelevantDocuments() {
//        Property property = new Property();
//        property.setCity("Oxford");
        String queryFor = "SELECT * FROM cmis:document WHERE CONTAINS('Oxford')"; 
        ItemIterable<QueryResult> results = cmisRepository.query(queryFor);
        for (QueryResult qr : results) {
            System.out.println("--------------");
            System.out.println(qr.toString());
            List<PropertyData<?>> properties = qr.getProperties();
            for (PropertyData<?> propertyData : properties) {
                System.out.println("  " + propertyData.getId() + ": " + propertyData.getValues());
            }
            String cmisId = qr.getPropertyValueById(PropertyIds.OBJECT_ID);
            CmisObject obj = cmisRepository.findById(cmisId);
            //String name = obj.getName();
            Object name = obj.getPropertyValue(PropertyIds.NAME);
            System.out.println("  NAME = " + name);
        }
    }

}

{'fraction_non_alphanumeric': 0.1072084949969369, 'fraction_numerical': 0.0, 'mean_word_length': 2.9659919028340083, 'pattern_counts': {'":': 2, '<': 13, '<?xml version=': 0, '>': 13, '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': '4337881', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1289, 'n_words': 258}