<commit_before>package org.geocommands.vector

import org.geocommands.BaseTest
import org.geocommands.vector.DataStoreParametersCommand.DataStoreParametersOptions
import org.junit.Test

import static org.junit.Assert.assertEquals

/**
 * The DataStoreParametersCommand Unit Test
 * @author <NAME>
 */
class DataStoreParametersCommandTest extends BaseTest {

    @Test
    void executeToCsv() {
        DataStoreParametersCommand cmd = new DataStoreParametersCommand()
        DataStoreParametersOptions options = new DataStoreParametersOptions(name: "Shapefile")
        StringWriter w = new StringWriter()
        cmd.execute(options, new StringReader(""), w)
        assertStringsEqual """url
namespace
enable spatial index
create spatial index
use a ODBC provider to fast execution of Dbase filters
charset
timezone
memory mapped buffer
cache and reuse memory maps
filetype
fstype""", w.toString()

    }

    @Test
    void runAsCommandLine() {
        String str = runApp(["vector datastoreparams", "-n", "Shapefile"], "")
        assertStringsEqual """url
namespace
enable spatial index
create spatial index
use a ODBC provider to fast execution of Dbase filters
charset
timezone
memory mapped buffer<commit_msg>Fix failing test'<commit_after>package org.geocommands.vector

import org.geocommands.BaseTest
import org.geocommands.vector.DataStoreParametersCommand.DataStoreParametersOptions
import org.junit.Test

import static org.junit.Assert.assertEquals

/**
 * The DataStoreParametersCommand Unit Test
 * @author <NAME>
 */
class DataStoreParametersCommandTest extends BaseTest {

    @Test
    void executeToCsv() {
        DataStoreParametersCommand cmd = new DataStoreParametersCommand()
        DataStoreParametersOptions options = new DataStoreParametersOptions(name: "Shapefile")
        StringWriter w = new StringWriter()
        cmd.execute(options, new StringReader(""), w)
        println w.toString()
        assertStringsEqual """url
namespace
enable spatial index
create spatial index
charset
timezone
memory mapped buffer
cache and reuse memory maps
filetype
fstype""", w.toString()

    }

    @Test
    void runAsCommandLine() {
        String str = runApp(["vector datastoreparams", "-n", "Shapefile"], "")
        assertStringsEqual """url
namespace
enable spatial index
create spatial index
charset
timezone
memory mapped buffer
{'fraction_non_alphanumeric': 0.07545570156846121, 'fraction_numerical': 0.0, 'mean_word_length': 4.412844036697248, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4444243', 'n_tokens_mistral': 622, 'n_tokens_neox': 598, 'n_words': 195}