2014-10-16 6 views
-1

Я хочу, чтобы проверить мой военный файл на удаленном сервере, но он не работает и дает мне сообщение об ошибке:Arquillian тестирование на удаленном сервере

sun.net.www.protocol.http.HttpURLConnection$HttpInputStream cannot be cast to com.itextpdf.text.pdf.codec.Base64$InputStream 

Я не знаю, что я делаю wrong.I новичок в arquillian и проверили почти все ссылки доступны, но до сих пор не получил никакого решения по этому поводу ..

Here is my arquillian.xml 

<?xml version="1.0" encoding="UTF-8"?> 



<arquillian xmlns="http://jboss.org/schema/arquillian" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://jboss.org/schema/arquillian 
     http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> 

    <!-- Uncomment to have test archives exported to the file system for inspection --> 
    <!-- <engine> --> 
    <!-- <property name="deploymentExportPath">target/</property> --> 
    <!-- </engine> --> 

    <!-- Force the use of the Servlet 3.0 protocol with all containers, as it 
     is the most mature --> 
    <defaultProtocol type="Servlet 3.0" /> 

    <!-- Example configuration for a remote JBoss EAP 6 instance --> 
    <container qualifier="jboss" default="true"> 
     <!-- By default, arquillian will use the JBOSS_HOME environment variable. 
      Alternatively, the configuration below can be uncommented. --> 
     <configuration> 
      <!-- <property name="jbossHome">/opt/jboss7</property> -->  <!-- <property name="managementAddress">197.242.148.253</property> <property 
       name="managementPort">22000</property> <property name="username"></property> 
       <property name="password"></property> --> 


      <property name="managementAddress">197.242.148.253</property> 
      <property name="managementPort">22000</property> 
      <property name="username">abc</property> 
      <property name="password">aabc123</property> 



     </configuration> 

    </container> 

</arquillian> 

Это мой тестовый класс

public class ArqTest extends Arquillian{ 


     //creates war and deploys it 
     @Deployment(testable = true) 
     public static WebArchive createNotTestableDeployment() { 
      final WebArchive war = ShrinkWrap.create(WebArchive.class, "USSD.war") 
        .addClasses(ShowConversations.class) 
      .addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); 
     System.out.println("deployed"); 
     System.out.println(war.getName()); 
      return war; 
     } 



    @RunAsClient 
    @Test(dataProvider = Arquillian.ARQUILLIAN_DATA_PROVIDER) 
     public void Test() throws IOException { 



       URL url = new URL("http://197.242.148.253"); 
       InputStream is = (InputStream) url.openStream(); 
       BufferedReader br = new BufferedReader(new 
       InputStreamReader(is)); 
       String result = br.readLine(); 


       System.out.println(result+"hello"); 
      br.close(); 


     } 
} 

Может ли тело предоставить мне некоторую помощь по этим

ответ

1

Try добавить в узле конфигурации следующего свойства:

<property name="allowConnectingToRunningServer">true</property> 

Незнайки, если это решит вашу ошибку, но я думаю, что вам это нужно, потому что, если нет, arquillian пытается создать новый экземпляр jBoss вместо того, чтобы использовать удаленный запуск.

+0

thnks для предложения..Но это не сработало – kirti

Смежные вопросы