using maven we create a war file and we need to be deployed this war in tomcat(application server) for different environment (DEV/QA/UAT).
We need to run the JUNIT test for each of the environment before deploying.
we have written nearly 60 junit test which need to passed
Is is possible to run the junit test for war file?
if yes how to run all junit test sitting inside the war file
using command line how run junit test present inside the war file
1.9k Views Asked by Kiran A At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in MAVEN
- Auto reload with play2
- maven pom.xml dependencies order vs classpath/build path order
- How to ignore or fix the duplicate classes warning?
- Scala Eclipse IDE compiler giving errors until "clean" is run
- How to run multiple "mvn test"-commands from batch file?
- Not able to send email in java using SMTP,its blocked by firewall in my office.Is there any other method by which we can send mail?
- javaCV Maven project
- Logging error when executing Maven SonarQube plugin
- Gradle: Override transitive dependency by version classifier
- Why we need maven if there's javac that compiles the code?
- jar file input == null while java app is working
- JPA and web app
- Test Selector Plugin Jenkins returns No tests were executed
- Eclipse OSGI unsatisfied constraint
- GlassFish 4.0 CDI deployment failure + Apache Spark
Related Questions in TOMCAT
- Best way to pass an environment variable to several config files
- Openshift context path
- KeyStore file is not found in jar, although present in jar
- phpseclib of how to get PID and kill
- Unable to connect database of lamp instance from servlet running on tomcat instance of google cloud
- Spring and Tomcat: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
- How can I get a custom header from the client in Tomcat?
- why lost Mysql connection pool after a period?
- Eclipse Java EE + Bitnami Tomcat Stack
- Service not starting using Spring-boot during integration tests
- Image not loading in web page and says 404 error
- Maven Tomcat plugin - 404 WebServlet not found
- How to deploy a spring boot MVC application in traditional tomcat webapps folder?
- Tomcat Manager is not accessible in multi-domain configuration
- JSP return Jasper Exceptions on my friend's pc's when it works on mine
Related Questions in JUNIT
- Reopening the application freshly through appium java script for Next Testcase
- Some of my tests show prepended with junit.framework
- Test Selector Plugin Jenkins returns No tests were executed
- Inject EntityManager in SwitchYard Junit implementation
- Java JUnit4: Make simple assertEquals Test pass
- Don't let test stop on failure
- How to test Reply<?> in sitebricks
- Arquillian Embedded Derby database columnDefinition="text"
- How do I write unit test (JUnit) to check Database connection using DAO class?
- Get full path of a package situated in source folder from junit
- How to write a JUnit unit test for database call?
- Unit tests fail to run after upgrade from grails 2.3 to 2.5
- Issues with a UDF
- Unit testing with Liferay 6.2
- What does the "Test Artifact" selector do in Android STudio
Related Questions in JUNIT4
- Some of my tests show prepended with junit.framework
- Can not convert from Class<PowerMockRunner> to Class<? extends Runner>
- Java JUnit4: Make simple assertEquals Test pass
- Library throws AssertionError making my tests fail
- Don't let test stop on failure
- using command line how run junit test present inside the war file
- hibernate rollback not working in service layer
- How to test Exceptions with ActivityTestCase or InstrumentationTestCase
- Unit Testing GMavenPlus Groovy Mojos - project.basedir not being expanded
- initializationError while executing Robolectric JUnit 4 test case
- junit 4 all pairwise permutations of test methods
- Ant JUnit Error No runnable method. initializationError
- ContextNotActiveException: WELD-001303: No active contexts for scope type org.apache.deltaspike.core.api.scope.GroupedConversationScoped
- Objects behave weird when mocking private method of class under test using jmockit
- Load balance execution of UI tests (Selenium) on multiple identical app instances (URLs)
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
WAR file is deployment artifact that shouldn't include any unit tests. As @Gerold Broser correctly pointed out, Maven handles excluding of unit tests for you if you place them into "src/test/java". Don't ever try to put them into "src/main/java".
If they are true unit tests, they don't need to be executed against deployed war service. They are testing small chunks of functionality and are generally executed during test phase of maven lifecycle.
If tests are firing requests against deployed server, at that stage they are not unit tests anymore and should be probably placed into separate test project.
Proper place where to run your tests is always Continuous Integration server, so one way or the other make sure that execution is automated! Tests without CI server are waste of time.
BTW There is maven-tomcat7-plugin to start tomcat and deploy it during interation-test phase of Maven lifecycle, but this maven plugin doesn't seem to be maintained anymore and doesn't work with Servlet 3.0 Java configs and Tomcat 8. So I don't recommend that path.