You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "jfclere (via GitHub)" <gi...@apache.org> on 2025/05/08 08:50:48 UTC

[PR] Add tests for prunsrv on windows. [commons-daemon]

jfclere opened a new pull request, #260:
URL: https://github.com/apache/commons-daemon/pull/260

   Add a github workflows for window (windows-latest and jdk 21) to test prunsrv.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079880665


##########
src/native/windows/apps/prunsrv/test/scripts/deleteservice.bat:
##########
@@ -0,0 +1,37 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed



##########
src/native/windows/apps/prunsrv/test/scripts/startservice.bat:
##########
@@ -0,0 +1,40 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081068406


##########
src/native/windows/apps/prunsrv/test/scripts/testservice.bat:
##########
@@ -0,0 +1,24 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+call mybanner testing
+java  -cp %myjar% org.apache.commons.daemon.ProcrunDaemon 0

Review Comment:
   Where is the source for this class?



##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]

Review Comment:
   Does this require a new branch? Why not run this on master?



##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+  pull_request:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Default
+            triplet: x64-windows
+            arch: x64
+            build-type: Debug
+            generator: "Ninja"
+
+    runs-on: windows-latest
+    timeout-minutes: 30
+    name: ${{ matrix.name }}
+    env: 
+      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: winbuild
+      - name: Test JAVA_HOME
+        shell: cmd
+        run: |
+            echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat

Review Comment:
   Is this required in a temporary file?



##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,218 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem ---------------------------------------------------------------------------
+rem Test script for procrun
+rem to run it you need:
+rem 1 - the commons-daemon-*-tests.jar
+rem 2 - procrun.exe in a subdirectory (usually something like WIN10_X64_EXE_RELEASE\prunsrv.exe)
+rem 3 - use cmd/c test.bat in the command Prompt (cmd)
+rem the test are OK once test.bat Done!!! is displayed at the test of the bat script.
+
+SETLOCAL ENABLEEXTENSIONS
+SETLOCAL EnableDelayedExpansion
+SET mypath=%cd%
+WHERE /r ..\..\ prunsrv.exe 1>in.txt
+SET /p myserv=<in.txt
+WHERE /r ..\..\..\..\..\..\..\target *-tests.jar  1>in.txt
+SET /p myjar=<in.txt
+ECHO "myserv: %myserv%"
+ECHO "myjar: %myjar%"
+ECHO "%mypath: %mypath%"
+
+echo "cleaning..."
+call mybanner stopping
+%myserv% //SS//TestService
+if %errorlevel% neq 0 (
+  echo "Stop service failed"
+)
+call mybanner deleting
+%myserv% //DS//TestService
+if %errorlevel% equ 9 (
+  echo "delete failed, not installed"
+) else (
+  if %errorlevel% neq 0 (
+    echo "delete failed"
+    exit 1
+  )
+)
+echo "cleaned"
+
+rem install service with notimeout and no wait

Review Comment:
   What is the difference between timeout and wait and where is this documented? The procrun docs only talk about timeout.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081775696


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]

Review Comment:
   Good catch I forgot to put back master.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#issuecomment-2863649377

   @jfclere 
   Thanks you for the clean ups.
   
   @markt-asf 
   Do you have time to review today?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079882971


##########
src/native/windows/apps/prunsrv/test/scripts/stopservice.bat:
##########
@@ -0,0 +1,37 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081739936


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+  pull_request:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Default
+            triplet: x64-windows
+            arch: x64
+            build-type: Debug
+            generator: "Ninja"
+
+    runs-on: windows-latest
+    timeout-minutes: 30
+    name: ${{ matrix.name }}
+    env: 
+      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: winbuild
+      - name: Test JAVA_HOME
+        shell: cmd
+        run: |
+            echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat

Review Comment:
   yes because the script uses maven build the test.jar file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079884652


##########
src/native/windows/apps/prunsrv/test/scripts/testservice.bat:
##########
@@ -0,0 +1,38 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed.



##########
src/native/windows/apps/prunsrv/test/scripts/testservice.bat:
##########
@@ -0,0 +1,38 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081748455


