Java.util.zip.zipexception Error In Opening Zip File Ant Junit
Contents |
here for a quick ant build error in opening zip file overview of the site Help Center Detailed answers to
Ant Javac Error In Opening Zip File
any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Configuring ant to run unit tests. Where should libraries be? How should classpath be configured? avoiding ZipException up vote 17 down vote favorite 4 I'm trying to run my junit tests using ant. The tests are kicked off using a JUnit 4 test suite. If I run this direct from Eclipse the tests complete without error. However if I run it from ant then many of the tests fail with this error repeated over and over until the junit task crashes. [junit] java.util.zip.ZipException: error in opening zip file [junit] at java.util.zip.ZipFile.open(Native Method) [junit] at java.util.zip.ZipFile.(ZipFile.java:114) [junit] at java.util.zip.ZipFile.(ZipFile.java:131) [junit] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1028) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:147) [junit] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.nextElement(AntClassLoader.java:130) [junit] at org.apache.tools.ant.util.CollectionUtils$CompoundEnumeration.nextElement(CollectionUtils.java:198) [junit] at sun.misc.CompoundEnumeration.nextElement(CompoundEnumeration.java:43) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.checkForkedPath(JUnitTask.java:1128) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1013) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:834) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1785) [junit]
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; http://stackoverflow.com/questions/461417/configuring-ant-to-run-unit-tests-where-should-libraries-be-how-should-classpa it only takes a minute: Sign up Not able to run test through ANT up vote 2 down vote favorite 1 I have a test class, all the tests of this class runs fine if I run in eclipse. (right click on the file , run as jUnit) but when I am trying to run using Ant Script it fails. http://stackoverflow.com/questions/8655193/not-able-to-run-test-through-ant Actually this test is to be run against 2 browsers. This test runs fine against IE Chrome. It runs fine against IE. But test is not able to run against Chrome. I am not sure what's happening. All the driver related information I have placed under allresources/drivers/ of the project path. And browser profiles i have kept under browserProfiles folder of the project. I am not sure why tests are not able to be picked up for Chrome. I have attached test code and the code where I am trying to create webdriver and seldriver in the source code. package com.mytests; public class MyParamTest { private MyWrapperForBrowser browser; @Before public void setup(){ b = new MyWrapperForBrowser("chrome"); b.start(); } @Test public void testCURDOnEntity() { MyEntity e = new MyEntity(browser); Assert.assertTrue(e.createMessage("message", "text")); // more business logic.. } } And source code package com.mysrc; import java.util.*; import org.openqa.selenium.*; public class MyWrapperForBrowser { private final WebDriver webDriver; private WebDriverBackedSelenium selDriver; public MyWrapperForBrowser(String driver) { if (driver.equalsIgnoreCase("IE") { // create webDriver , selDriver } else{ System.setProperty("webdriver.chrome.driver", "allresources/drivers/chromedriver.exe"); DesiredCapabilities broserCapabilities = DesiredCapabilities.chrome(); broserCapabilities.setCapability("chrome.switches", Arrays.asList("--start-minimized"))
here for a quick overview of http://stackoverflow.com/questions/2601364/ant-build-classpath-jar-generates-error-in-opening-zip-file the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions error in Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Ant build classpath jar generates “error error in opening in opening zip file” up vote 5 down vote favorite 1 I have a project built in eclipse with a dependencies on 3rd party jars. I'm trying to generate a suitable build file for ant - using eclipses built-in export->ant buildfile feature as a starting block. When I run the build target I get the following error: [javac] error: error reading /base/repo/FabTrace/lib/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.jar; error in opening zip file And the whole build file (auto-generated by eclipse) looks like this: (NB: the error above always references the first jar listed in the classpath)