2013-06-04 42 views
0

我想在Eclipse上測試使用JUnit的servlet。我們將我們的servlet基於Google應用程序引擎教程中的留言板servlet。我的團隊目前沒有數據存儲(我們有一個前端工作),所以我在網絡上四處查看,發現http://tinyurl.com/lvfhrnq,這似乎創建了一個測試服務器來運行他們的servlet,以允許一些更好的測試。無法找出哪些jar添加到Apache-Camel的構建路徑ServletTestSupport

但是,我很難找出哪些jar添加構建路徑,所以我可以使用前面鏈接中提到的ServletTestSupport。我從camel.apache網站下載了apache-camel-2.11.0.tar.gz,並首先添加了jar文件slf4j-api.jar和camel-core.jar,因爲它似乎只需要slf4j-api。罐子。但是,Eclipse仍然沒有認識到ServletTestSupport或任何來自org.apache.camel.component.gae.support的導入

謝謝!

回答

0

如果你使用maven,它會爲你解決這個問題。

儘管這裏是從主幹上的camel-gae的依賴樹。你也許可以用它來找到你需要的JAR

INFO] ------------------------------------------------------------------------ 
[INFO] Building Camel :: GAE 2.12-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-dependency-plugin:2.6:tree (default-cli) @ camel-gae --- 
[INFO] org.apache.camel:camel-gae:bundle:2.12-SNAPSHOT 
[INFO] +- org.apache.camel:camel-servlet:jar:2.12-SNAPSHOT:compile 
[INFO] | +- org.apache.camel:camel-core:jar:2.12-SNAPSHOT:compile (version managed from 2.12-SNAPSHOT) 
[INFO] | \- org.apache.camel:camel-http:jar:2.12-SNAPSHOT:compile (version managed from 2.12-SNAPSHOT) 
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile (version managed from 3.1) 
[INFO] |  \- commons-codec:commons-codec:jar:1.6:compile 
[INFO] +- org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.2:provided 
[INFO] +- com.google.appengine:appengine-api-1.0-sdk:jar:1.7.4:compile 
[INFO] +- com.google.appengine:appengine-api-labs:jar:1.7.4:compile 
[INFO] +- org.openengsb.wrapped:com.google.gdata:jar:1.41.5.w1:compile 
[INFO] | +- com.google.gdata:gdata-contacts-3.0:jar:1.41.5:compile 
[INFO] | +- com.google.gdata:gdata-calendar-2.0:jar:1.41.5:compile 
[INFO] | +- com.google.gdata:gdata-client-1.0:jar:1.41.5:compile 
[INFO] | \- com.google.gdata:gdata-core-1.0:jar:1.41.5:compile 
[INFO] |  +- com.google.collections:google-collections:jar:1.0-rc1:compile 
[INFO] |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile 
[INFO] +- com.google.appengine:appengine-api-stubs:jar:1.7.4:test 
[INFO] +- com.google.appengine:appengine-testing:jar:1.7.4:test 
[INFO] +- org.eclipse.jetty:jetty-server:jar:7.6.8.v20121106:test 
[INFO] | +- org.eclipse.jetty.orbit:javax.servlet:jar:2.5.0.v201103041518:test 
[INFO] | +- org.eclipse.jetty:jetty-continuation:jar:7.6.8.v20121106:test 
[INFO] | \- org.eclipse.jetty:jetty-http:jar:7.6.8.v20121106:test 
[INFO] |  \- org.eclipse.jetty:jetty-io:jar:7.6.8.v20121106:test 
[INFO] |  \- org.eclipse.jetty:jetty-util:jar:7.6.8.v20121106:test (version managed from 7.6.8.v20121106) 
[INFO] +- org.eclipse.jetty:jetty-servlet:jar:7.6.8.v20121106:test 
[INFO] | \- org.eclipse.jetty:jetty-security:jar:7.6.8.v20121106:test (version managed from 7.6.8.v20121106) 
[INFO] +- org.apache.camel:camel-test:jar:2.12-SNAPSHOT:test 
[INFO] +- org.springframework:spring-test:jar:3.2.3.RELEASE:test 
[INFO] | \- org.springframework:spring-core:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] |  \- commons-logging:commons-logging:jar:1.1.2:compile (version managed from 1.1.1) 
[INFO] +- org.apache.camel:camel-spring:jar:2.12-SNAPSHOT:test 
[INFO] | +- org.springframework:spring-context:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] | | \- org.springframework:spring-expression:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] | +- org.springframework:spring-aop:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] | \- org.springframework:spring-tx:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] +- org.springframework:spring-web:jar:3.2.3.RELEASE:test 
[INFO] | +- aopalliance:aopalliance:jar:1.0:test 
[INFO] | \- org.springframework:spring-beans:jar:3.2.3.RELEASE:test (version managed from 3.2.3.RELEASE) 
[INFO] +- httpunit:httpunit:jar:1.7:test 
[INFO] | +- javax.servlet:servlet-api:jar:2.3:test 
[INFO] | \- jtidy:jtidy:jar:4aug2000r7-dev:test 
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.5:test 
[INFO] | +- org.slf4j:slf4j-api:jar:1.6.6:compile (version managed from 1.7.5) 
[INFO] | \- log4j:log4j:jar:1.2.17:test (version managed from 1.2.17) 
[INFO] +- junit:junit:jar:4.11:test 
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test 
[INFO] +- org.apache.camel:apt:jar:2.12-SNAPSHOT:provided 
[INFO] | \- org.apache.camel:spi-annotations:jar:2.12-SNAPSHOT:provided 
[INFO] \- com.sun.xml.bind:jaxb-impl:jar:2.2.6:compile 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
+0

這有助於一些,謝謝 – ThinkFlow