##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,218 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem ---------------------------------------------------------------------------
+rem Test script for procrun
+rem to run it you need:
+rem 1 - the commons-daemon-*-tests.jar
+rem 2 - procrun.exe in a subdirectory (usually something like WIN10_X64_EXE_RELEASE\prunsrv.exe)
+rem 3 - use cmd/c test.bat in the command Prompt (cmd)
+rem the test are OK once test.bat Done!!! is displayed at the test of the bat script.
+
+SETLOCAL ENABLEEXTENSIONS
+SETLOCAL EnableDelayedExpansion
+SET mypath=%cd%
+WHERE /r ..\..\ prunsrv.exe 1>in.txt
+SET /p myserv=<in.txt
+WHERE /r ..\..\..\..\..\..\..\target *-tests.jar  1>in.txt
+SET /p myjar=<in.txt
+ECHO "myserv: %myserv%"
+ECHO "myjar: %myjar%"
+ECHO "%mypath: %mypath%"
+
+echo "cleaning..."
+call mybanner stopping
+%myserv% //SS//TestService
+if %errorlevel% neq 0 (
+  echo "Stop service failed"
+)
+call mybanner deleting
+%myserv% //DS//TestService
+if %errorlevel% equ 9 (
+  echo "delete failed, not installed"
+) else (
+  if %errorlevel% neq 0 (
+    echo "delete failed"
+    exit 1
+  )
+)
+echo "cleaned"
+
+rem install service with notimeout and no wait

Review Comment:
   I added some comments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081748455


##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,218 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem ---------------------------------------------------------------------------
+rem Test script for procrun
+rem to run it you need:
+rem 1 - the commons-daemon-*-tests.jar
+rem 2 - procrun.exe in a subdirectory (usually something like WIN10_X64_EXE_RELEASE\prunsrv.exe)
+rem 3 - use cmd/c test.bat in the command Prompt (cmd)
+rem the test are OK once test.bat Done!!! is displayed at the test of the bat script.
+
+SETLOCAL ENABLEEXTENSIONS
+SETLOCAL EnableDelayedExpansion
+SET mypath=%cd%
+WHERE /r ..\..\ prunsrv.exe 1>in.txt
+SET /p myserv=<in.txt
+WHERE /r ..\..\..\..\..\..\..\target *-tests.jar  1>in.txt
+SET /p myjar=<in.txt
+ECHO "myserv: %myserv%"
+ECHO "myjar: %myjar%"
+ECHO "%mypath: %mypath%"
+
+echo "cleaning..."
+call mybanner stopping
+%myserv% //SS//TestService
+if %errorlevel% neq 0 (
+  echo "Stop service failed"
+)
+call mybanner deleting
+%myserv% //DS//TestService
+if %errorlevel% equ 9 (
+  echo "delete failed, not installed"
+) else (
+  if %errorlevel% neq 0 (
+    echo "delete failed"
+    exit 1
+  )
+)
+echo "cleaned"
+
+rem install service with notimeout and no wait

Review Comment:
   I will add some comments.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079883686


##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,232 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#issuecomment-2872358435

   @markt-asf @garydgregory OK to stash in1 commit and merge?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#issuecomment-2872830355

   No objeciton.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2084693080


