Surefire JUnit Testing using Native Libraries

后端 未结 1 1995
清歌不尽
清歌不尽 2021-01-17 21:42

We are using Maven in Hudson to run our Java build process and the Surefire plugin to execute JUnit tests however I\'ve run into a problem with the unit tests for one projec

1条回答
  •  没有蜡笔的小新
    2021-01-17 21:49

    To add a system property to the JUnit tests, configure the Maven Surefire Plugin as follows:

    
      
        
          org.apache.maven.plugins
          maven-surefire-plugin
          
            
              ${project.basedir}/src/main/native/Authenticator/Release
            
          
        
      
    
    

    Update:

    Ok, it seems this property has to be set before the JVM with JUnit tests starts. So I guess that you have problem with the backslashes. Backslashes in the Java property value are used to escape special characters like \t (tabulator) or \r\n (windows new-line). So try to use this instead of your solution:

    
      
        
          org.apache.maven.plugins
          maven-surefire-plugin
          
            once
            -Djava.library.path=${project.basedir}/src/main/native/Authenticator/Release
          
        
      
    
    

    0 讨论(0)
提交回复
热议问题