Search Results

Search found 64 results on 3 pages for 'testng'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • springTestContextBeforeTestMethod failed in Maven spring-test

    - by joejax
    I try to setup a project with spring-test using TestNg in Maven. The code is like: @ContextConfiguration(locations={"test-context.xml"}) public class AppTest extends AbstractTestNGSpringContextTests { @Test public void testApp() { assert true; } } A test-context.xml simply defined a bean: <bean id="app" class="org.sonatype.mavenbook.simple.App"/> I got error for Failed to load ApplicationContext when running mvn test from command line, seems it cannot find the test-context.xml file; however, I can get it run correctly inside Eclipse (with TestNg plugin). So, test-context.xml is under src/test/resources/, how do I indicate this in the pom.xml so that 'mvn test' command will work? Thanks, UPDATE: Thanks for the reply. Cannot load context file error was caused by I moved the file arround in different location since I though the classpath was the problem. Now I found the context file seems loaded from the Maven output, but the test is failed: Running TestSuite May 25, 2010 9:55:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [test-context.xml] May 25, 2010 9:55:13 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.GenericApplicationContext@171bbc9: display name [org.springframework.context.support.GenericApplicationContext@171bbc9]; startup date [Tue May 25 09:55:13 PDT 2010]; root of context hierarchy May 25, 2010 9:55:13 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.GenericApplicationContext@171bbc9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1df8b99 May 25, 2010 9:55:13 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1df8b99: defining beans [app,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor]; root of factory hierarchy Tests run: 3, Failures: 2, Errors: 0, Skipped: 1, Time elapsed: 0.63 sec <<< FAILURE! Results : Failed tests: springTestContextBeforeTestMethod(org.sonatype.mavenbook.simple.AppTest) springTestContextAfterTestMethod(org.sonatype.mavenbook.simple.AppTest) Tests run: 3, Failures: 2, Errors: 0, Skipped: 1 If I use spring-test version 3.0.2.RELEASE, the error becomes: org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance() is depending on nonexistent method null Here is the structure of the project: simple |-- pom.xml `-- src |-- main | `-- java `-- test |-- java `-- resources |-- test-context.xml `-- testng.xml testng.xml: <suite name="Suite" parallel="false"> <test name="Test"> <classes> <class name="org.sonatype.mavenbook.simple.AppTest"/> </classes> </test> </suite> test-context.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" default-lazy-init="true"> <bean id="app" class="org.sonatype.mavenbook.simple.App"/> </beans> In the pom.xml, I add testng, spring, and spring-test artifacts, and plugin: <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.1</version> <classifier>jdk15</classifier> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>2.5.6</version> <scope>test</scope> </dependency> <build> <finalName>simple</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <suiteXmlFiles> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> Basically, I replaced 'A Simple Maven Project' Junit with TestNg, hope it works. UPDATE: I think I got the problem (still don't know why) - Whenever I extends AbstractTestNGSpringContextTests or AbstractTransactionalTestNGSpringContextTests, the test will failed with this error: Failed tests: springTestContextBeforeTestMethod(org.sonatype.mavenbook.simple.AppTest) springTestContextAfterTestMethod(org.sonatype.mavenbook.simple.AppTest) So, eventually the error went away when I override the two methods. I don't think this is the right way, didn't find much info from spring-test doc. If you know spring test framework, please shred some light on this.

    Read the article

  • How do I test expectedExceptionsMessageRegExp (exception message) using TestNG?

    - by Thomman
    I'm using expectedExceptionsMessageRegExp annotation to test exception message, but the this is not executing correctly.please see the below code. Unit Test code: @Test (dependsOnMethods = "test1", expectedExceptions = IllegalArgumentException.class , expectedExceptionsMessageRegExp = "incorrect argument") public void testConverter() { try { currencyConverter = Converter.convert(val1,val2) } catch (MYException e) { e.printStackTrace(); } } Application code: if (val1 == null || val1.length() == 0) { throw new IllegalArgumentException("Val1 is incorrect"); } The unit test code should check the exception message , if both message are not matching , it should throw fail (unit test failed) . At present this is not happening , Am i doing something wrong?

    Read the article

  • How do I get the name of the test method that was ran in a testng tear down method?

    - by Zachary Spencer
    Basically I have a tear down method that I want to log to the console which test was just ran. How would I go about getting that string? I can get the class name, but I want the actual method that was just executed. Class testSomething() { @AfterMethod public void tearDown() { system.out.println('The test that just ran was....' + getTestThatJustRanMethodName()'); } @Test public void testCase() { assertTrue(1==1); } } should output to the screen: "The test that just ran was.... testCase" However I don't know the magic that getTestThatJustRanMethodName should actually be.

    Read the article

  • How do I get the name of the test method that was run in a testng tear down method?

    - by Zachary Spencer
    Basically I have a tear down method that I want to log to the console which test was just run. How would I go about getting that string? I can get the class name, but I want the actual method that was just executed. Class testSomething() { @AfterMethod public void tearDown() { system.out.println('The test that just ran was....' + getTestThatJustRanMethodName()'); } @Test public void testCase() { assertTrue(1==1); } } should output to the screen: "The test that just ran was.... testCase" However I don't know the magic that getTestThatJustRanMethodName should actually be.

    Read the article

  • How to make @BeforeClass run prior Spring TestContext loads up ?

    - by lisak
    Hey, it should be piece of cake for programmers using testNG. I have this scenario @ContextConfiguration(locations={"customer-form-portlet.xml", "classpath:META-INF2/base-spring.xml" }) public class BaseTestCase extends AbstractTestNGSpringContextTests { ... @BeforeClass public void setUpClass() throws Exception { But I'd need the spring context to be load up after @BeforeClass. I I came up with overriding AbstractTestNGSpringContextTests methods : @BeforeClass(alwaysRun = true) protected void springTestContextBeforeTestClass() throws Exception { this.testContextManager.beforeTestClass(); } @BeforeClass(alwaysRun = true, dependsOnMethods = "springTestContextBeforeTestClass") protected void springTestContextPrepareTestInstance() throws Exception { this.testContextManager.prepareTestInstance(this); } and make my method @BeforeClass(alwaysRun = true, dependsOnMethods = "setUpClass") protected void springTestContextPrepareTestClass() throws Exception { } But then I get : Caused by: org.testng.TestNGException: org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance() is not allowed to depend on protected void org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextBeforeTestClass() throws java.lang.Exception Make it public also doesn't help. Could please anybody mention here if it can be done in a working manner :-) I know that I could load the testContext manually, but that wouldn't be so fancy. It works like this, but TestContextManager is not visible so I can't call prepareTestInstance() method on it : @Override @BeforeClass(alwaysRun = true, dependsOnMethods = "setUpClass") public void springTestContextPrepareTestInstance() throws Exception { }

    Read the article

  • Java unit test coverage numbers do not match.

    - by Dan
    Below is a class I have written in a web application I am building using Java Google App Engine. I have written Unit Tests using TestNG and all the tests pass. I then run EclEmma in Eclipse to see the test coverage on my code. All the functions show 100% coverage but the file as a whole is showing about 27% coverage. Where is the 73% uncovered code coming from? Can anyone help me understand how EclEmma works and why I am getting the discrepancy in numbers? package com.skaxo.sports.models; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; @PersistenceCapable(identityType= IdentityType.APPLICATION) public class Account { @PrimaryKey @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String userId; @Persistent private String firstName; @Persistent private String lastName; @Persistent private String email; @Persistent private boolean termsOfService; @Persistent private boolean systemEmails; public Account() {} public Account(String firstName, String lastName, String email) { super(); this.firstName = firstName; this.lastName = lastName; this.email = email; } public Account(String userId) { super(); this.userId = userId; } public void setId(Long id) { this.id = id; } public Long getId() { return id; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public boolean acceptedTermsOfService() { return termsOfService; } public void setTermsOfService(boolean termsOfService) { this.termsOfService = termsOfService; } public boolean acceptedSystemEmails() { return systemEmails; } public void setSystemEmails(boolean systemEmails) { this.systemEmails = systemEmails; } } Below is the test code for the above class. package com.skaxo.sports.models; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertFalse; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class AccountTest { @Test public void testId() { Account a = new Account(); a.setId(1L); assertEquals((Long) 1L, a.getId(), "ID"); a.setId(3L); assertNotNull(a.getId(), "The ID is set to null."); } @Test public void testUserId() { Account a = new Account(); a.setUserId("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); a = new Account("123456ABC"); assertEquals(a.getUserId(), "123456ABC", "User ID incorrect."); } @Test public void testFirstName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getFirstName(), "Test", "User first name not equal to 'Test'."); a.setFirstName("John"); assertEquals(a.getFirstName(), "John", "User first name not equal to 'John'."); } @Test public void testLastName() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getLastName(), "User", "User last name not equal to 'User'."); a.setLastName("Doe"); assertEquals(a.getLastName(), "Doe", "User last name not equal to 'Doe'."); } @Test public void testEmail() { Account a = new Account("Test", "User", "[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); a.setEmail("[email protected]"); assertEquals(a.getEmail(), "[email protected]", "User email not equal to '[email protected]'."); } @Test public void testAcceptedTermsOfService() { Account a = new Account(); a.setTermsOfService(true); assertTrue(a.acceptedTermsOfService(), "Accepted Terms of Service not true."); a.setTermsOfService(false); assertFalse(a.acceptedTermsOfService(), "Accepted Terms of Service not false."); } @Test public void testAcceptedSystemEmails() { Account a = new Account(); a.setSystemEmails(true); assertTrue(a.acceptedSystemEmails(), "System Emails is not true."); a.setSystemEmails(false); assertFalse(a.acceptedSystemEmails(), "System Emails is not false."); } }

    Read the article

  • Unbelievable: Cannot cast from class X to its super class

    - by Phuong Nguyen de ManCity fan
    I'm encountering a very weird problem with Spring (3.0.1.RELEASE), TestNG (5.11) and Maven Surefire (2.5). I have a test class that extends a Spring helper class for testNG so that test context can be loaded from an xml file (that contains some bean definitions). My project was imported into eclipse using m2eclipse (using Import Maven Project) The class run fine in Eclipse TestNG runner. However, it throws this exception with Maven Surefire Caused by: java.lang.ClassCastException: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123) at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:89) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) I have eliminated all involved dependencies in my pom so that the two classes com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl and javax.xml.parsers.DocumentBuilderFactory are coming from JRE only (the rt.jar). So, it looks so unbelievable to me. I wonder if there is any mechanism in loading class that can explain for this behavior? Thanks.

    Read the article

  • Servlet unit test

    - by Thomman
    Currently I'm using TestNG framework for testing application business logic, i added some Servlet classes recently. How do I unit test these Servlet classes in TestNg framework?

    Read the article

  • java.lang.IllegalStateException: missing behavior definition for the preceding method call getMessag

    - by user362199
    Hi All, I'm using EasyMock(version 2.4) and TestNG for writing UnitTest. I have a following scenario and I cannot change the way class hierarchy is defined. I'm testing ClassB which is extending ClassA. ClassB look like this public class ClassB extends ClassA { public ClassB() { super("title"); } @Override public String getDisplayName() { return ClientMessages.getMessages("ClassB.title"); } } ClassA code public abstract class ClassA { private String title; public ClassA(String title) { this.title = ClientMessages.getMessages(title); } public String getDisplayName() { return this.title; } } ClientMessages class code public class ClientMessages { private static MessageResourse messageResourse; public ClientMessages(MessageResourse messageResourse) { this.messageResourse = messageResourse; } public static String getMessages(String code) { return messageResourse.getMessage(code); } } MessageResourse Class code public class MessageResourse { public String getMessage(String code) { return code; } } Testing ClassB import static org.easymock.classextension.EasyMock.createMock; import org.easymock.classextension.EasyMock; import org.testng.Assert; import org.testng.annotations.Test; public class ClassBTest { private MessageResourse mockMessageResourse = createMock(MessageResourse.class); private ClassB classToTest; private ClientMessages clientMessages; @Test public void testGetDisplayName() { EasyMock.expect(mockMessageResourse.getMessage("ClassB.title")).andReturn("someTitle"); clientMessages = new ClientMessages(mockMessageResourse); classToTest = new ClassB(); Assert.assertEquals("someTitle" , classToTest.getDisplayName()); EasyMock.replay(mockMessageResourse); } } When I'm running this this test I'm getting following exception: java.lang.IllegalStateException: missing behavior definition for the preceding method call getMessage("title") While debugging what I found is, it's not considering the mock method call mockMessageResourse.getMessage("ClassB.title") as it has been called from the construtor (ClassB object creation). Can any one please help me how to test in this case. Thanks.

    Read the article

  • How to run test suit with Spring TestContext ?

    - by lisak
    Hey, I can't figure out, how to set up following scenario with Sprint TestContext with either JUnit4 or testNG: @BeforeTestSuit - oneTimeSetUp @BeforeClass @Before - setUp @Test - testEmptyCollection @After - tearDown @Before - setUp @Test - testEmptyCollection @After - tearDown @AfterClass @BeforeClass @Before - setUp @Test - testOneItemCollection @After - tearDown @Before - setUp @Test - testEmptyCollection @After - tearDown @AfterClass @AfterTestSuit - oneTimeTearDown Could please anybody help me out here ? My architecture is a parent class with @RunWith(SpringJUnit4ClassRunner.class) that is extended with particular test classes.

    Read the article

  • NoSuchMethodError with Spring MutableValues

    - by jakob
    Hello experts! I have written a test where i specify my application context location with annotations. I then autowire my dao into the test. @ContextConfiguration(locations = {"file:service/src/main/webapp/WEB-INF/applicationContext.xml"}) public class MyTest extends AbstractTestNGSpringContextTests { @Autowired protected MyDao myDao; private PlatformTransactionManager transactionManager; private TransactionTemplate transactionTemplate; @Test public void shouldSaveEntityToDb() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { protected void doInTransactionWithoutResult(TransactionStatus status) { Entity entity = new Entity(); //test myDao.save(entity) //assert assertNotNull(entity.getId()); } }); } When i run the test i get an exception which states that the application context could not be loaded and it boils down to: Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues; I have no idea where to start looking, why do i get this error and how can i resolve it? Info springframework 3.0.2.RELEASE, Hibernate 3.4.0.GA, testng 5.9 Thank you!

    Read the article

  • Getting black images with selenium.captureScreenshot

    - by Lidia
    I'm executing selenium tests with testng, that are started on a remote system with Selenium RC via hudson (with ssh connection). The remote system is windows xp with MKS Toolkit installed, hence ssh. Tests are NOT executed as a windows service. I've tried using both captureScreenshot and captureEntirePageScreenshot methods. The first one always produces a black image. The second one creates the correct screen shot but it only works on Firefox and our tests usually pass on Firefox and fail in other browsers, so it is crucial to capture screen shots for the other browsers (mainly IE and Safari). The tests are ran in parallel, with many browser windows open at the same time. I'm not certain if this is what's causing the problem. Any thoughts will be appreciated.

    Read the article

  • Is there a Java Package for testing RESTful APIs?

    - by Zachary Spencer
    I'm getting ready to dive into testing of a RESTful service. The majority of our systems are built in Java and Eclipse, so I'm hoping to stay there. I've already found rest-client (http://code.google.com/p/rest-client/) for doing manual and exploratory testing, but is there a stack of java classes that may make my life easier? I'm using testNG for the test platform, but would love helper libraries that can save me time. I've found http4e (http://www.ywebb.com/) but I'd really like something FOSS.

    Read the article

  • How to let the matcher to match the second invocation on mock?

    - by Alex Luya
    I have an interface like this public interface EventBus{ public void fireEvent(GwtEvent<?> event); } and test code(testng method) looks like this: @Test public void testFireEvent(){ EventBus mock=mock(EventBus.class); //when both Event1 and Event2 are subclasses of GwtEvent<?> mock.fireEvent(new Event1()); mock.fireEvent(new Event2()); //then verify(mock).fireEvent(argThat(new Event2Matcher())); } Event2Matcher looks like this: private class Event2Matcher extends ArgumentMatcher<Event2> { @Override public boolean matches(Object arg) { return ((Event2) arg).getSth==sth; } } But get an error indicating that: Event1 can't be cast to Event2 And obviously,the matcher matched the first invoking mock.fireEvent(new Event1()); So,the statement within matcher return ((Event2) arg).getSth==sth; Will throw out this exception.So the question is how to let verify(mock).fireEvent(argThat(new Event2Matcher())); to match the second invoking?

    Read the article

  • not able to select hidden link - selenium

    - by Maddy
    I have to select web link when i mouse hover to particular frame in the webpage, the button(link to next page) will be visible. WebElement mainElement = driver.findElement(By.xpath(<frame xpath >)); Actions builder = new Actions(driver); builder.moveToElement(mainElement); WebElement button1 = driver.findElement(By.xpath("//*[@id='currentSkills']/div[1]/div/a")); builder.moveToElement(button1).click().perform(); I am still unable to select the particular link when i execute, the following error am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 131 milliseconds But when i hover mouse pointer to the particular frame during AUT(just to move to particular frame without clicking anything), then test is executing sucessfully. I know this can be handled by JS. But i want to find out is there any solution within selenium webdriver Your help is much appreciated... Thanks Madan

    Read the article

  • Reports Generation for Web Based Application Using Selenium Tool

    - by Rahul Mendiratta
    Currently we are generating HTML Reports for Automation, but those reports are not good enough to explain number of scenario which we cover in Automation, Is there anything we can use with Selenium to generate a proper reports which can give a complete overview and can easily understand by anyone First Thing we can show a complete pie charts which cover number of test case passed and Failed. Second thing we can show, what are test cases are there in this build.

    Read the article

  • Seam unit test can't connect to JBoss4.0.5GA

    - by user240423
    Does anybody know how to connect with JBoss4.0.5GA in Seam2.2.0GA unit test? I'm using Seam2.2.0GA with the embeded JBoss to run the unit test, the module needs to call old JBoss server (EJB2, because the vendor locked in JCA has to deploy on old JBoss). it's typical seam test case, and I can't get it connect to JBoss4.0.5GA by using jbossall-client.jar from JBoss4.0.5GA. so far I tested the embeded JBoss can only working with JBoss5.X server. with JBoss4.2.3GA, it report: [testng] java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is: [testng] java.net.SocketException: end of file [testng] at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:122) [testng] at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:679) [testng] at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122) [testng] at org.jboss.remoting.Client.invoke(Client.java:1634) [testng] at org.jboss.remoting.Client.invoke(Client.java:548) This is the best result I could get (JBoss5.1.0GA jbossall-client.jar call JBoss4.2.3GA server in the embeded JBoss env), here is the ant script: <testng classpathref="build.test.classpath" outputDir="${target.test-reports.dir}" haltOnfailure="true"> <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true" /> <jvmarg line="-Dorg.jboss.j2ee.Serialization=true" /> <!-- <jvmarg line="-Djboss.remoting.pre_2_0_compatible=true" /> --> <jvmarg line="-Djboss.jndi.url=jnp://localhost:1099" /> <xmlfileset dir="src/test/java" includes="${ant.project.name}-testsuite.xml" /> </testng> Can anybody help?

    Read the article

  • Bit by bit comparison of using Java or Python for unit testing frameworks and Selenium

    - by Anirudh
    Currently we are in the process of finalizing which language out of Java, Python should be used for Automation using selenium webdriver and a suitable unit testing frameworks. I have made use of Junit, TestNG and webdriver while using with Java and have designed frameworks without much fuss before. I am new to python though I came across pyhton's unit testing frameworks like unittest, pyunit, nose e.t.c but I have doubts if they would be as successful as testNG or Java. I would like to analyze point by point when used with selenium webdriver as below: 1)I have read that as Python is an interpreted language hence it's execution is slower, so say if I have to run 1000 test cases which take about 6 hours to run in Java, would python take considerably longer time for the same test cases like 8 hours? 2)Can the Python unit testing framework be as flexible as a Java unit testing framework like testNG in terms or Grouping the tests, parallel execution, skipping test. e.t.c 3)Also one point that I think of is that Python with selenium webdriver doeasn't have as big or learned community as we have for Java with webdriver, say if I run into trouble with something I am more likely to find an answer for Java as compared to python? 4)Somewhat related to point 3, is it safe to rely on tools, plugins or even webderiver's python's binding as a continuously well maintained? 5)One major drawback as I see while using python's unit testing framework is lack of boilerplate code or libraries for nicely illustrative HTML reports preferably historical reports with Pie charts, bar graphs and timelines as we have in case of Java like Allure, TestNG's default reports, reportNG or Junit reports with the help of ANT as shown below Allure Reports Junit Historical reports Also I would like to emphasize on the fact if there is a way for one to write the framework in java and make libraries or utilities according to out application in webdriver which can easily be called or integrated in with python code or modules? That would actually solve the problem for us as the client would be able to use the code we write in Java and make use of the same or call it from their python modules?

    Read the article

  • Can a Java HashMap's size() be out of sync with its actual entries' size ?

    - by trix
    I have a Java HashMap called statusCountMap. Calling size() results in 30. But if I count the entries manually, it's 31 This is in one of my TestNG unit tests. These results below are from Eclipse's Display window (type code - highlight - hit Display Result of Evaluating Selected Text). statusCountMap.size() (int) 30 statusCountMap.keySet().size() (int) 30 statusCountMap.values().size() (int) 30 statusCountMap (java.util.HashMap) {40534-INACTIVE=2, 40526-INACTIVE=1, 40528-INACTIVE=1, 40492-INACTIVE=3, 40492-TOTAL=4, 40513-TOTAL=6, 40532-DRAFT=4, 40524-TOTAL=7, 40526-DRAFT=2, 40528-ACTIVE=1, 40524-DRAFT=2, 40515-ACTIVE=1, 40513-DRAFT=4, 40534-DRAFT=1, 40514-TOTAL=3, 40529-DRAFT=4, 40515-TOTAL=3, 40492-ACTIVE=1, 40528-TOTAL=4, 40514-DRAFT=2, 40526-TOTAL=3, 40524-INACTIVE=2, 40515-DRAFT=2, 40514-ACTIVE=1, 40534-TOTAL=3, 40513-ACTIVE=2, 40528-DRAFT=2, 40532-TOTAL=4, 40524-ACTIVE=3, 40529-ACTIVE=1, 40529-TOTAL=5} statusCountMap.entrySet().size() (int) 30 What gives ? Anyone has experienced this ? I'm pretty sure statusCountMap is not being modified at this point. There are 2 methods (lets call them methodA and methodB) that modify statusCountMap concurrently, by repeatedly calling incrementCountInMap. private void incrementCountInMap(Map map, Long id, String qualifier) { String key = id + "-" + qualifier; if (map.get(key) == null) { map.put(key, 0); } synchronized (map) { map.put(key, map.get(key).intValue() + 1); } } methodD is where I'm getting the issue. methodD has a TestNG @dependsOnMethods = { "methodA", "methodB" } so when methodD is executing, statusCountMap is pretty much static already. I'm mentioning this because it might be a bug in TestNG. I'm using Sun JDK 1.6.0_24. TestNG is testng-5.9-jdk15.jar Hmmm ... after rereading my post, could it be because of concurrent execution of outside-of-synchronized-block map.get(key) == null & map.put(key,0) that's causing this issue ?

    Read the article

  • Google App Engine: Unit testing concurrent access to memcache

    - by Phuong Nguyen de ManCity fan
    Would you guys show me a way to simulating concurrent access to memcache on Google App Engine? I'm trying with LocalServiceTestHelpers and threads but don't have any luck. Every time I try to access Memcache within a thread, then I get this error: ApiProxy$CallNotFoundException: The API package 'memcache' or call 'Increment()' was not found I guess that the testing library of GAE SDK tried to mimic the real environment and thus setup the environment for only one thread (the thread that running the test) which cannot be seen by other thread. Here is a piece of code that can reproduce the problem package org.seamoo.cache.memcacheImpl; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.google.appengine.api.memcache.MemcacheService; import com.google.appengine.api.memcache.MemcacheServiceFactory; import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; public class MemcacheTest { LocalServiceTestHelper helper; public MemcacheTest() { LocalMemcacheServiceTestConfig memcacheConfig = new LocalMemcacheServiceTestConfig(); helper = new LocalServiceTestHelper(memcacheConfig); } /** * */ @BeforeMethod public void setUp() { helper.setUp(); } /** * @see LocalServiceTest#tearDown() */ @AfterMethod public void tearDown() { helper.tearDown(); } @Test public void memcacheConcurrentAccess() throws InterruptedException { final MemcacheService service = MemcacheServiceFactory.getMemcacheService(); Runnable runner = new Runnable() { @Override public void run() { // TODO Auto-generated method stub service.increment("test-key", 1L, 1L); try { Thread.sleep(200L); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } service.increment("test-key", 1L, 1L); } }; Thread t1 = new Thread(runner); Thread t2 = new Thread(runner); t1.start(); t2.start(); while (t1.isAlive()) { Thread.sleep(100L); } Assert.assertEquals((Long) (service.get("test-key")), new Long(4L)); } }

    Read the article

  • Connection Refused running multiple environments on Selenium Grid 1.04 via Ubuntu 9.04

    - by ReadyWater
    Hello, I'm writing a selenium grid test suite which is going to be run on a series of different machines. I wrote most of it on my macbook but have recently transfered it over to my work machine, which is running ubuntu 9.04. That's actually my first experience with a linux machine, so I may be missing something very simple (I have disabled the firewall though). I haven't been able to get the multienvironment thing working at all, and I've been trying and manual reviewing for a while. Any recommendations and help would be greatly, greatly appreciated! The error I'm getting when I run the test is: [java] FAILED CONFIGURATION: @BeforeMethod startFirstEnvironment("localhost", 4444, "*safari", "http://remoteURL:8080/tutor") [java] java.lang.RuntimeException: Could not start Selenium session: ERROR: Connection refused I thought it might be the mac refusing the connection, but using wireshark I determined that no connection attempt was made on the mac . Here's the code for setting up the session, which is where it seems to be dying @BeforeMethod(groups = {"default", "example"}, alwaysRun = true) @Parameters({"seleniumHost", "seleniumPort", "firstEnvironment", "webSite"}) protected void startFirstEnvironment(String seleniumHost, int seleniumPort, String firstEnvironment, String webSite) throws Exception { try{ startSeleniumSession(seleniumHost, seleniumPort, firstEnvironment, webSite); session().setTimeout(TIMEOUT); } finally { closeSeleniumSession(); } } @BeforeMethod(groups = {"default", "example"}, alwaysRun = true) @Parameters({"seleniumHost", "seleniumPort", "secondEnvironment", "webSite"}) protected void startSecondEnvironment(String seleniumHost, int seleniumPort, String secondEnvironment, String webSite) throws Exception { try{ startSeleniumSession(seleniumHost, seleniumPort, secondEnvironment, webSite); session().setTimeout(TIMEOUT); } finally { closeSeleniumSession(); } } and the accompanying build script used to run the test <target name="runMulti" depends="compile" description="Run Selenium tests in parallel (20 threads)"> <echo>${seleniumHost}</echo> <java classpathref="runtime.classpath" classname="org.testng.TestNG" failonerror="true"> <sysproperty key="java.security.policy" file="${rootdir}/lib/testng.policy"/> <sysproperty key="webSite" value="${webSite}" /> <sysproperty key="seleniumHost" value="${seleniumHost}" /> <sysproperty key="seleniumPort" value="${seleniumPort}" /> <sysproperty key="firstEnvironment" value="${firstEnvironment}" /> <sysproperty key="secondEnvironment" value="${secondEnvironment}" /> <arg value="-d" /> <arg value="${basedir}/target/reports" /> <arg value="-suitename" /> <arg value="Selenium Grid Java Sample Test Suite" /> <arg value="-parallel"/> <arg value="methods"/> <arg value="-threadcount"/> <arg value="15"/> <arg value="testng.xml"/> </java>

    Read the article

  • Webdriver PageObject Implementation using PageFactory in Java

    - by kamal
    here is what i have so far: A working Webdriver based Java class, which logs-in to the application and goes to a Home page: import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.testng.AssertJUnit; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class MLoginFFTest { private WebDriver driver; private String baseUrl; private String fileName = "screenshot.png"; @BeforeMethod public void setUp() throws Exception { FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.http.phishy-userpass-length", 255); profile.setAssumeUntrustedCertificateIssuer(false); driver = new FirefoxDriver(profile); baseUrl = "https://a.b.c.d/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testAccountLogin() throws Exception { driver.get(baseUrl + "web/certLogon.jsp"); driver.findElement(By.name("logonName")).clear(); AssertJUnit.assertEquals(driver.findElement(By.name("logonName")) .getTagName(), "input"); AssertJUnit.assertEquals(driver.getTitle(), "DA Logon"); driver.findElement(By.name("logonName")).sendKeys("username"); driver.findElement(By.name("password")).clear(); driver.findElement(By.name("password")).sendKeys("password"); driver.findElement(By.name("submit")).click(); driver.findElement(By.linkText("Account")).click(); AssertJUnit.assertEquals(driver.getTitle(), "View Account"); } @AfterMethod public void tearDown() throws Exception { File screenshot = ((TakesScreenshot) driver) .getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(screenshot, new File(fileName)); } catch (IOException e) { e.printStackTrace(); } driver.quit(); } } Now as we see there are 2 pages: 1. Login page, where i have to enter username and password, and homepage, where i would be taken, once the authentication succeeds. Now i want to implement this as PageObjects using Pagefactory: so i have : package com.example.pageobjects; import static com.example.setup.SeleniumDriver.getDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.FluentWait; import org.openqa.selenium.support.ui.Wait; public abstract class MPage<T> { private static final String BASE_URL = "https://a.b.c.d/"; private static final int LOAD_TIMEOUT = 30; private static final int REFRESH_RATE = 2; public T openPage(Class<T> clazz) { T page = PageFactory.initElements(getDriver(), clazz); getDriver().get(BASE_URL + getPageUrl()); ExpectedCondition pageLoadCondition = ((MPage) page).getPageLoadCondition(); waitForPageToLoad(pageLoadCondition); return page; } private void waitForPageToLoad(ExpectedCondition pageLoadCondition) { Wait wait = new FluentWait(getDriver()) .withTimeout(LOAD_TIMEOUT, TimeUnit.SECONDS) .pollingEvery(REFRESH_RATE, TimeUnit.SECONDS); wait.until(pageLoadCondition); } /** * Provides condition when page can be considered as fully loaded. * * @return */ protected abstract ExpectedCondition getPageLoadCondition(); /** * Provides page relative URL/ * * @return */ public abstract String getPageUrl(); } And for login Page not sure how i would implement that, as well as the Test, which would call these pages.

    Read the article

  • Mock Objects for Unit Testing

    - by user9009
    Hello How often QA engineers are responsible for developing Mock Objects for Unit Testing. So dealing with Mock Objects is just developer job ?. The reason i ask is i'm interested in QA as my career and am learning tools like JUnit , TestNG and couple of frameworks. I just want to know until what level of unit testing is done by developer and from what point QA engineer takes over testing for better test coverage ? Thanks

    Read the article

  • IntellIJ editor doesn't appear

    - by neveu
    I updated my IntellIJ install to the latest version (11.1.4) and now the Editor window doesn't appear. Double-clicking on the file, jump-to-source, nothing happens. No error message, it just doesn't appear. If I double-click on an xml layout file the preview window works, but no Editor window. Have installed and reinstalled; went back to an earlier version and it doesn't work there either. I'm at a loss. Any ideas? Update: Editor works if I create a new project. Update 2: idea.log file includes this (I don't know what ins.android.sdk.AndroidSdkData is): 2012-11-04 20:40:52,481 [ 2677] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/macros.xml file is null 2012-11-04 20:40:52,481 [ 2677] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/macros.xml 2012-11-04 20:40:52,482 [ 2678] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/quicklists.xml file is null 2012-11-04 20:40:52,482 [ 2678] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/quicklists.xml 2012-11-04 20:40:52,564 [ 2760] INFO - pl.stores.ApplicationStoreImpl - 76 application components initialized in 1285 ms 2012-11-04 20:40:52,575 [ 2771] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/customization.xml file is null 2012-11-04 20:40:52,575 [ 2771] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/customization.xml 2012-11-04 20:40:52,674 [ 2870] INFO - ij.openapi.wm.impl.IdeRootPane - App initialization took 3385 ms 2012-11-04 20:40:53,136 [ 3332] INFO - TestNG Runner - Create TestNG Template Configuration 2012-11-04 20:40:53,138 [ 3334] INFO - TestNG Runner - Create TestNG Template Configuration 2012-11-04 20:40:53,253 [ 3449] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dynamic.xml file is null 2012-11-04 20:40:53,253 [ 3449] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dynamic.xml 2012-11-04 20:40:53,280 [ 3476] INFO - api.vfs.impl.local.FileWatcher - 1 paths checked, 0 mapped, 202 mks 2012-11-04 20:40:53,366 [ 3562] INFO - ellij.project.impl.ProjectImpl - 137 project components initialized in 403 ms 2012-11-04 20:40:53,563 [ 3759] INFO - .module.impl.ModuleManagerImpl - 4 modules loaded in 197 ms 2012-11-04 20:40:53,625 [ 3821] INFO - api.vfs.impl.local.FileWatcher - 6 paths checked, 0 mapped, 150 mks 2012-11-04 20:40:54,187 [ 4383] INFO - .roots.impl.DirectoryIndexImpl - Directory index initialized in 271 ms, indexed 1611 directories 2012-11-04 20:40:54,207 [ 4403] INFO - pl.PushedFilePropertiesUpdater - File properties pushed in 18 ms 2012-11-04 20:40:54,237 [ 4433] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/plainTextFiles.xml file is null 2012-11-04 20:40:54,237 [ 4433] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/plainTextFiles.xml 2012-11-04 20:40:54,246 [ 4442] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gant_config.xml file is null 2012-11-04 20:40:54,246 [ 4442] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gant_config.xml 2012-11-04 20:40:54,253 [ 4449] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gradle.xml file is null 2012-11-04 20:40:54,253 [ 4449] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/gradle.xml 2012-11-04 20:40:55,855 [ 6051] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/IntelliLang.xml file is null 2012-11-04 20:40:55,855 [ 6051] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/IntelliLang.xml 2012-11-04 20:40:56,995 [ 7191] INFO - leEditor.impl.EditorsSplitters - splitter 2012-11-04 20:40:56,996 [ 7192] INFO - leEditor.impl.EditorsSplitters - splitter 2012-11-04 20:40:57,233 [ 7429] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/codeStyleSettings.xml file is null 2012-11-04 20:40:57,233 [ 7429] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/codeStyleSettings.xml 2012-11-04 20:40:57,234 [ 7430] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml file is null 2012-11-04 20:40:57,234 [ 7430] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml 2012-11-04 20:40:58,145 [ 8341] INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 3911 ms 2012-11-04 20:40:58,146 [ 8342] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update 2012-11-04 20:40:58,146 [ 8342] INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 0 ms 2012-11-04 20:40:58,362 [ 8558] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml file is null 2012-11-04 20:40:58,362 [ 8558] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/fileColors.xml 2012-11-04 20:41:00,420 [ 10616] INFO - ins.android.sdk.AndroidSdkData - For input string: "20.0.1" java.lang.NumberFormatException: For input string: "20.0.1" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:458) at java.lang.Integer.parseInt(Integer.java:499) at org.jetbrains.android.sdk.AndroidSdkData.parsePackageRevision(AndroidSdkData.java:86) at org.jetbrains.android.sdk.AndroidSdkData.<init>(AndroidSdkData.java:73) at org.jetbrains.android.sdk.AndroidSdkData.parse(AndroidSdkData.java:167) at org.jetbrains.android.sdk.AndroidPlatform.parse(AndroidPlatform.java:83) at org.jetbrains.android.sdk.AndroidSdkAdditionalData.getAndroidPlatform(AndroidSdkAdditionalData.java:119) at org.jetbrains.android.facet.AndroidFacet.addResourceFolderToSdkRootsIfNecessary(AndroidFacet.java:532) at org.jetbrains.android.facet.AndroidFacet.access$500(AndroidFacet.java:103) at org.jetbrains.android.facet.AndroidFacet$3.run(AndroidFacet.java:440) at com.intellij.ide.startup.impl.StartupManagerImpl$6.run(StartupManagerImpl.java:230) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivities(StartupManagerImpl.java:203) at com.intellij.ide.startup.impl.StartupManagerImpl.access$100(StartupManagerImpl.java:41) at com.intellij.ide.startup.impl.StartupManagerImpl$4.run(StartupManagerImpl.java:170) at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:213) at com.intellij.openapi.project.DumbServiceImpl.access$1000(DumbServiceImpl.java:51) at com.intellij.openapi.project.DumbServiceImpl$IndexUpdateRunnable$1$3.run(DumbServiceImpl.java:363) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:702) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:663) at java.awt.EventQueue$2.run(EventQueue.java:661) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:672) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 2012-11-04 20:41:00,459 [ 10655] INFO - ins.android.sdk.AndroidSdkData - For input string: "20.0.1" java.lang.NumberFormatException: For input string: "20.0.1" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:458) at java.lang.Integer.parseInt(Integer.java:499) at org.jetbrains.android.sdk.AndroidSdkData.parsePackageRevision(AndroidSdkData.java:86) at org.jetbrains.android.sdk.AndroidSdkData.<init>(AndroidSdkData.java:73) at org.jetbrains.android.sdk.AndroidSdkData.parse(AndroidSdkData.java:167) at org.jetbrains.android.sdk.AndroidPlatform.parse(AndroidPlatform.java:83) at org.jetbrains.android.sdk.AndroidSdkAdditionalData.getAndroidPlatform(AndroidSdkAdditionalData.java:119) at org.jetbrains.android.facet.AndroidFacet.addResourceFolderToSdkRootsIfNecessary(AndroidFacet.java:532) at org.jetbrains.android.facet.AndroidFacet.access$500(AndroidFacet.java:103) at org.jetbrains.android.facet.AndroidFacet$3.run(AndroidFacet.java:440) at com.intellij.ide.startup.impl.StartupManagerImpl$6.run(StartupManagerImpl.java:230) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivities(StartupManagerImpl.java:203) at com.intellij.ide.startup.impl.StartupManagerImpl.access$100(StartupManagerImpl.java:41) at com.intellij.ide.startup.impl.StartupManagerImpl$4.run(StartupManagerImpl.java:170) at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:213) at com.intellij.openapi.project.DumbServiceImpl.access$1000(DumbServiceImpl.java:51) at com.intellij.openapi.project.DumbServiceImpl$IndexUpdateRunnable$1$3.run(DumbServiceImpl.java:363) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:702) at java.awt.EventQueue.access$400(EventQueue.java:82) at java.awt.EventQueue$2.run(EventQueue.java:663) at java.awt.EventQueue$2.run(EventQueue.java:661) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:672) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 2012-11-04 20:41:01,305 [ 11501] INFO - tor.impl.FileEditorManagerImpl - Project opening took 8374 ms 2012-11-04 20:41:01,719 [ 11915] INFO - dom.attrs.AttributeDefinitions - Found tag with unknown parent: AndroidManifest.AndroidManifestCompatibleScreens 2012-11-04 20:41:07,522 [ 17718] INFO - roid.compiler.tools.AndroidApt - [/Users/neveu/Dev/android-sdk-macosx/platform-tools/aapt] [package] [-m] [--non-constant-id] [-J] [/private/var/folders/xb/hg6cdxt51rs8lylmmjw0fk8m0000gp/T/android_apt_autogeneration6157451500950136901tmp] [-M] [/Users/neveu/Dev/magic_android/3rdParty/facebook/AndroidManifest.xml] [-S] [/Users/neveu/Dev/magic_android/3rdParty/facebook/res] [-I] [/Users/neveu/Dev/android-sdk-macosx/platforms/android-14/android.jar] 2012-11-04 20:41:08,706 [ 18902] INFO - roid.compiler.tools.AndroidApt - [/Users/neveu/Dev/android-sdk-macosx/platform-tools/aapt] [package] [-m] [-J] [/private/var/folders/xb/hg6cdxt51rs8lylmmjw0fk8m0000gp/T/android_apt_autogeneration3143184519400737414tmp] [-M] [/Users/neveu/Dev/magic_android/AndroidManifest.xml] [-S] [/Users/neveu/Dev/magic_android/res] [-I] [/Users/neveu/Dev/android-sdk-macosx/platforms/android-15/android.jar] 2012-11-04 20:41:08,763 [ 18959] INFO - roid.compiler.tools.AndroidIdl - [/Users/neveu/Dev/android-sdk-macosx/platform-tools/aidl] [-p/Users/neveu/Dev/android-sdk-macosx/platforms/android-15/framework.aidl] [-I/Users/neveu/Dev/magic_android/magic/src] [-I/Users/neveu/Dev/magic_android/src] [-I/Users/neveu/Dev/magic_android/3rdParty/Tapjoy] [-I/Users/neveu/Dev/magic_android/gen] [/Users/neveu/Dev/magic_android/src/com/android/vending/billing/IMarketBillingService.aidl] [/Users/neveu/Dev/magic_android/gen/com/android/vending/billing/IMarketBillingService.java] 2012-11-04 20:41:14,004 [ 24200] INFO - dom.attrs.AttributeDefinitions - Found tag with unknown parent: AndroidManifest.AndroidManifestCompatibleScreens 2012-11-04 20:41:18,781 [ 28977] INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/cachedDictionary.xml file is null 2012-11-04 20:41:18,782 [ 28978] INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/cachedDictionary.xml

    Read the article

  • AbstractMethodError on org.apache.xalan.processor.TransformerFactoryImpl

    - by JBristow
    With the following code: private Document transformDoc(Source source) throws TransformerException, IOException { Transformer xslTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(pdfTransformXslt.getInputStream())); xslTransformer.setParameter("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); xslTransformer.setParameter("http://xml.org/sax/features/validation", false); JDOMResult result = new JDOMResult(); xslTransformer.transform(source, result); return result.getDocument(); } I'm getting the following error: java.lang.AbstractMethodError: org.apache.xalan.processor.TransformerFactoryImpl.setFeature(Ljava/lang/String;Z)V Why is this? Here's my Maven dependency tree: ------------------------------------------------------------------------ Building mc-hub-batch task-segment: [dependency:tree] ------------------------------------------------------------------------ snapshot com.billmelater:mc-test-support:2.0.0.11-SNAPSHOT: checking for updates from repository.jboss.org [dependency:tree {execution: default-cli}] com.billmelater:mc-hub-batch:jar:2.0.0.11-SNAPSHOT +- com.billmelater:mc-hub-core:jar:2.0.0.11-SNAPSHOT:compile | +- commons-lang:commons-lang:jar:2.4:compile | +- commons-collections:commons-collections:jar:3.2.1:compile | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile | +- commons-digester:commons-digester:jar:2.0:compile | | +- (commons-beanutils:commons-beanutils:jar:1.8.0:compile - omitted for duplicate) | | \- (commons-logging:commons-logging:jar:1.1.1:compile - version managed from 1.0.4; omitted for duplicate) | \- (org.springframework.batch:spring-batch-core:jar:2.0.2.RELEASE:compile - omitted for duplicate) +- com.billmelater:mc-test-support:jar:2.0.0.11-SNAPSHOT:test | +- (com.billmelater:mc-hub-core:jar:2.0.0.11-SNAPSHOT:test - omitted for duplicate) | +- (org.springframework:spring:jar:2.5.6:test - omitted for duplicate) | +- org.springframework:spring-jdbc:jar:2.5.6.SEC01:test | | +- (commons-logging:commons-logging:jar:1.1.1:test - omitted for duplicate) | | +- (org.springframework:spring-beans:jar:2.5.6.SEC01:test - omitted for conflict with 2.5.6) | | +- (org.springframework:spring-context:jar:2.5.6.SEC01:test - omitted for conflict with 2.5.6) | | +- (org.springframework:spring-core:jar:2.5.6.SEC01:test - omitted for conflict with 2.5.6) | | \- (org.springframework:spring-tx:jar:2.5.6.SEC01:test - omitted for conflict with 2.5.6) | +- (org.dbunit:dbunit:jar:2.4.5:test - omitted for duplicate) | +- (log4j:log4j:jar:1.2.15:test - omitted for duplicate) | +- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.5.8; scope updated from test; omitted for duplicate) | +- (org.slf4j:slf4j-log4j12:jar:1.5.6:test - omitted for duplicate) | +- org.jboss.seam:jboss-seam:jar:2.2.0.GA:test | | +- xstream:xstream:jar:1.1.3:test | | +- (xpp3:xpp3_min:jar:1.1.3.4.O:compile - scope updated from test; omitted for duplicate) | | \- org.jboss.el:jboss-el:jar:1.0_02.CR4:test | +- (org.testng:testng:jar:jdk15:5.8:test - omitted for duplicate) | +- (org.hibernate:hibernate-core:jar:3.3.2.GA:test - version managed from 3.3.0.SP1; omitted for duplicate) | +- org.hibernate:hibernate-entitymanager:jar:3.4.0.GA:test | | +- (org.hibernate:ejb3-persistence:jar:1.0.2.GA:test - omitted for duplicate) | | +- (org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:test - omitted for duplicate) | | +- (org.hibernate:hibernate-annotations:jar:3.4.0.GA:test - omitted for duplicate) | | +- (org.hibernate:hibernate-core:jar:3.3.2.GA:test - version managed from 3.3.0.SP1; omitted for duplicate) | | +- (org.slf4j:slf4j-api:jar:1.5.6:test - version managed from 1.4.2; omitted for duplicate) | | +- (dom4j:dom4j:jar:1.6.1-jboss:test - version managed from 1.6.1; omitted for duplicate) | | +- (javax.transaction:jta:jar:1.0.1B:test - version managed from 1.1; omitted for duplicate) | | \- javassist:javassist:jar:3.4.GA:test | +- (org.hibernate:hibernate-validator:jar:3.1.0.GA:test - omitted for duplicate) | +- (org.apache.velocity:velocity:jar:1.6.2:test - omitted for duplicate) | \- (ojdbc:ojdbc:jar:14:test - omitted for duplicate) +- org.springframework:spring:jar:2.5.6:compile +- org.springframework.batch:spring-batch-core:jar:2.0.2.RELEASE:compile | +- org.springframework.batch:spring-batch-infrastructure:jar:2.0.2.RELEASE:compile | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | | +- (org.springframework:spring-core:jar:2.5.6:compile - omitted for duplicate) | | \- (stax:stax:jar:1.2.0:compile - omitted for duplicate) | +- org.aspectj:aspectjrt:jar:1.5.4:compile | +- org.aspectj:aspectjweaver:jar:1.5.4:compile | +- com.thoughtworks.xstream:xstream:jar:1.3:compile | | \- xpp3:xpp3_min:jar:1.1.4c:compile | +- org.codehaus.jettison:jettison:jar:1.0:compile | +- org.springframework:spring-aop:jar:2.5.6:compile | | +- aopalliance:aopalliance:jar:1.0:compile | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | | +- (org.springframework:spring-beans:jar:2.5.6:compile - omitted for duplicate) | | \- (org.springframework:spring-core:jar:2.5.6:compile - omitted for duplicate) | +- org.springframework:spring-beans:jar:2.5.6:compile | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | | \- (org.springframework:spring-core:jar:2.5.6:compile - omitted for duplicate) | +- org.springframework:spring-context:jar:2.5.6:compile | | +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate) | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | | +- (org.springframework:spring-beans:jar:2.5.6:compile - omitted for duplicate) | | \- (org.springframework:spring-core:jar:2.5.6:compile - omitted for duplicate) | +- org.springframework:spring-core:jar:2.5.6:compile | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | +- org.springframework:spring-tx:jar:2.5.6:compile | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for duplicate) | | +- (org.springframework:spring-beans:jar:2.5.6:compile - omitted for duplicate) | | +- (org.springframework:spring-context:jar:2.5.6:compile - omitted for duplicate) | | \- (org.springframework:spring-core:jar:2.5.6:compile - omitted for duplicate) | \- stax:stax:jar:1.2.0:compile | \- stax:stax-api:jar:1.0.1:compile +- commons-dbcp:commons-dbcp:jar:1.2.2:compile | \- commons-pool:commons-pool:jar:1.3:compile +- org.hibernate:hibernate-core:jar:3.3.2.GA:compile | +- antlr:antlr:jar:2.7.7:compile (version managed from 2.7.6) | +- dom4j:dom4j:jar:1.6.1-jboss:compile (version managed from 1.6.1) | +- javax.transaction:jta:jar:1.0.1B:compile (version managed from 1.1) | \- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.4.2; omitted for duplicate) +- org.hibernate:hibernate-validator:jar:3.1.0.GA:compile | +- (org.hibernate:hibernate-core:jar:3.3.2.GA:compile - version managed from 3.3.0.SP1; omitted for duplicate) | +- org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile | | \- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.4.2; omitted for duplicate) | \- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.4.2; omitted for duplicate) +- org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile | +- org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile | +- (org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile - omitted for duplicate) | +- (org.hibernate:hibernate-core:jar:3.3.2.GA:compile - version managed from 3.3.0.SP1; omitted for duplicate) | +- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.4.2; omitted for duplicate) | \- (dom4j:dom4j:jar:1.6.1-jboss:compile - version managed from 1.6.1; omitted for duplicate) +- ojdbc:ojdbc:jar:14:compile +- org.slf4j:slf4j-api:jar:1.5.6:compile +- org.slf4j:slf4j-log4j12:jar:1.5.6:compile | \- (org.slf4j:slf4j-api:jar:1.5.6:compile - version managed from 1.4.2; omitted for duplicate) +- log4j:log4j:jar:1.2.15:compile +- org.apache.velocity:velocity:jar:1.6.2:compile | +- (commons-collections:commons-collections:jar:3.2.1:compile - omitted for duplicate) | +- (commons-lang:commons-lang:jar:2.4:compile - omitted for duplicate) | \- oro:oro:jar:2.0.8:compile +- org.testng:testng:jar:jdk15:5.8:test +- org.dbunit:dbunit:jar:2.4.5:test | +- junit:junit:jar:4.7:test (version managed from 3.8.2) | +- (org.slf4j:slf4j-api:jar:1.5.6:test - version managed from 1.4.2; omitted for duplicate) | \- (commons-collections:commons-collections:jar:3.2.1:test - omitted for duplicate) +- hsqldb:hsqldb:jar:1.8.0.7:test +- jboss:javassist:jar:3.3.ga:provided +- org.jdom:jdom:jar:1.1:compile +- jaxen:jaxen:jar:1.1.1:provided +- org.apache.xmlgraphics:fop:jar:0.95:compile | +- (org.apache.xmlgraphics:xmlgraphics-commons:jar:1.3.1:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for cycle) | | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile | | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | | \- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile | | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile | | | +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate) | | | +- (xalan:xalan:jar:2.6.0:compile - omitted for duplicate) | | | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile | | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | | \- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-util:jar:1.7:compile | | \- xml-apis:xml-apis-ext:jar:1.3.04:compile | +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-anim:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle) | | +- (org.apache.xmlgraphics:batik-gvt:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for cycle) | | +- org.apache.xmlgraphics:batik-script:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-xml:jar:1.7:compile | | | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | +- xalan:xalan:jar:2.6.0:compile | | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile | | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-gvt:jar:1.7:compile - omitted for cycle) | | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for duplicate) | | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-gvt:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate) | | +- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile | | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | | \- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-xml:jar:1.7:compile - omitted for duplicate) | | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-extension:jar:1.7:compile | | +- (org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-bridge:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-css:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-dom:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-ext:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-gvt:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-parser:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile - omitted for duplicate) | | +- (org.apache.xmlgraphics:batik-util:jar:1.7:compile - omitted for duplicate) | | \- (xml-apis:xml-apis-ext:jar:1.3.04:compile - omitted for duplicate) | +- org.apache.xmlgraphics:batik-ext:jar:1.7:compile | +- commons-logging:commons-logging:jar:1.1.1:compile | +- commons-io:commons-io:jar:1.3.1:compile | \- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.3.1:compile | +- (commons-io:commons-io:jar:1.3.1:compile - omitted for duplicate) | \- (commons-logging:commons-logging:jar:1.1.1:compile - version managed from 1.0.4; omitted for duplicate) +- org.easymock:easymock:jar:2.0:test \- org.easymock:easymockclassextension:jar:2.2:test +- (org.easymock:easymock:jar:2.2:test - omitted for conflict with 2.0) \- cglib:cglib-nodep:jar:2.2:test (version managed from 2.1_3) Can anyone tell me how to clear out intellij's classpath too?

    Read the article

< Previous Page | 1 2 3  | Next Page >