##########
src/test/java/org/apache/commons/daemon/ProcrunDaemon.java:
##########
@@ -0,0 +1,208 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.commons.daemon;
+
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+class ProcrunDaemon {

Review Comment:
   Shouldn't this class have a Javadoc that ties it the the BAT file(s)?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #260:
URL: https://github.com/apache/commons-daemon/pull/260


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2083099152


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+  pull_request:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Default
+            triplet: x64-windows
+            arch: x64
+            build-type: Debug
+            generator: "Ninja"
+
+    runs-on: windows-latest
+    timeout-minutes: 30
+    name: ${{ matrix.name }}
+    env: 
+      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: winbuild
+      - name: Test JAVA_HOME
+        shell: cmd
+        run: |
+            echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat

Review Comment:
   Otherwise we get an error like:
   [ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.16.1:check (rat-check) on project commons-daemon: Too many files with unapproved license: 1 See RAT report in: /home/jfclere/TMP/TMP/commons-daemon/target/rat.txt
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081788509


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+  pull_request:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Default
+            triplet: x64-windows
+            arch: x64
+            build-type: Debug
+            generator: "Ninja"
+
+    runs-on: windows-latest
+    timeout-minutes: 30
+    name: ${{ matrix.name }}
+    env: 
+      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: winbuild
+      - name: Test JAVA_HOME
+        shell: cmd
+        run: |
+            echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat

Review Comment:
   Why is the license header required here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081431065


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]

Review Comment:
   Good catch. This should run for the master branch and pull requests, so a new branch shouldn't be needed. Or are we missing something?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081745442


##########
src/native/windows/apps/prunsrv/test/scripts/testservice.bat:
##########
@@ -0,0 +1,24 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+call mybanner testing
+java  -cp %myjar% org.apache.commons.daemon.ProcrunDaemon 0

Review Comment:
   oops fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "markt-asf (via GitHub)" <gi...@apache.org>.
markt-asf commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2083110254


##########
.github/workflows/windows.yml:
##########
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+name: Windows
+
+on:
+  push:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+  pull_request:
+    branches: [ "winbuild" ]
+    paths-ignore:
+      - 'src/docs/**'
+      - 'src/main/java/**'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: Default
+            triplet: x64-windows
+            arch: x64
+            build-type: Debug
+            generator: "Ninja"
+
+    runs-on: windows-latest
+    timeout-minutes: 30
+    name: ${{ matrix.name }}
+    env: 
+      VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          ref: winbuild
+      - name: Test JAVA_HOME
+        shell: cmd
+        run: |
+            echo rem SPDX-License-Identifier: Apache-2.0> set_java_home.bat

Review Comment:
   Got it. Tx.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#issuecomment-2866717839

   > It isn't clear to me from these tests what is being tested.
   
   For the moment these test are  https://issues.apache.org/jira/browse/DAEMON-468.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079580352


##########
src/native/windows/apps/prunsrv/test/scripts/mybanner.bat:
##########
@@ -0,0 +1,34 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/deleteservice.bat:
##########
@@ -0,0 +1,37 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/testservice.bat:
##########
@@ -0,0 +1,38 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,232 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/waituntilstop.bat:
##########
@@ -0,0 +1,40 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/stopservice.bat:
##########
@@ -0,0 +1,37 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



##########
src/native/windows/apps/prunsrv/test/scripts/startservice.bat:
##########
@@ -0,0 +1,40 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   ASF license header is duplicated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079885431


##########
src/native/windows/apps/prunsrv/test/scripts/waituntilstop.bat:
##########
@@ -0,0 +1,40 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2079885918


##########
src/native/windows/apps/prunsrv/test/scripts/mybanner.bat:
##########
@@ -0,0 +1,34 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more

Review Comment:
   fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add tests for prunsrv on windows. [commons-daemon]

Posted by "jfclere (via GitHub)" <gi...@apache.org>.
jfclere commented on code in PR #260:
URL: https://github.com/apache/commons-daemon/pull/260#discussion_r2081747887


##########
src/native/windows/apps/prunsrv/test/scripts/test.bat:
##########
@@ -0,0 +1,218 @@
+@ECHO OFF
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem ---------------------------------------------------------------------------
+rem Test script for procrun
+rem to run it you need:
+rem 1 - the commons-daemon-*-tests.jar
+rem 2 - procrun.exe in a subdirectory (usually something like WIN10_X64_EXE_RELEASE\prunsrv.exe)
+rem 3 - use cmd/c test.bat in the command Prompt (cmd)
+rem the test are OK once test.bat Done!!! is displayed at the test of the bat script.
+
+SETLOCAL ENABLEEXTENSIONS
+SETLOCAL EnableDelayedExpansion
+SET mypath=%cd%
+WHERE /r ..\..\ prunsrv.exe 1>in.txt
+SET /p myserv=<in.txt
+WHERE /r ..\..\..\..\..\..\..\target *-tests.jar  1>in.txt
+SET /p myjar=<in.txt
+ECHO "myserv: %myserv%"
+ECHO "myjar: %myjar%"
+ECHO "%mypath: %mypath%"
+
+echo "cleaning..."
+call mybanner stopping
+%myserv% //SS//TestService
+if %errorlevel% neq 0 (
+  echo "Stop service failed"
+)
+call mybanner deleting
+%myserv% //DS//TestService
+if %errorlevel% equ 9 (
+  echo "delete failed, not installed"
+) else (
+  if %errorlevel% neq 0 (
+    echo "delete failed"
+    exit 1
+  )
+)
+echo "cleaned"
+
+rem install service with notimeout and no wait

Review Comment:
   the timeout is the procrun parameter, wait is a parameter of the test class org.apache.commons.daemon.ProcrunDaemo



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org