<commit_before>/*
 * IoT - Industrial Internet Framework
 * Apache License Version 2.0, January 2004
 * Released as a part of Helsinki University
 * Software Engineering Lab in summer 2015
 */
package fi.iot.iiframework.dataobject;

import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Random;
import java.util.UUID;

public class DataObjectFactoryTest {
    
    private DataObject obj;

    @Before
    public void setUp() {
        obj = DataObjectFactory.getRandomDataObject();
    }

    @Test
    public void headerIsGeneratedProperly() {
        assertTrue(obj.getHeader().getUptime() > 1000 && obj.getHeader().getUptime() < 10000);
        assertEquals("success", obj.getHeader().getResponse());
    }<commit_msg>dataobjectfactorytest is finished<commit_after>/*
 * IoT - Industrial Internet Framework
 * Apache License Version 2.0, January 2004
 * Released as a part of Helsinki University
 * Software Engineering Lab in summer 2015
 */
package fi.iot.iiframework.dataobject;

import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Random;
import java.util.UUID;

public class DataObjectFactoryTest {
    
    private DataObject obj;

    @Before
    public void setUp() {
        obj = DataObjectFactory.getRandomDataObject();
    }

    @Test
    public void headerIsGeneratedProperly() {
        assertTrue(obj.getHeader().getUptime() > 1000 && obj.getHeader().getUptime() < 10000);
        assertEquals("success", obj.getHeader().getResponse());
    }
    
    @Test
    public void devicesAreGeneratedProperly() {
        assertEquals(10, obj.getDevices().size());
        assertTrue(obj.getDevices().get(0).status);
        assertNotEquals(null, obj.getDevices().get(0).id);
    }
    
    @Test
    public void sensorsAreGeneratedProperly() {
        assertEquals(10, obj.getDevices().get(0).getSensors().size());
        assertNotEquals(null, obj.getDevices().get(0).getSensors().get(0));
    }
    
    @Test
    public void readoutsAreGeneratedProperly() {
        assertEquals(25, obj.getDevices().get(0).getSensors().get(0).getReadouts().size());
        assertEquals("Temperature", obj.getDevices().get(0).getSensors().get(0).getReadouts().get(0).quantity);
        assertEquals("C", obj.getDevices().get(0).getSensors().get(0).getReadouts().get(0).unit);
        assertTrue(obj.getDevices().get(0).getSensors().get(0).getReadouts().get(0).value >= 22.1 && obj.getDevices().get(0).getSensors().get(0).getReadouts().get(0).value <= 23.1);
    }
{'fraction_non_alphanumeric': 0.14093457943925233, 'fraction_numerical': 0.025794392523364486, 'mean_word_length': 3.7615658362989324, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6748674', 'n_tokens_mistral': 851, 'n_tokens_neox': 795, 'n_words': 159}