Redirecting PyUnit output to file in Eclipse - eclipse

Is there a built-in way in Eclipse to redirect PyUnit's output to a file (~ save the report)?

Output can be easily redirected to a file in Run Configurations > Common tab > Standard Input and Output section. Hiding just in plain sight...

Related

Redirect Gradle's test output into file

Is there a way how to tell Gradle, that I want to redirect test output into text file under 'reports' directory?
I have som Scala test sources, from which I want to capture output. I previously (in Maven) sued "scalatest-maven-plugin", with attribute "filereports" for doing this.
Thanks
Matthew
There is no way to tell Gradle to redirect its test console output to a file, but the generated HTML report does capture test standard out/err.

Pass a text file into a Java program as a parameter in Eclipse

I'm trying to pass a .txt file as a paramater into my java program.
My program is titled SetTest and the file I'm trying to read is Ted.txt. From a Windows 7 command prompt I create a temp folder and compile my program there creating SetTest.class. Also in that folder is Ted.txt. From that temp directory I then issue the command:
java SetTest < Ted.txt
Everything works as expected. The program reads in the file and outputs what I'm looking for. All good.
My question is how do I duplicate this using Eclipse? I believe my text file is in the proper location, listed under JRE System Library as seen in the Package Explorer. I've been trying the following from Eclipse: Run -> Run Configurations... Then in the (x)= Arguments section, in the Program arguments field I enter Ted.txt then click on Run. Unfortunately nothing seems to happen. No error message, but I don't see the console output I'm looking for either.
To rephrase your question - you want to send a file to your application's standard input, while it is running in Eclipse.
You can write (copy & paste) data into console (that's where the standard input is taken from). However I am not aware of any possibility how you can redirect file contents directly to the standard input.
UPDATE with correct keywords you might be able to find more resources:
Eclipse reading stdin (System.in) from a file
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155411

Separate stdin and stdout file in Eclipse

The launch configuration dialog is
Am I right that if one needs the input from a file then output also goes into a file? Why it must be the same file? I do not see any option to have two separate connections.
The UI is admittedly confusing, but the file will only be used for output. There's no similar way to use a file as input, thus the "necessary for input" hint.
See:
I/O redirection in eclipse?
Eclipse reading stdin (System.in) from a file
How can we redirect eclipse console output to a file?

Eclipse Project Printing

I have to print out one of my projects and the built-in print function of Eclipse isn't doing a good job at all. Font, font size, page border etc..
Does anyone know a plug-in or tool to print out my whole project easily? Maybe with some formatting options on it?
After a little bit google, I've encountered enscript but its an Linux tool and unfortunately I'm on a Windows machine.
Regards
The most recent plugin about printing and printing preview is:
swt-paperclips
a simple, light weight, extensible Java printing plug-in for SWT.
PaperClips hides the complexity of laying out and rendering documents on the printer, helping you focus on what to print instead of how to print it.
In a nutshell, PaperClips provides an assortment of document "building blocks," which you can tweak and combine to form a custom document.
The assembled document is then sent to PaperClips for printing.
PaperClips includes support for printing text, images, borders, headers and footers, column layouts and grid layouts, to name a few. It can also be extended with your own printable classes.
Here in an example in this article:
alt text http://www.schmeeky.co.uk/assets/drgalleries/19/thumb_print_dialog.png
Eclipse does a terrible job printing on Windows. But there is an excellent version of Enscript that works for Windows and does great printouts. You have to set it up as an external tool which is a bit of a bear, but once it's setup it works well.This how I installed it on XP.
Download and install Enscript for Windows
http://gnuwin32.sourceforge.net/downlinks/enscript-src.php
Create an external tool for running Enscript in Eclipse
Goto Eclipse, Run -> Configure External Tools. Add a tool (icon looks lie a miniature document with +)
Name it "Run Enscript". Configure as follows:
Main Tab
Location : browse to the Enscript executable. Should be in:
C:\Program Files\GnuWin32\bin\enscript.exe
Working directory: leave empty
Arguments:
--header=${resource_name} -p "${workspace_loc}\${project_name}\print.ps" "${resource_loc}"
(These options will create a postscript file named print.ps at the top level of your project from the currently selected window.)
Build Tab
Clear "Build before launch" or it will try to rebuild your project each time you print..
Send the file to the printer
You need to find a way to send the file to the printer. Several utilities to do that, but since I had a postscript capable printer all I had to do is to share it under Windows, and copy the file to the share name. I automated this by adding another external tool, named "send ps file to printer"
Main Tab
Location: C:\WINDOWS\system32\cmd.exe
Working directory: leave empty
Arguments:
/c copy "${workspace_loc}\${project_name}\print.ps" \\your-machine-name-here\your-printer-share-name-here
(this will pick up the file we just created and send it to the printer)
Build Tab
Clear "Build before launch"
Voila, two clicks to run the tools one after the other and it prints clean. You can configure it further by adding Enscript options to the argument line. Here are a few useful ones:
- specify a slightly smaller font size (default is 10):
-f Courier8
- truncate lines instead of wrapping: -c
- precede line with its line number: -C

How to get the Log File Viewer working in install4j?

I'm trying to use the log file viewer in my install4j installation, and no matter what I do the text box is empty. The log file doesn't exist when the form is shown. When the user clicks next, a batch executable runs that calls a java process and that creates and writes out to this log file. I've successfully redirected stdout to a variable, and used the text display to show the updating variable contents but I can't get the log viewer to work for the actual log file.
I've tried several combinations of pointing to the file. No errors are ever present in the installation log.
I've used
${installer:sys.installationDir}/logs/logfile.log
logs/logfile.log
c:\program files\my app\logs\logfile.log
The problem was that relative files in the log file viewer form component were not resolved relative to the installation directory. This will be fixed in 8.0.3. In the meantime, you can prepend
${installer:sys.installationDir}/
to the "Log file" property or the "Log file viewer" form component, then it will work.