Skip to content

Commit

Permalink
Release version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
twasyl committed Dec 19, 2016
1 parent 15a018b commit 00359b4
Show file tree
Hide file tree
Showing 13 changed files with 449 additions and 102 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -48,7 +48,7 @@ java -jar jstackfx-<version>.jar --pid=<pid of the process to dump>

# Usage

## Searching
## SearchingF

Use the search bar in JStackFX to filter results. A query must have the following syntax:

Expand All @@ -68,11 +68,12 @@ fieldName comparator value operand fieldName comparator value ...

# Release notes

## Version @@NEXT-VERSION@@
## Version 1.3

**New and noteworthy:**

* Support for operators `<=`, `<`, `>=` and `>`
* UI improvements

## Version 1.2

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
@@ -1,5 +1,5 @@
group 'io.twasyl'
version '@@NEXT-VERSION@@'
version '1.3'

apply plugin: 'java'
apply plugin: 'distribution'
Expand All @@ -17,7 +17,7 @@ dependencies {
}

wrapper {
gradleVersion = '3.2'
gradleVersion = '3.2.1'
}

jar {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
20 changes: 11 additions & 9 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,16 +154,18 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Escape application args
for s in "${@}" ; do
s=\"$s\"
APP_ARGS=$APP_ARGS" "$s
done

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
168 changes: 84 additions & 84 deletions gradlew.bat
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
2 changes: 1 addition & 1 deletion src/main/java/io/twasyl/jstackfx/JStackFX.java
Expand Up @@ -66,7 +66,7 @@ public void start(Stage stage) throws Exception {

stage.setScene(scene);
stage.setTitle("JStackFX");
stage.setMaximized(true);
// stage.setMaximized(true);
stage.show();
}

Expand Down
Expand Up @@ -161,6 +161,7 @@ protected void writeToDumpFile(final File dumpFile, final Dump dump) throws IOEx
}

protected void clearUI() {
this.searchField.clear();
this.threadElementDetails.getChildren().clear();
this.threadElementSource.setText("");
}
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/io/twasyl/jstackfx/ui/SearchField.java
Expand Up @@ -97,6 +97,13 @@ protected void initializeNumberOfResults() {
this.numberOfResults.textProperty().bind(this.resultsProperty().sizeProperty().asString().concat("/").concat(this.dataSetProperty().sizeProperty().asString()));
}

/**
* Clear the content of the search field.
*/
public void clear() {
this.textField.clear();
}

public DoubleProperty prefColumnCountProperty() {
return prefColumnCount;
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/io/twasyl/jstackfx/ui/cells/StateCell.java
Expand Up @@ -39,7 +39,7 @@ protected void updateItem(Thread.State item, boolean empty) {

if (icon != null) {
final OctIconView displayedIcon = new OctIconView(icon);
displayedIcon.setGlyphSize(20);
displayedIcon.setGlyphSize(18);
this.setGraphic(displayedIcon);
} else {
this.setGraphic(null);
Expand All @@ -48,6 +48,4 @@ protected void updateItem(Thread.State item, boolean empty) {
setGraphic(null);
}
}


}
60 changes: 60 additions & 0 deletions src/test/java/io/twasyl/jstackfx/search/ComparatorTest.java
Expand Up @@ -52,4 +52,64 @@ public void testDifferentWithStates() {
public void testDifferentWithEqualStates() {
assertFalse(Comparator.DIFFERENT.evaluate(Thread.State.NEW, Thread.State.NEW));
}

@Test
public void testLower() {
assertTrue(Comparator.LESS.evaluate(1, 2));
}

@Test
public void testLowerWhenNot() {
assertFalse(Comparator.LESS.evaluate(2, 1));
}

@Test
public void testLowerWhenEqual() {
assertFalse(Comparator.LESS.evaluate(1, 1));
}

@Test
public void testLowerOrEqual() {
assertTrue(Comparator.LESS_OR_EQUAL.evaluate(1, 2));
}

@Test
public void testLowerOrEqualWhenNot() {
assertFalse(Comparator.LESS_OR_EQUAL.evaluate(2, 1));
}

@Test
public void testLowerOrEqualWhenEqual() {
assertTrue(Comparator.LESS_OR_EQUAL.evaluate(1, 1));
}

@Test
public void testGreater() {
assertTrue(Comparator.GREATER.evaluate(2, 1));
}

@Test
public void testGreaterWhenNot() {
assertFalse(Comparator.GREATER.evaluate(1, 2));
}

@Test
public void testGreaterWhenEqual() {
assertFalse(Comparator.GREATER.evaluate(1, 1));
}

@Test
public void testGreaterOrEqual() {
assertTrue(Comparator.GREATER_OR_EQUAL.evaluate(2, 1));
}

@Test
public void testGreaterOrEqualWhenNot() {
assertFalse(Comparator.GREATER_OR_EQUAL.evaluate(1, 2));
}

@Test
public void testGreaterOrEqualWhenEqual() {
assertTrue(Comparator.GREATER_OR_EQUAL.evaluate(1, 1));
}
}

0 comments on commit 00359b4

Please sign in to comment.