<commit_before>/**
 * 
 */
package org.jsapar.schema;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import java.util.Locale;

import org.jsapar.Cell;
import org.jsapar.EmptyCell;
import org.jsapar.FloatCell;
import org.jsapar.IntegerCell;
import org.jsapar.StringCell;
import org.jsapar.Cell.CellType;
import org.jsapar.input.ParseException;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

/**
 * @author stejon0
 * 
 */
public class SchemaCellTest {

    /**
     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
    }

    /**
     * @throws java.lang.Exception
     */
    @After
    public void tearDown() throws Exception {
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#SchemaCell()} .
     */
    @Test
    public void testSchemaCell() {
        TestSchemaCell schemaCell = new TestSchemaCell();
        assertNotNull(schemaCell);
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#SchemaCell(java.lang.String)} .
     */
    @Test
    public void testSchemaCellString() {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        assertNotNull(schemaCell);
        assertEquals("test", schemaCell.getName());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_String() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");

        Cell cell = schemaCell.makeCell("the value");
        assertEquals("the value", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_DefaultString() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultCell(new StringCell("TheDefault"));

        Cell cell = schemaCell.makeCell("");
        assertEquals("TheDefault", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = schemaCell.makeCell("");
        assertEquals("TheDefault", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException 
     */
    @Test
    public void testMakeCell_DefaultValue_float() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.FLOAT, "#.00", new Locale("sv","SE")));
        schemaCell.setName("test");
        schemaCell.setDefaultValue("123456,78901");

        Cell cell = schemaCell.makeCell("");
        assertEquals(123456.78901, ((FloatCell)cell).getNumberValue().doubleValue(), 0.0001);
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_emptyString_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = new StringCell("Test", "");
        assertEquals("TheDefault", schemaCell.format(cell));
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_empty_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = new EmptyCell("Test", CellType.STRING);
        assertEquals("TheDefault", schemaCell.format(cell));
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_empty_no_default() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");

        Cell cell = new EmptyCell("Test", CellType.STRING);
        assertEquals("", schemaCell.format(cell));
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException 
     */
    @Test
    public void testFormat_DefaultValue_float() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.FLOAT, "#.00", new Locale("sv","SE")));
        schemaCell.setName("test");
        schemaCell.setDefaultValue("123456,78901");

        String value = schemaCell.format(new EmptyCell(CellType.FLOAT));
        assertEquals("123456,78901", value);
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException
     */
    @Test
    public void testMakeCell_RegExp() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.STRING, "[A-Z]{3}[0-9]{0,3}de"));
        schemaCell.setName("test");

