JUnit5: How do I configure a TestExecutionListener to run last? - junit

I have created a TestExecutionListener that wants to persist additional data in the XML files created by the LegacyXmlReportGeneratingListener (you know, the TEST-testClassName.xml ones in /build/test-reports/test).
I have registered the TestExecutionListener via /META-INF/services/org.junit.platform.launcher.TestExecutionListener.
Everything works fine so far, except the fact, that the LegacyXmlReportGeneratingListener runs afterwards and overwrites my changes. Or on a freshly built system, my listener can't - of course - even find the XMLs.
How can I tell my custom listener to run last or at least after the report generating listeners?
Thanks in advance

Related

Octave 7.1.0 opens with cryptic error/warning messages

I've just installed Octave 7.1.0 and I noticed a strange sequence of error/warning messages which I had never seen before nor am able to decipher:
2022-05-06T16:59:34.366ZE [6832:ShellIpcClient] message_loop.cc:133:Run Run called on MessageLoop that's already been Quit!
2022-05-06T16:59:34.368ZE [12660:ShellIpcClient] message_loop.cc:133:Run Run called on MessageLoop that's already been Quit!
2022-05-06T16:59:34.369ZE [8132:ShellIpcClient] message_loop.cc:133:Run Run called on MessageLoop that's already been Quit!
2022-05-06T16:59:34.371ZE [15212:ShellIpcClient] message_loop.cc:133:Run Run called on MessageLoop that's already been Quit!
Since I haven't had the time to test this new version (a mere 1/2 hour has passed since I installed it) I cannot tell whether or not Octave's functionality is compromised.
Any ideas?
Wherever this message comes from, it is not from Octave. Someone reported the same issue last year on Octave's forum at Strange opening messages when opening Octave each time which links to a similar issue on the Far Manager bug tracker. The Far Manager devs suggest that this comes from Google drive:
When you open a context menu, all registered shell extensions are loaded into the Far process. These extensions implement custom context menu items, shown by various software. Sometimes the authors of these extensions add various debug logging messages to their code to see what is going on in various situations. Sometimes these authors are too lazy to implement a proper logging and they just print stuff to the standard output stream, connected to a console. Windows Explorer doesn't have a console attached to it, so all these messages go into the void. Far, on the contrary, does have a permanently attached console - you're looking at it. Therefore, any debug stuff these lazy people print in their extensions ends up in that console.
It's quite sad, but there's nothing we can do about it.
Please search for that string ("Run Run called on MessageLoop that`s already been Quit") in your Program Files folder and, once found, report to the corresponding product owners. I suspect that in your case it's Google Drive.

Access Application.Quit not working, SharePoint Web Database

In my database (Access 2013, .accdw), I am checking the user's current version in the Form_Open event. If it is not up to date it triggers an external command to download a fresh copy and then is supposed to close itself to allow for the update. The problem is that after Application.Quit is triggered, access closes but instantly reopens, blocking the download. I've stripped out all the code I can to isolate the problem.
If 1 = 1 Then
Application.Quit
End If
Simplified pretty far, right? It should always just close as soon as the form is opened. With this as the only code in my Form_Open event which is the only code in the form, it still closes, reopens, and then closes again. Docmd.Quit has the same effect. I've tried too many variations to enumerate. In a button this code works fine, but I need it to run the check before it loads any data (the linked tables may be being altered while we change versions).
Any ideas how to make it stay closed the first time it closes?
I think it reopens because your external code (.bat file ?) reopens it. It's not an Access problem. Have you checked the numerous tools you can find for Access automated client deployment ? Here are the first 2 I found:
http://www.databasejournal.com/features/msaccess/article.php/3286111/Automatically-Deploy-a-New-Access-Client.htm
http://www.devhut.net/2015/06/30/ms-access-deploying-your-database-front-end-to-your-users/
Your code works for me in a Form_Open(), but then this is Access 2010 and no Sharepoint.
You may have better luck by Creating an AutoExec macro that calls an initialization function that does the version check, instead of having a form open automatically.
If the version check is ok, then open your start form from the function.
The easy work-around is to always fetch the current version and then launch it.
This way there's no fuzz and the user always run the latest version.

Verify a Tif with ApprovalTests

