2009-09-21 17 views
5

हाय मैं खिड़कियों XP का उपयोग कर ट्यूटोरियल यहाँ के माध्यम से काम कर रहा हूँ विकल्प समानांतर और नवीनतम बनाताक्यों Maven एक SurefireExecutionException साथ विफल हो रहा है:> सेट नहीं कर सकता साथ मूल्य

http://binil.wordpress.com/2006/12/08/automated-smoke-tests-with-selenium-cargo-testng-and-maven/

सका किसी कृपया मुझे बताओ क्या टैग कर रहे हैं ।

<parallel>true</parallel> 
<threadCount>10</threadCount> 

जब मैं इन टैग के साथ निर्माण शामिल मैं एक विफलता मिलती है:

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 
Running TestSuite 
org.apache.maven.surefire.booter.SurefireExecutionException: 
Cannot set option parallel with value 
true; nested exception is 
java.lang.reflect.InvocationTargetException: 
null; nested exception is 
org.apache.maven.surefire.util.NestedRuntimeException: 
Cannot set option parallel with value 
true; nested exception is 
java.lang.reflect.InvocationTargetException: 
null 
org.apache.maven.surefire.util.NestedRuntimeException: 
Cannot set option parallel with value 
true; nested exception is 
java.lang.reflect.InvocationTargetException: 
null 
java.lang.reflect.InvocationTargetException 
at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at 
java.lang.reflect.Method.invoke(Method.java:585) 
at 
org.apache.maven.surefire.testng.conf.AbstractDirectConfigurator$Setter.invoke(AbstractDirectConfigurator.java:117) 
at 
org.apache.maven.surefire.testng.conf.AbstractDirectConfigurator.configure(AbstractDirectConfigurator.java:63) 
at 
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:71) 
at 
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92) 
at 
org.apache.maven.surefire.Surefire.run(Surefire.java:177) 
at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at 
java.lang.reflect.Method.invoke(Method.java:585) 
at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) 
at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) 
Caused by: 
java.lang.NullPointerException at 
org.testng.TestNG.setParallel(TestNG.java:347) 
... 15 more [INFO] 
------------------------------------------------------------------------ 
[ERROR] BUILD FAILURE [INFO] 
------------------------------------------------------------------------ 

उत्तर

6

surefire-plugin प्रलेखन से:

समानांतर (TestNG केवल) आप समानांतर विशेषता का उपयोग करते हैं , टेस्टएनजी आपके सभी टेस्ट विधियों को अलग-अलग धागे में चलाने की कोशिश करेगा, एक दूसरे पर निर्भर विधियों को छोड़कर, जो एक ही थ्रेड में दौड़ने के लिए चलाया जाएगा निष्पादन के उनके आदेश ect।

थ्रेडकाउंट (केवल टेस्टएनजी) विशेषता थ्रेड-गिनती आपको यह निर्दिष्ट करने की अनुमति देती है कि इस निष्पादन के लिए कितने धागे आवंटित किए जाने चाहिए। केवल समानांतर के संयोजन के साथ उपयोग करने के लिए समझ में आता है।

प्लगइन दस्तावेज के TestNG page पर समानांतर में परीक्षण चलाने पर एक अनुभाग है। यह आपके अचूक प्लगइन ऐसा करने के लिए इस तरह कॉन्फ़िगर किया जाना चाहिए:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-surefire-plugin</artifactId> 
    <version>2.4.2</version> 
    <configuration> 
    <parallel>methods</parallel> 
    <threadCount>10</threadCount> 
    </configuration> 
</plugin> 
1

true विकल्प parallel लिए एक मान्य मान नहीं है, methods (as per the docs)

1

यह भी हो सकता है यदि आप TestNG के पुराने संस्करण का उपयोग करते हैं।

TestNG के लिए अपनी निर्भरता उन्नयन, उदाहरण के लिए प्रयास करें:

<dependency> 
    <groupId>org.testng</groupId> 
    <artifactId>testng</artifactId> 
    <version>5.11</version> 
    <classifier>jdk15</classifier> 
    <scope>test</scope> 
</dependency> 

पुनश्च: कई लोगों को आम तौर पर संस्करण 5.1 का प्रयोग करेंगे।

चीयर्स

एस अली Tokmen http://ali.tokmen.com/