Тесты Maven junit: не удается найти пакет для представлений базовых имен, локаль ru - PullRequest
0 голосов
/ 17 декабря 2018

Я пытаюсь запустить свои тесты из maven в моем весеннем проекте mvc.

Когда я запускаю тесты как junit, все в порядке, но когда я запускаю чистую установку maven, я получаю следующий вывод:

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ projectname ---
[INFO] Deleting C:\Users\ik917\git\projectname\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) 
@projectname ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ projectname- 
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 77 source files to 
C:\Users\ik917\git\Wprojectname\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) 
@ projectname ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
C:\Users\ik917\git\projectname\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
projectname ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\ik917\git\projectname\target\test- 
classes
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M2:test (default-test) @ projectname 
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.teesting.main.Testing
log4j:WARN No appenders could be found for logger 
(org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for 
more info.
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver 
class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered 
via the SPI and manual loading of the driver class is generally unnecessary.
[ERROR] Tests run: 10, Failures: 0, Errors: 10, Skipped: 0, Time elapsed: 
29.603 s <<< FAILURE! - in com.teesting.main.Testing
[ERROR] setautorizzazione(com.teesting.main.Testing)  Time elapsed: 0.828 s  
<<< ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] compilaistruzioneeformazione(com.teesting.main.Testing)  Time 
elapsed: 3.09 s  <<< ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] scaricapdf(com.teesting.main.Testing)  Time elapsed: 3.014 s  <<< 
ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] setta_competenze_e_skill(com.teesting.main.Testing)  Time elapsed: 
2.977 s  <<< ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] compiladatianagrafici(com.teesting.main.Testing)  Time elapsed: 
3.027 s  <<< ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] settrasferte(com.teesting.main.Testing)  Time elapsed: 2.905 s  <<< 
ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] scaricaword(com.teesting.main.Testing)  Time elapsed: 3.095 s  <<< 
ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] settraesperienzelavorative(com.teesting.main.Testing)  Time elapsed: 
3.038 s  <<< ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] setprofilo(com.teesting.main.Testing)  Time elapsed: 2.974 s  <<< 
ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[ERROR] compilalingue(com.teesting.main.Testing)  Time elapsed: 2.831 s  <<< 
ERROR!
org.springframework.web.util.NestedServletException: Request processing 
failed; nested exception is java.util.MissingResourceException: Can't find 
bundle for base name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)
Caused by: java.util.MissingResourceException: Can't find bundle for base 
name views, locale en
at com.teesting.main.Testing.setup_e_aggiungiUsertest(Testing.java:60)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
 processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[ERROR]   Testing.setup_e_aggiungiUsertest:60 » NestedServlet Request 
processing failed;...
[INFO] 
[ERROR] Tests run: 10, Failures: 0, Errors: 10, Skipped: 0
[INFO] 
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 35.919 s
[INFO] Finished at: 2018-12-17T12:14:58+01:00
[INFO] Final Memory: 28M/318M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- 
plugin:3.0.0-M2:test (default-test) on project projectname: There are test 
failures.
[ERROR] 
[ERROR] Please refer to C:\Users\ik917\git\projectname\target\surefire-reports 
for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]- 
jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

это мой pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>projectname</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>projectname</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>spring.profiles.active</name>
                <value>dev</value>
            </property>
        </activation>
    </profile>
    <profile>
        <id>test</id>
        <activation>
            <property>
                <name>spring.profiles.active</name>
                <value>test</value>
            </property>
        </activation>
    </profile>
    <profile>
        <id>prod</id>
        <activation>
            <property>
                <name>spring.profiles.active</name>
                <value>prod</value>
            </property>
        </activation>
    </profile>
</profiles>


<dependencies>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>3.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>1.2.3</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>4.2.5.RELEASE</version>
    </dependency>
    <dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-core</artifactId>
     <version>4.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>4.2.5.RELEASE</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.11</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-dao</artifactId>
        <version>2.0.8</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>4.2.5.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>displaytag</groupId>
        <artifactId>displaytag</artifactId>
        <version>1.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
        <version>5.5.13</version>
    </dependency>

    <!--  Apache POI -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.13</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.13</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>3.13</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-scratchpad</artifactId>
        <version>3.13</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>ooxml-schemas</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.4</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.webjars</groupId>
        <artifactId>bootstrap</artifactId>
        <version>3.2.0</version>
    </dependency>       
</dependencies>

<build>
       <resources>
           <resource>
               <directory>src/main/webapp/servlet</directory>
           </resource>
       </resources>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>3.0.0-M2</version>
           </plugin>
       </plugins>
        <finalName>certitech</finalName>
    </build>
<groupId>projectname</groupId>

путь к тестам: src \ test \ Testing.java путь к сервлету: src \ main \ resources\ servlet.xml

Может кто-нибудь помочь мне решить эту проблему?Я пробовал некоторые решения, опубликованные здесь ранее, но ни одно из них не работает.

Спасибо!

...