You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2021/01/15 17:39:51 UTC

[jmeter] branch master updated (aa6c763 -> 551339a)

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git.


    from aa6c763  Silence warning of tika about missing sqlite-jdbc dependency
     new 803f69f  Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"
     new 551339a  Remove left-over constant that is not used anymore.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                               |  2 +-
 bin/jmeter                                               |  2 +-
 bin/jmeter.bat                                           |  2 +-
 .../protocol/http/gui/action/ParseCurlCommandAction.java | 16 ++++++++++++++--
 4 files changed, 17 insertions(+), 5 deletions(-)


Re: [jmeter] 01/02: Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"

Posted by Philippe Mouawad <ph...@gmail.com>.
Thanks !

On Fri, Jan 15, 2021 at 7:16 PM Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
> Am 15.01.21 um 19:04 schrieb Felix Schumacher:
> > Am 15.01.21 um 18:52 schrieb Philippe Mouawad:
> >> Hi Felix,
> >> For simplicity and impact on Maven plugin , why not embed
> tika-config.xml
> >> in core (src/main/resources) ?
> >
> > Will try to do it.
>
> Done
>
> Felix
>
> >
> > Felix
> >
> >> Regards
> >>
> >> On Fri, Jan 15, 2021 at 6:39 PM <fs...@apache.org> wrote:
> >>
> >>> This is an automated email from the ASF dual-hosted git repository.
> >>>
> >>> fschumacher pushed a commit to branch master
> >>> in repository https://gitbox.apache.org/repos/asf/jmeter.git
> >>>
> >>> commit 803f69f8484aa34c78ab160d1474db56bf0aff47
> >>> Author: Felix Schumacher <fe...@internetallee.de>
> >>> AuthorDate: Fri Jan 15 15:34:11 2021 +0100
> >>>
> >>>     Partly revert "Silence warning of tika about missing sqlite-jdbc
> >>> dependency"
> >>>
> >>>     This reverts commit aa6c7633d6ff8125d588071cb4739930a847e1fa.
> >>>
> >>>     Instead of using a system property and extending the shell scripts
> to
> >>> start
> >>>     JMeter, we now configure Tika inside the client code directly. The
> used
> >>>     config file stays at the same location and has still the same
> content.
> >>> ---
> >>>  .gitignore                                                |  2 +-
> >>>  bin/jmeter                                                |  2 +-
> >>>  bin/jmeter.bat                                            |  2 +-
> >>>  .../protocol/http/gui/action/ParseCurlCommandAction.java  | 15
> >>> ++++++++++++++-
> >>>  4 files changed, 17 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/.gitignore b/.gitignore
> >>> index 61df09b..21abad6 100644
> >>> --- a/.gitignore
> >>> +++ b/.gitignore
> >>> @@ -51,7 +51,7 @@
> >>>  /bin/*.jmx
> >>>  /bin/*.jtl
> >>>  /bin/*.xml
> >>> -# We need log4j2.xml even though we want to exclude xml created by
> batch
> >>> tests
> >>> +# We need log4j2.xml and tika-config.xml even though we want to
> exclude
> >>> xml created by batch tests
> >>>  !/bin/log4j2.xml
> >>>  !/bin/tika-config.xml
> >>>
> >>> diff --git a/bin/jmeter b/bin/jmeter
> >>> index fae82ff..5d5b949 100755
> >>> --- a/bin/jmeter
> >>> +++ b/bin/jmeter
> >>> @@ -187,7 +187,7 @@ esac
> >>>
> >>>  # Always dump on OOM (does not cost anything unless triggered)
> >>>  DUMP="-XX:+HeapDumpOnOutOfMemoryError"
> >>> -SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom
> >>> -Dtika.config=${JMETER_HOME}/bin/tika-config.xml"
> >>> +SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
> >>>  SERVER="-server"
> >>>
> >>>  if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
> >>> diff --git a/bin/jmeter.bat b/bin/jmeter.bat
> >>> index 2c96b54..80fc534 100644
> >>> --- a/bin/jmeter.bat
> >>> +++ b/bin/jmeter.bat
> >>> @@ -162,7 +162,7 @@ if not defined GC_ALGO (
> >>>      set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100
> >>> -XX:G1ReservePercent=20
> >>>  )
> >>>
> >>> -set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
> >>> -Dtika.config=%JMETER_BIN%tika-config.xml
> >>> +set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
> >>>
> >>>  rem Always dump on OOM (does not cost anything unless triggered)
> >>>  set DUMP=-XX:+HeapDumpOnOutOfMemoryError
> >>> diff --git
> >>>
> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> >>>
> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> >>> index d610b52..d601618 100644
> >>> ---
> >>>
> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> >>> +++
> >>>
> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> >>> @@ -29,6 +29,7 @@ import java.io.IOException;
> >>>  import java.net.MalformedURLException;
> >>>  import java.net.URL;
> >>>  import java.nio.charset.StandardCharsets;
> >>> +import java.nio.file.Paths;
> >>>  import java.text.MessageFormat;
> >>>  import java.time.LocalDateTime;
> >>>  import java.time.format.DateTimeFormatter;
> >>> @@ -104,8 +105,11 @@ import org.apache.jorphan.collections.HashTree;
> >>>  import org.apache.jorphan.gui.ComponentUtil;
> >>>  import org.apache.jorphan.gui.JMeterUIDefaults;
> >>>  import org.apache.tika.Tika;
> >>> +import org.apache.tika.config.TikaConfig;
> >>> +import org.apache.tika.exception.TikaException;
> >>>  import org.slf4j.Logger;
> >>>  import org.slf4j.LoggerFactory;
> >>> +import org.xml.sax.SAXException;
> >>>
> >>>  /**
> >>>   * Opens a popup where user can enter a cURL command line and create a
> >>> test plan
> >>> @@ -130,7 +134,16 @@ public class ParseCurlCommandAction extends
> >>> AbstractAction implements MenuCreato
> >>>      private JSyntaxTextArea cURLCommandTA;
> >>>      private JLabel statusText;
> >>>      private JCheckBox uploadCookiesCheckBox;
> >>> -    private final Tika tika = new Tika();
> >>> +    private final Tika tika = createTika();
> >>> +
> >>> +    private Tika createTika() {
> >>> +        try {
> >>> +            return new Tika(new
> >>> TikaConfig(Paths.get(JMeterUtils.getJMeterBinDir(),
> "tika-config.xml")));
> >>> +        } catch (TikaException | IOException | SAXException e) {
> >>> +            return new Tika();
> >>> +        }
> >>> +    }
> >>> +
> >>>      public ParseCurlCommandAction() {
> >>>          super();
> >>>      }
> >>>
> >>>
>


-- 
Cordialement.
Philippe Mouawad.

Re: [jmeter] 01/02: Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 15.01.21 um 19:04 schrieb Felix Schumacher:
> Am 15.01.21 um 18:52 schrieb Philippe Mouawad:
>> Hi Felix,
>> For simplicity and impact on Maven plugin , why not embed tika-config.xml
>> in core (src/main/resources) ?
>
> Will try to do it.

Done

Felix

>
> Felix
>
>> Regards
>>
>> On Fri, Jan 15, 2021 at 6:39 PM <fs...@apache.org> wrote:
>>
>>> This is an automated email from the ASF dual-hosted git repository.
>>>
>>> fschumacher pushed a commit to branch master
>>> in repository https://gitbox.apache.org/repos/asf/jmeter.git
>>>
>>> commit 803f69f8484aa34c78ab160d1474db56bf0aff47
>>> Author: Felix Schumacher <fe...@internetallee.de>
>>> AuthorDate: Fri Jan 15 15:34:11 2021 +0100
>>>
>>>     Partly revert "Silence warning of tika about missing sqlite-jdbc
>>> dependency"
>>>
>>>     This reverts commit aa6c7633d6ff8125d588071cb4739930a847e1fa.
>>>
>>>     Instead of using a system property and extending the shell scripts to
>>> start
>>>     JMeter, we now configure Tika inside the client code directly. The used
>>>     config file stays at the same location and has still the same content.
>>> ---
>>>  .gitignore                                                |  2 +-
>>>  bin/jmeter                                                |  2 +-
>>>  bin/jmeter.bat                                            |  2 +-
>>>  .../protocol/http/gui/action/ParseCurlCommandAction.java  | 15
>>> ++++++++++++++-
>>>  4 files changed, 17 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/.gitignore b/.gitignore
>>> index 61df09b..21abad6 100644
>>> --- a/.gitignore
>>> +++ b/.gitignore
>>> @@ -51,7 +51,7 @@
>>>  /bin/*.jmx
>>>  /bin/*.jtl
>>>  /bin/*.xml
>>> -# We need log4j2.xml even though we want to exclude xml created by batch
>>> tests
>>> +# We need log4j2.xml and tika-config.xml even though we want to exclude
>>> xml created by batch tests
>>>  !/bin/log4j2.xml
>>>  !/bin/tika-config.xml
>>>
>>> diff --git a/bin/jmeter b/bin/jmeter
>>> index fae82ff..5d5b949 100755
>>> --- a/bin/jmeter
>>> +++ b/bin/jmeter
>>> @@ -187,7 +187,7 @@ esac
>>>
>>>  # Always dump on OOM (does not cost anything unless triggered)
>>>  DUMP="-XX:+HeapDumpOnOutOfMemoryError"
>>> -SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom
>>> -Dtika.config=${JMETER_HOME}/bin/tika-config.xml"
>>> +SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
>>>  SERVER="-server"
>>>
>>>  if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
>>> diff --git a/bin/jmeter.bat b/bin/jmeter.bat
>>> index 2c96b54..80fc534 100644
>>> --- a/bin/jmeter.bat
>>> +++ b/bin/jmeter.bat
>>> @@ -162,7 +162,7 @@ if not defined GC_ALGO (
>>>      set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100
>>> -XX:G1ReservePercent=20
>>>  )
>>>
>>> -set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
>>> -Dtika.config=%JMETER_BIN%tika-config.xml
>>> +set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
>>>
>>>  rem Always dump on OOM (does not cost anything unless triggered)
>>>  set DUMP=-XX:+HeapDumpOnOutOfMemoryError
>>> diff --git
>>> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>>> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>>> index d610b52..d601618 100644
>>> ---
>>> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>>> +++
>>> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>>> @@ -29,6 +29,7 @@ import java.io.IOException;
>>>  import java.net.MalformedURLException;
>>>  import java.net.URL;
>>>  import java.nio.charset.StandardCharsets;
>>> +import java.nio.file.Paths;
>>>  import java.text.MessageFormat;
>>>  import java.time.LocalDateTime;
>>>  import java.time.format.DateTimeFormatter;
>>> @@ -104,8 +105,11 @@ import org.apache.jorphan.collections.HashTree;
>>>  import org.apache.jorphan.gui.ComponentUtil;
>>>  import org.apache.jorphan.gui.JMeterUIDefaults;
>>>  import org.apache.tika.Tika;
>>> +import org.apache.tika.config.TikaConfig;
>>> +import org.apache.tika.exception.TikaException;
>>>  import org.slf4j.Logger;
>>>  import org.slf4j.LoggerFactory;
>>> +import org.xml.sax.SAXException;
>>>
>>>  /**
>>>   * Opens a popup where user can enter a cURL command line and create a
>>> test plan
>>> @@ -130,7 +134,16 @@ public class ParseCurlCommandAction extends
>>> AbstractAction implements MenuCreato
>>>      private JSyntaxTextArea cURLCommandTA;
>>>      private JLabel statusText;
>>>      private JCheckBox uploadCookiesCheckBox;
>>> -    private final Tika tika = new Tika();
>>> +    private final Tika tika = createTika();
>>> +
>>> +    private Tika createTika() {
>>> +        try {
>>> +            return new Tika(new
>>> TikaConfig(Paths.get(JMeterUtils.getJMeterBinDir(), "tika-config.xml")));
>>> +        } catch (TikaException | IOException | SAXException e) {
>>> +            return new Tika();
>>> +        }
>>> +    }
>>> +
>>>      public ParseCurlCommandAction() {
>>>          super();
>>>      }
>>>
>>>

Re: [jmeter] 01/02: Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 15.01.21 um 18:52 schrieb Philippe Mouawad:
> Hi Felix,
> For simplicity and impact on Maven plugin , why not embed tika-config.xml
> in core (src/main/resources) ?


Will try to do it.

Felix

>
> Regards
>
> On Fri, Jan 15, 2021 at 6:39 PM <fs...@apache.org> wrote:
>
>> This is an automated email from the ASF dual-hosted git repository.
>>
>> fschumacher pushed a commit to branch master
>> in repository https://gitbox.apache.org/repos/asf/jmeter.git
>>
>> commit 803f69f8484aa34c78ab160d1474db56bf0aff47
>> Author: Felix Schumacher <fe...@internetallee.de>
>> AuthorDate: Fri Jan 15 15:34:11 2021 +0100
>>
>>     Partly revert "Silence warning of tika about missing sqlite-jdbc
>> dependency"
>>
>>     This reverts commit aa6c7633d6ff8125d588071cb4739930a847e1fa.
>>
>>     Instead of using a system property and extending the shell scripts to
>> start
>>     JMeter, we now configure Tika inside the client code directly. The used
>>     config file stays at the same location and has still the same content.
>> ---
>>  .gitignore                                                |  2 +-
>>  bin/jmeter                                                |  2 +-
>>  bin/jmeter.bat                                            |  2 +-
>>  .../protocol/http/gui/action/ParseCurlCommandAction.java  | 15
>> ++++++++++++++-
>>  4 files changed, 17 insertions(+), 4 deletions(-)
>>
>> diff --git a/.gitignore b/.gitignore
>> index 61df09b..21abad6 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -51,7 +51,7 @@
>>  /bin/*.jmx
>>  /bin/*.jtl
>>  /bin/*.xml
>> -# We need log4j2.xml even though we want to exclude xml created by batch
>> tests
>> +# We need log4j2.xml and tika-config.xml even though we want to exclude
>> xml created by batch tests
>>  !/bin/log4j2.xml
>>  !/bin/tika-config.xml
>>
>> diff --git a/bin/jmeter b/bin/jmeter
>> index fae82ff..5d5b949 100755
>> --- a/bin/jmeter
>> +++ b/bin/jmeter
>> @@ -187,7 +187,7 @@ esac
>>
>>  # Always dump on OOM (does not cost anything unless triggered)
>>  DUMP="-XX:+HeapDumpOnOutOfMemoryError"
>> -SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom
>> -Dtika.config=${JMETER_HOME}/bin/tika-config.xml"
>> +SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
>>  SERVER="-server"
>>
>>  if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
>> diff --git a/bin/jmeter.bat b/bin/jmeter.bat
>> index 2c96b54..80fc534 100644
>> --- a/bin/jmeter.bat
>> +++ b/bin/jmeter.bat
>> @@ -162,7 +162,7 @@ if not defined GC_ALGO (
>>      set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100
>> -XX:G1ReservePercent=20
>>  )
>>
>> -set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
>> -Dtika.config=%JMETER_BIN%tika-config.xml
>> +set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
>>
>>  rem Always dump on OOM (does not cost anything unless triggered)
>>  set DUMP=-XX:+HeapDumpOnOutOfMemoryError
>> diff --git
>> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>> index d610b52..d601618 100644
>> ---
>> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>> +++
>> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
>> @@ -29,6 +29,7 @@ import java.io.IOException;
>>  import java.net.MalformedURLException;
>>  import java.net.URL;
>>  import java.nio.charset.StandardCharsets;
>> +import java.nio.file.Paths;
>>  import java.text.MessageFormat;
>>  import java.time.LocalDateTime;
>>  import java.time.format.DateTimeFormatter;
>> @@ -104,8 +105,11 @@ import org.apache.jorphan.collections.HashTree;
>>  import org.apache.jorphan.gui.ComponentUtil;
>>  import org.apache.jorphan.gui.JMeterUIDefaults;
>>  import org.apache.tika.Tika;
>> +import org.apache.tika.config.TikaConfig;
>> +import org.apache.tika.exception.TikaException;
>>  import org.slf4j.Logger;
>>  import org.slf4j.LoggerFactory;
>> +import org.xml.sax.SAXException;
>>
>>  /**
>>   * Opens a popup where user can enter a cURL command line and create a
>> test plan
>> @@ -130,7 +134,16 @@ public class ParseCurlCommandAction extends
>> AbstractAction implements MenuCreato
>>      private JSyntaxTextArea cURLCommandTA;
>>      private JLabel statusText;
>>      private JCheckBox uploadCookiesCheckBox;
>> -    private final Tika tika = new Tika();
>> +    private final Tika tika = createTika();
>> +
>> +    private Tika createTika() {
>> +        try {
>> +            return new Tika(new
>> TikaConfig(Paths.get(JMeterUtils.getJMeterBinDir(), "tika-config.xml")));
>> +        } catch (TikaException | IOException | SAXException e) {
>> +            return new Tika();
>> +        }
>> +    }
>> +
>>      public ParseCurlCommandAction() {
>>          super();
>>      }
>>
>>

Re: [jmeter] 01/02: Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"

Posted by Philippe Mouawad <ph...@gmail.com>.
Hi Felix,
For simplicity and impact on Maven plugin , why not embed tika-config.xml
in core (src/main/resources) ?

Regards

On Fri, Jan 15, 2021 at 6:39 PM <fs...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> fschumacher pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/jmeter.git
>
> commit 803f69f8484aa34c78ab160d1474db56bf0aff47
> Author: Felix Schumacher <fe...@internetallee.de>
> AuthorDate: Fri Jan 15 15:34:11 2021 +0100
>
>     Partly revert "Silence warning of tika about missing sqlite-jdbc
> dependency"
>
>     This reverts commit aa6c7633d6ff8125d588071cb4739930a847e1fa.
>
>     Instead of using a system property and extending the shell scripts to
> start
>     JMeter, we now configure Tika inside the client code directly. The used
>     config file stays at the same location and has still the same content.
> ---
>  .gitignore                                                |  2 +-
>  bin/jmeter                                                |  2 +-
>  bin/jmeter.bat                                            |  2 +-
>  .../protocol/http/gui/action/ParseCurlCommandAction.java  | 15
> ++++++++++++++-
>  4 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index 61df09b..21abad6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -51,7 +51,7 @@
>  /bin/*.jmx
>  /bin/*.jtl
>  /bin/*.xml
> -# We need log4j2.xml even though we want to exclude xml created by batch
> tests
> +# We need log4j2.xml and tika-config.xml even though we want to exclude
> xml created by batch tests
>  !/bin/log4j2.xml
>  !/bin/tika-config.xml
>
> diff --git a/bin/jmeter b/bin/jmeter
> index fae82ff..5d5b949 100755
> --- a/bin/jmeter
> +++ b/bin/jmeter
> @@ -187,7 +187,7 @@ esac
>
>  # Always dump on OOM (does not cost anything unless triggered)
>  DUMP="-XX:+HeapDumpOnOutOfMemoryError"
> -SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom
> -Dtika.config=${JMETER_HOME}/bin/tika-config.xml"
> +SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
>  SERVER="-server"
>
>  if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
> diff --git a/bin/jmeter.bat b/bin/jmeter.bat
> index 2c96b54..80fc534 100644
> --- a/bin/jmeter.bat
> +++ b/bin/jmeter.bat
> @@ -162,7 +162,7 @@ if not defined GC_ALGO (
>      set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100
> -XX:G1ReservePercent=20
>  )
>
> -set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
> -Dtika.config=%JMETER_BIN%tika-config.xml
> +set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
>
>  rem Always dump on OOM (does not cost anything unless triggered)
>  set DUMP=-XX:+HeapDumpOnOutOfMemoryError
> diff --git
> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> index d610b52..d601618 100644
> ---
> a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> +++
> b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
> @@ -29,6 +29,7 @@ import java.io.IOException;
>  import java.net.MalformedURLException;
>  import java.net.URL;
>  import java.nio.charset.StandardCharsets;
> +import java.nio.file.Paths;
>  import java.text.MessageFormat;
>  import java.time.LocalDateTime;
>  import java.time.format.DateTimeFormatter;
> @@ -104,8 +105,11 @@ import org.apache.jorphan.collections.HashTree;
>  import org.apache.jorphan.gui.ComponentUtil;
>  import org.apache.jorphan.gui.JMeterUIDefaults;
>  import org.apache.tika.Tika;
> +import org.apache.tika.config.TikaConfig;
> +import org.apache.tika.exception.TikaException;
>  import org.slf4j.Logger;
>  import org.slf4j.LoggerFactory;
> +import org.xml.sax.SAXException;
>
>  /**
>   * Opens a popup where user can enter a cURL command line and create a
> test plan
> @@ -130,7 +134,16 @@ public class ParseCurlCommandAction extends
> AbstractAction implements MenuCreato
>      private JSyntaxTextArea cURLCommandTA;
>      private JLabel statusText;
>      private JCheckBox uploadCookiesCheckBox;
> -    private final Tika tika = new Tika();
> +    private final Tika tika = createTika();
> +
> +    private Tika createTika() {
> +        try {
> +            return new Tika(new
> TikaConfig(Paths.get(JMeterUtils.getJMeterBinDir(), "tika-config.xml")));
> +        } catch (TikaException | IOException | SAXException e) {
> +            return new Tika();
> +        }
> +    }
> +
>      public ParseCurlCommandAction() {
>          super();
>      }
>
>

-- 
Cordialement.
Philippe Mouawad.

[jmeter] 01/02: Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"

Posted by fs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 803f69f8484aa34c78ab160d1474db56bf0aff47
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Fri Jan 15 15:34:11 2021 +0100

    Partly revert "Silence warning of tika about missing sqlite-jdbc dependency"
    
    This reverts commit aa6c7633d6ff8125d588071cb4739930a847e1fa.
    
    Instead of using a system property and extending the shell scripts to start
    JMeter, we now configure Tika inside the client code directly. The used
    config file stays at the same location and has still the same content.
---
 .gitignore                                                |  2 +-
 bin/jmeter                                                |  2 +-
 bin/jmeter.bat                                            |  2 +-
 .../protocol/http/gui/action/ParseCurlCommandAction.java  | 15 ++++++++++++++-
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index 61df09b..21abad6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,7 +51,7 @@
 /bin/*.jmx
 /bin/*.jtl
 /bin/*.xml
-# We need log4j2.xml even though we want to exclude xml created by batch tests
+# We need log4j2.xml and tika-config.xml even though we want to exclude xml created by batch tests
 !/bin/log4j2.xml
 !/bin/tika-config.xml
 
diff --git a/bin/jmeter b/bin/jmeter
index fae82ff..5d5b949 100755
--- a/bin/jmeter
+++ b/bin/jmeter
@@ -187,7 +187,7 @@ esac
 
 # Always dump on OOM (does not cost anything unless triggered)
 DUMP="-XX:+HeapDumpOnOutOfMemoryError"
-SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom -Dtika.config=${JMETER_HOME}/bin/tika-config.xml"
+SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
 SERVER="-server"
 
 if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
diff --git a/bin/jmeter.bat b/bin/jmeter.bat
index 2c96b54..80fc534 100644
--- a/bin/jmeter.bat
+++ b/bin/jmeter.bat
@@ -162,7 +162,7 @@ if not defined GC_ALGO (
     set GC_ALGO=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1ReservePercent=20
 )
 
-set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom -Dtika.config=%JMETER_BIN%tika-config.xml
+set SYSTEM_PROPS=-Djava.security.egd=file:/dev/urandom
 
 rem Always dump on OOM (does not cost anything unless triggered)
 set DUMP=-XX:+HeapDumpOnOutOfMemoryError
diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
index d610b52..d601618 100644
--- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
+++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
@@ -29,6 +29,7 @@ import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Paths;
 import java.text.MessageFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -104,8 +105,11 @@ import org.apache.jorphan.collections.HashTree;
 import org.apache.jorphan.gui.ComponentUtil;
 import org.apache.jorphan.gui.JMeterUIDefaults;
 import org.apache.tika.Tika;
+import org.apache.tika.config.TikaConfig;
+import org.apache.tika.exception.TikaException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.xml.sax.SAXException;
 
 /**
  * Opens a popup where user can enter a cURL command line and create a test plan
@@ -130,7 +134,16 @@ public class ParseCurlCommandAction extends AbstractAction implements MenuCreato
     private JSyntaxTextArea cURLCommandTA;
     private JLabel statusText;
     private JCheckBox uploadCookiesCheckBox;
-    private final Tika tika = new Tika();
+    private final Tika tika = createTika();
+
+    private Tika createTika() {
+        try {
+            return new Tika(new TikaConfig(Paths.get(JMeterUtils.getJMeterBinDir(), "tika-config.xml")));
+        } catch (TikaException | IOException | SAXException e) {
+            return new Tika();
+        }
+    }
+
     public ParseCurlCommandAction() {
         super();
     }


[jmeter] 02/02: Remove left-over constant that is not used anymore.

Posted by fs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 551339a0fce6bb84d72982772951f11ba3a8a5a1
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Fri Jan 15 18:38:23 2021 +0100

    Remove left-over constant that is not used anymore.
    
    Cleanup after commit f045cf5e1604c68b7d43986fe9bd82a102fa2b76
    Bugzilla Id: 65024
---
 .../apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java   | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
index d601618..1979a61 100644
--- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
+++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/gui/action/ParseCurlCommandAction.java
@@ -123,7 +123,6 @@ public class ParseCurlCommandAction extends AbstractAction implements MenuCreato
     private static final Set<String> commands = new HashSet<>();
     public static final String IMPORT_CURL = "import_curl";
     private static final String CREATE_REQUEST = "CREATE_REQUEST";
-    private static final String TYPE_FORM = ";type=";
     private static final String CERT = "cert";
     private Logger log = LoggerFactory.getLogger(getClass());
     /** A panel allowing results to be saved. */