I have been asked to update a system where header information gets injected into a tif via a 3rd party console application. I don't need to worry about that bit.
The part I have been asked to look at it the merge process that generates the header information.
The current file generated by the process is assumed as correct, before I make any changes, so I want to add this as an approved result, from that I can then check that the changes I make will alter the file as expected.
I thought this would be a good opportunity to look at using ApprovalTests
The problem I have is that for what ever reason the links to the videos are considered corruptible (Possibly show me kittens jumping into boxes or something, which will stop me working, which ironically means I slow down my work done because I cannot see any help videos).
What I have been looking at is the Approvals.Verify and Approvals.VerifyFile extensions.
But what appears to be happening is confusing me.
using VerifyFile creates a received file, but the contents of the file are just a line the name of the file I have asked it to verify.
using Verify(new FileInfo("FileNameHere")) does not appear to generate the received file that I need to flag as approved, but the test does return saying that it cannot find the approved tif file.
I am probably using VerifyFile completely wrong and might be looking at using Verify wrong as well.
useful info?
Might be useful to know, that as this is a legacy application, running as a windows service, I have wrapped the service in a harness that allows me to call the routines, so the files are physically being written elsewhere on the machine outside of my control (well there is a config, but the return of the service I call generates a file in a fixed location if it is successful). I have tried copying that into the Unit Test project, but that doesn't appear to help.
Verify(File) and VerifyFile(string) are both meant to verify an existing file. As such they merely setting the received file to the file you pass in. You will still need to move/approval/create the approved file.
Here is the pseudo code and process.
[UseReporter(typeof(DiffReporter), typeof(ClipboardReporter)]
public void TestTiff()
{
string tif = YourProcessToCreateTifFile();
Approvals.VerifyFile(tif);
}
[Note: if you don't have an image diff installed, like TortoiseDiff, you might want to use the FileLauncherReporter]
Run this, once you get the result, move the file over by pasting your clipboard into a cmd window.
It will move the temporary tif to your test directory with the name ClassName.TestTiff.approved.tif
After that the test should pass until something changes.
Happy Testing!

I am getting a C++ runtime error while running access vba module. Consistently reproducible

I have taken 2 sample databases from online - one for a calendar and one for drag and drop functions - and pulled some code together for a result that is ALMOST functioning as I had hoped.
There is a function to build/refresh the calendar, which works perfectly.
The drag and drop functions work perfectly. (The item is updated in the table to reflect the new date.)
When I drag and drop, the calendar doesn't automatically refresh. If I click next month then last month (which call the refresh function with a new date), the changes are reflected as expected.
The problem is when I try to automatically call the refresh function after a drag/drop event. Access crashes every time I call for a refresh in the code after drag/drop, regardless of where I put the call.
The error says:
Microsoft visual C++ Runtime Library
Runtime Error!
Program: C:...
This application has requested the Runtime to terminate it in an
unusual way. Please contact the application's support team for more
information.
I have tried:
I thought it might be trying to refresh too fast, so I added a pause
function and had the program wait 10 seconds after dropping before
refreshing. Still crashed.
I did a compact and repair on the database.
I ran /decompile from the command-line on my accdb file.
I exported the relevant form, tables, query and module to a new accdb
file.
I have tried to re-register the libraries checked under references.
(RegSvr32 "Path to library file") The only one that succeeded was
vbe7.dll. The "MS access 14.0 object library", "OLE automation", and
"MS Office 14.0 Access Database Engine Object" don't contain a
DllRegisterServer method, so regsvr32 did not succeed with those. There are no other
references checked. Still crashes.
I have tried countless places to insert the call to refreshcalendar()
I have stepped through the code and verified the exact place that the
crash happens. It is commented in the code.
Here is a link to the database.
To reproduce the problem:
Open frmsubCalendar.
There are 2 entries in May 2014 that can be dropped to other days on the calendar. I can then click the prev/next month buttons on the form, and when May reloads, the change has been made. But if I go into mod_drag_drop under the sub dropdetect() and uncomment the lines noted in the comments, the refresh will crash access at the end of the dropdetect() sub.
I cannot figure out how to make the calendar refresh automatically after a drag/drop event without access crapping the bed.
I realize this is a bit outdated, but I had a similar issue and didn't see this one being answered, I figured I'd add this answer for posterity. :) I discovered it was caused by a reference to a function by the form name. I had the following call in a module:
lContractCt = Form_Census.lContractCt_f(bIsMembers)
Where lContract is a Long, there is a form named Census and a public function in that form called lContractCt_f.
I moved the function to a module (so the Form_Census reference wasn't necessary any more). And changed the call to:
lContractCt = lContractCt_f(bIsMembers)
This fixed the error. So, I would check if you have any public function references going from a module to a form and move those public functions into a module. I also saw a similar thread with a different form reference, via Forms![Census], for example.

Suggestions for developing WebInterface (using Tomcat)?

I am working with TS-7500 (ARM 9) board running Debian Linux (Linux ts7500 2.6.24.4). It is connected to a couple of sensors and is running driver code to talk to these sensors.
Every time the C program starts, it reads a couple of config-parameters from a config-file and starts sensors with those values.
So the task at hand is : presenting a web interface to show/edit these config-parameters to user. The task of the web interface can be summarized in four steps :
Read config-parameters from the config-file and show the current configuration
Allow user to change the configuration
Capture and save the changes to same config-file
These config-parameters could be presented as drop-down menu items or radio-buttons. And I have a linux background script which restarts the C prg when config-file is modified.
I know TS-7500 runs Tomcat. Now please suggest a good way to handle this problem. I have heard about using Servlet and JSPs (am not very familiar with those actually). Which one of them is suitable to generate HTML pages dynamically ? (as I see everytime I need to generate a new HTML page by selecting the current configuration while displaying the page).
Sorry for being very elaborate !
EDIT : Beeps ! No reply ? Come on guyz, is the question not clear ? Or no one has ever faced a similar problem (design problem) ??
The solution would be to use a PHP in addition with Apache web server ! PHP script could be used to
Read the config file and capturing the parameters
Generate a HTML form (by pre-selecting the dropdown menus and radio buttons from the already read parameters)
And capturing the new edits and saving them to config file.
PHP script must be placed in /var/www/ directory of the embedded board. Then from any system, it could be accessed just by keying the IP address of the board and the script name using a simple web browser.