Running JUnit from the command line [duplicate] - junit

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to run Junit testcases from command line?
How can I run JUnit from the command line in Linux?

Here you will find a way to do that.
As stated on JUnit FAQ:
How do I run JUnit from my command
window?
Set your CLASSPATH
Invoke the runner by "java org.junit.runner.JUnitCore (test class name)"

Related

I tried almost everything yet pygame is not installing [duplicate]

This question already has answers here:
Unable to install Pygame using pip
(27 answers)
Python pygame not installing
(3 answers)
Closed 3 months ago.
everytimg i try to install pygame i recive this error.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
im not sure what to do as i feel like ive tried everything.
i tried running the Get-ExecutionPolicy in the terminal and got “RemoteSigned”.
i tried uninstalling and re installing VS code.
i tried different variations ex: pip3 install pygame, and got the same error message

PyInstaller encounters an error with built executable [duplicate]

This question already has answers here:
PyInstaller, spec file, ImportError: No module named 'blah'
(3 answers)
Pyinstaller Unable to access Data Folder
(1 answer)
Python - pygame error when executing exe file
(3 answers)
Closed 2 years ago.
I made a Pygame game using Python and converted it into a .exe file using the command:
pyinstaller file.exe --onefile
I gave the output to my friends who told me that a error pops up when they started my .exe file.
file.exe has stopped working windows is finding a solution
Please help.
EDIT
To be more specific:
I am on windows 7
Python version is 3.6
Pygame version is 1.9.6

Install pygame on window10 cmd error [duplicate]

This question already has an answer here:
Permission Error when installing pygame on python 3.5
(1 answer)
Closed 5 years ago.
I have been using Window OS and latest python version(64bit)
I was trying to install pygame on cmd window but have problems like picture that I uploaded...
please check and advise for me...
The error message in the cmd window:
See what is described in this link:
Permission Error when installing pygame on python 3.5
See also the comments.

Selenium Standalone fails to run tests in Google Chrome [duplicate]

This question already has answers here:
How to run Google Chrome with Selenium RC?
(5 answers)
Closed 9 years ago.
I'm using jenkins to run selenium standalone server and html test suites in a windows xp node.
I've managed to get it running and working for iexplore and firefox, but when it comes to googlechrome it fails in starting it.
This is the command I use to run the tests in googlechrome:
java -jar C:\...\selenium-server-standalone-2.28.0.jar -htmlSuite "*googlechrome C:\Program Files\Google\Chrome\Application\chrome.exe --allow-file-access-from-files –-disable-web-security" file:///C:/WebTest/Tests/ C:/WebTest/Tests/TestSuite.html C:\jenkins\workspace\sp-webTest\resultados\resultadoGC.html
And the error I get is:
12:43:08.044 INFO - Launching Google Chrome...
HTML suite exception seen:
java.lang.NullPointerException
at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.createCommandArray(GoogleChromeLauncher.java:168)
at org.openqa.selenium.server.browserlaunchers.GoogleChromeLauncher.launch(GoogleChromeLauncher.java:82)
at org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchHTMLSuite(AbstractBrowserLauncher.java:47)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:145)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:196)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:611)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:285)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:243)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:54)
Any help will be appreciated.
Specifying the webdriver in java helps.
System.setProperty("webdriver.chrome.driver", "c:/chromedriver.exe");
driver = new ChromeDriver();
Download link for chrome driver http://code.google.com/p/chromedriver/downloads/list
I got it working, somehow sending flags to chrome in the command causes selenium to throw null pointer exception. So what I did was add chrome to the PATH in mi xp node, use Selenium plugin to run html test suites in jenkins and specify a start url that begins with "https://" using google chrome and a start url that begins with "file:///" was a mess and couldn't get it to work like that. I also added the -trustAllSSLCertificates in "others" input box.
For me on Windows it work:
java -jar "c:\selenium-server-standalone-2.35.0.jar" -forcedBrowserMode "*googlechrome c:\Program Files\Google\Chrome\Application\chrome.exe"

How to run JUnit tests for Java from the command line [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to run Junit testcases from command line?
I've run my JUnit tests using maven before. Now I'm packaging all my source code into a JAR file, and want to run it using a java command. How can I do that? Note that there is no main class in my code.
You need to make sure the classpath contains
Your JAR
The JUnit JAR
You can set the class path by using the -cp flag to the java command. Then you can use junit.textui.TestRunner to run the tests.
If you're using Linux (note the use of : as the path separator between jars)
java -cp /path/to/my.jar:/path/to/junit.jar junit.textui.TestRunner com.mypackage.MyClassWithUnitTests
If you're using Windows (note the use of ; as the path separator between jars)
java -cp /path/to/my.jar;/path/to/junit.jar junit.textui.TestRunner com.mypackage.MyClassWithUnitTests