        Cell cell = schemaCell.makeCell("ABC123de");
        assertEquals("ABC123de", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException
     */
    @Test
    public void testMakeCell_RegExp_fail() throws SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.STRING, "[A-Z]{3}[0-9]{0,3}de"));
        schemaCell.setName("test");

        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = schemaCell.makeCell("AB1C123de");
        } catch (ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Should throw ParseException for invalid RegExp validation.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     * @throws SchemaException
     * @throws ParseException
     */
    @Test
    public void testMakeCell_CellTypeStringStringFormat() throws ParseException, SchemaException,
            java.text.ParseException {
        Cell cell = SchemaCell.makeCell(Cell.CellType.STRING, "test", "the value", Locale.getDefault());
        assertEquals("the value", cell.getStringValue());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     */
    @Test
    public void testMakeCell_UnfinishedInteger() throws SchemaException, ParseException {
        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = SchemaCell.makeCell(Cell.CellType.INTEGER, "number", "123A45", Locale.getDefault());
        } catch (java.text.ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Method should throw exception.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Integer() throws SchemaException, ParseException, java.text.ParseException {
        Cell cell;
        cell = SchemaCell.makeCell(Cell.CellType.INTEGER, "number", "12345", Locale.getDefault());
        assertEquals(12345, cell.getValue());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Integer_DefaultValue() throws SchemaException, ParseException, java.text.ParseException {
        SchemaCell schemaCell = new TestSchemaCell("A number");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setDefaultValue("42");
        Cell cell;
        cell = schemaCell.makeCell("");
        assertEquals(42, cell.getValue());
        assertEquals("A number", cell.getName());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     */
    @Test
    public void testMakeCell_UnfinishedFloat() throws SchemaException, ParseException {
        @SuppressWarnings("unused")
        Cell cell;
        Locale locale = new Locale("UK_en");
        try {
            cell = SchemaCell.makeCell(Cell.CellType.FLOAT, "number", "12.3A45", locale);
        } catch (java.text.ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Method should throw exception.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Float() throws SchemaException, ParseException, java.text.ParseException {
        Cell cell;
        Locale locale = new Locale("UK_en");
        cell = SchemaCell.makeCell(Cell.CellType.FLOAT, "number", "12.345", locale);
        assertEquals(12.345, cell.getValue());
    }

    /**
     * @throws ParseException
     */
    @Test
    public void testMakeCell_Integer_RangeValid() throws ParseException {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(0));
        schemaCell.setMaxValue(new IntegerCell(54321));

        Cell cell = schemaCell.makeCell("12345");
        assertEquals(12345, cell.getValue());

    }

    /**
     * @throws ParseException
     */
    @Ignore("Implementation not ready yet")
    @Test
    public void testMakeCell_Integer_MinRangeNotValid() {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(54321));
        schemaCell.setMaxValue(new IntegerCell(54322));
        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = schemaCell.makeCell("12345");
        } catch (ParseException e) {
            e.printStackTrace();
            return;
        }
        fail("Should throw exception for min value.");

    }

    /**
     * @throws ParseException
     * @throws ParseException
     */
    @Ignore("Implementation not ready yet")
    @Test(expected = ParseException.class)
    public void testMakeCell_Integer_MaxRangeNotValid() throws ParseException {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(0));
        schemaCell.setMaxValue(new IntegerCell(100));
        @SuppressWarnings("unused")
        Cell cell;
        cell = schemaCell.makeCell("12345");

    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#clone()}.
     * 
     * @throws CloneNotSupportedException
     */
    @Test
    public void testClone() throws CloneNotSupportedException {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        TestSchemaCell clone = (TestSchemaCell) schemaCell.clone();
        assertNotNull(clone);
        assertEquals(schemaCell.getName(), clone.getName());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#toString()}.
     */
    @Test
    public void testToString() {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        String s = schemaCell.toString();
        assertNotNull(s);
    }

    /**
     * To be able to have a specific SchemaCell to test.
     * 
     * @author stejon0
     * 
     */
    private class TestSchemaCell extends SchemaCell {

        public TestSchemaCell() {
            super();
        }

        public TestSchemaCell(String name) {
            super(name);
        }

    }

}
<commit_msg>Added test case for missing default value.<commit_after>/**
 * 
 */
package org.jsapar.schema;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import java.util.Locale;

import org.jsapar.Cell;
import org.jsapar.EmptyCell;
import org.jsapar.FloatCell;
import org.jsapar.IntegerCell;
import org.jsapar.StringCell;
import org.jsapar.Cell.CellType;
import org.jsapar.input.ParseException;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

/**
 * @author stejon0
 * 
 */
public class SchemaCellTest {

    /**
     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
    }

    /**
     * @throws java.lang.Exception
     */
    @After
    public void tearDown() throws Exception {
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#SchemaCell()} .
     */
    @Test
    public void testSchemaCell() {
        TestSchemaCell schemaCell = new TestSchemaCell();
        assertNotNull(schemaCell);
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#SchemaCell(java.lang.String)} .
     */
    @Test
    public void testSchemaCellString() {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        assertNotNull(schemaCell);
        assertEquals("test", schemaCell.getName());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_String() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");

        Cell cell = schemaCell.makeCell("the value");
        assertEquals("the value", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_DefaultString() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultCell(new StringCell("TheDefault"));

        Cell cell = schemaCell.makeCell("");
        assertEquals("TheDefault", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_missing_no_default() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");

        Cell cell = schemaCell.makeCell("");
        assertEquals("", cell.getStringValue());
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testMakeCell_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = schemaCell.makeCell("");
        assertEquals("TheDefault", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException 
     */
    @Test
    public void testMakeCell_DefaultValue_float() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.FLOAT, "#.00", new Locale("sv","SE")));
        schemaCell.setName("test");
        schemaCell.setDefaultValue("123456,78901");

        Cell cell = schemaCell.makeCell("");
        assertEquals(123456.78901, ((FloatCell)cell).getNumberValue().doubleValue(), 0.0001);
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_emptyString_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = new StringCell("Test", "");
        assertEquals("TheDefault", schemaCell.format(cell));
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_empty_DefaultValue() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");
        schemaCell.setDefaultValue("TheDefault");

        Cell cell = new EmptyCell("Test", CellType.STRING);
        assertEquals("TheDefault", schemaCell.format(cell));
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     */
    @Test
    public void testFormat_empty_no_default() throws ParseException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setName("test");

        Cell cell = new EmptyCell("Test", CellType.STRING);
        assertEquals("", schemaCell.format(cell));
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException 
     */
    @Test
    public void testFormat_DefaultValue_float() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.FLOAT, "#.00", new Locale("sv","SE")));
        schemaCell.setName("test");
        schemaCell.setDefaultValue("123456,78901");

        String value = schemaCell.format(new EmptyCell(CellType.FLOAT));
        assertEquals("123456,78901", value);
    }
    
    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException
     */
    @Test
    public void testMakeCell_RegExp() throws ParseException, SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.STRING, "[A-Z]{3}[0-9]{0,3}de"));
        schemaCell.setName("test");

        Cell cell = schemaCell.makeCell("ABC123de");
        assertEquals("ABC123de", cell.getStringValue());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#makeCell(java.lang.String)}.
     * 
     * @throws ParseException
     * @throws SchemaException
     */
    @Test
    public void testMakeCell_RegExp_fail() throws SchemaException {
        TestSchemaCell schemaCell = new TestSchemaCell();
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.STRING, "[A-Z]{3}[0-9]{0,3}de"));
        schemaCell.setName("test");

        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = schemaCell.makeCell("AB1C123de");
        } catch (ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Should throw ParseException for invalid RegExp validation.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     * @throws SchemaException
     * @throws ParseException
     */
    @Test
    public void testMakeCell_CellTypeStringStringFormat() throws ParseException, SchemaException,
            java.text.ParseException {
        Cell cell = SchemaCell.makeCell(Cell.CellType.STRING, "test", "the value", Locale.getDefault());
        assertEquals("the value", cell.getStringValue());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     */
    @Test
    public void testMakeCell_UnfinishedInteger() throws SchemaException, ParseException {
        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = SchemaCell.makeCell(Cell.CellType.INTEGER, "number", "123A45", Locale.getDefault());
        } catch (java.text.ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Method should throw exception.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Integer() throws SchemaException, ParseException, java.text.ParseException {
        Cell cell;
        cell = SchemaCell.makeCell(Cell.CellType.INTEGER, "number", "12345", Locale.getDefault());
        assertEquals(12345, cell.getValue());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Integer_DefaultValue() throws SchemaException, ParseException, java.text.ParseException {
        SchemaCell schemaCell = new TestSchemaCell("A number");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setDefaultValue("42");
        Cell cell;
        cell = schemaCell.makeCell("");
        assertEquals(42, cell.getValue());
        assertEquals("A number", cell.getName());
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     */
    @Test
    public void testMakeCell_UnfinishedFloat() throws SchemaException, ParseException {
        @SuppressWarnings("unused")
        Cell cell;
        Locale locale = new Locale("UK_en");
        try {
            cell = SchemaCell.makeCell(Cell.CellType.FLOAT, "number", "12.3A45", locale);
        } catch (java.text.ParseException e) {
            // e.printStackTrace();
            return;
        }
        fail("Method should throw exception.");
    }

    /**
     * Test method for
     * {@link org.jsapar.schema.SchemaCell#makeCell(org.jsapar.Cell.CellType, java.lang.String, java.lang.String, java.text.Format)}
     * .
     * 
     * @throws java.text.ParseException
     */
    @Test
    public void testMakeCell_Float() throws SchemaException, ParseException, java.text.ParseException {
        Cell cell;
        Locale locale = new Locale("UK_en");
        cell = SchemaCell.makeCell(Cell.CellType.FLOAT, "number", "12.345", locale);
        assertEquals(12.345, cell.getValue());
    }

    /**
     * @throws ParseException
     */
    @Test
    public void testMakeCell_Integer_RangeValid() throws ParseException {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(0));
        schemaCell.setMaxValue(new IntegerCell(54321));

        Cell cell = schemaCell.makeCell("12345");
        assertEquals(12345, cell.getValue());

    }

    /**
     * @throws ParseException
     */
    @Ignore("Implementation not ready yet")
    @Test
    public void testMakeCell_Integer_MinRangeNotValid() {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(54321));
        schemaCell.setMaxValue(new IntegerCell(54322));
        @SuppressWarnings("unused")
        Cell cell;
        try {
            cell = schemaCell.makeCell("12345");
        } catch (ParseException e) {
            e.printStackTrace();
            return;
        }
        fail("Should throw exception for min value.");

    }

    /**
     * @throws ParseException
     * @throws ParseException
     */
    @Ignore("Implementation not ready yet")
    @Test(expected = ParseException.class)
    public void testMakeCell_Integer_MaxRangeNotValid() throws ParseException {

        TestSchemaCell schemaCell = new TestSchemaCell("test");
        schemaCell.setCellFormat(new SchemaCellFormat(CellType.INTEGER));
        schemaCell.setMinValue(new IntegerCell(0));
        schemaCell.setMaxValue(new IntegerCell(100));
        @SuppressWarnings("unused")
        Cell cell;
        cell = schemaCell.makeCell("12345");

    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#clone()}.
     * 
     * @throws CloneNotSupportedException
     */
    @Test
    public void testClone() throws CloneNotSupportedException {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        TestSchemaCell clone = (TestSchemaCell) schemaCell.clone();
        assertNotNull(clone);
        assertEquals(schemaCell.getName(), clone.getName());
    }

    /**
     * Test method for {@link org.jsapar.schema.SchemaCell#toString()}.
     */
    @Test
    public void testToString() {
        TestSchemaCell schemaCell = new TestSchemaCell("test");
        String s = schemaCell.toString();
        assertNotNull(s);
    }

    /**
     * To be able to have a specific SchemaCell to test.
     * 
     * @author stejon0
     * 
     */
    private class TestSchemaCell extends SchemaCell {

        public TestSchemaCell() {
            super();
        }

        public TestSchemaCell(String name) {
            super(name);
        }

    }

}

{'fraction_non_alphanumeric': 0.1175648058513499, 'fraction_numerical': 0.010684450181061992, 'mean_word_length': 2.4392108508014796, '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': '4362007', 'n_tokens_mistral': 8127, 'n_tokens_neox': 7639, 'n_words': 1475}