Bug 1015948

Summary: Test failures in 'tasks' quickstarts example
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Vladimir Rastseluev <vrastsel>
Component: QuickstartsAssignee: sgilda
Status: CLOSED CURRENTRELEASE QA Contact: Vladimir Rastseluev <vrastsel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bsutter, jkudrnac, lfryc, okiss, pgier, pmuir, pslavice
Target Milestone: ER5   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:17:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Rastseluev 2013-10-07 05:53:57 UTC
Description of problem:
Following instructions from README file I tried to execute remote tests in tasks quicktsarts example. There are test failures.

Version-Release number of selected component (if applicable):
EAP 6.2.0 ER4

How reproducible:
easy

Steps to Reproduce:
1. start standalone server 
2. cd $QUICKSTARTS_ROOT/tasks
3. mvn clean test -Parq-jbossas-remote 

Actual results:
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jboss.as.quickstarts.tasks.UserDaoTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.594 sec
Running org.jboss.as.quickstarts.tasks.TaskDaoTest
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.327 sec <<< FAILURE!

Results :

Failed tests:   taskDao_should_provide_basic_case_insensitive_full_text_search(org.jboss.as.quickstarts.tasks.TaskDaoTest): expected:<1> but was:<0>

Tests run: 8, Failures: 1, Errors: 0, Skipped: 0


Expected results:
test success

Comment 1 sgilda 2013-10-07 12:48:29 UTC
Adding the quickstart owners: lfryc and okiss

Comment 2 sgilda 2013-10-07 12:56:10 UTC
This is the relavent information from the JBoss server log:

08:52:25,103 INFO  [org.jboss.as.server] (management-handler-thread - 3) JBAS018559: Deployed "test.war" (runtime-name : "test.war")
08:52:25,284 WARN  [org.hibernate.hql.internal.ast.HqlSqlWalker] (http-/127.0.0.1:8080-2) [DEPRECATION] Encountered positional parameter near line 1, column 69.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.
08:52:25,430 WARN  [org.hibernate.hql.internal.ast.HqlSqlWalker] (http-/127.0.0.1:8080-2) [DEPRECATION] Encountered positional parameter near line 1, column 69.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.
08:52:25,432 WARN  [org.hibernate.hql.internal.ast.HqlSqlWalker] (http-/127.0.0.1:8080-2) [DEPRECATION] Encountered positional parameter near line 1, column 95.  Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead.
08:52:25,528 INFO  [org.jboss.web] (ServerService Thread Pool -- 49) JBAS018224: Unregister web context: /test
08:52:25,544 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016009: Stopping weld service for deployment test.war
08:52:25,547 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 55) JBAS011403: Stopping Persistence Unit Service 'test.war#primary'
08:52:25,548 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 55) HHH000227: Running hbm2ddl schema export
08:52:25,551 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 55) HHH000230: Schema export complete
08:52:25,559 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010409: Unbound data source [java:jboss/datasources/TasksQuickstartTestDS]
08:52:25,565 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment test.war (runtime-name: test.war) in 43ms


Note the [DEPRECATION] messages in the logs.

Comment 3 sgilda 2013-10-07 13:19:35 UTC
This is from the surefire report:

-------------------------------------------------------------------------------
Test set: org.jboss.as.quickstarts.tasks.TaskDaoTest
-------------------------------------------------------------------------------
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.688 sec <<< FAILURE!
taskDao_should_provide_basic_case_insensitive_full_text_search(org.jboss.as.quickstarts.tasks.TaskDaoTest)  Time elapsed: 0.076 sec  <<< FAILURE!
java.lang.AssertionError: expected:<1> but was:<0>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:743)
	at org.junit.Assert.assertEquals(Assert.java:118)
	at org.junit.Assert.assertEquals(Assert.java:555)
	at org.junit.Assert.assertEquals(Assert.java:542)
	at org.jboss.as.quickstarts.tasks.TaskDaoTest.taskDao_should_provide_basic_case_insensitive_full_text_search(TaskDaoTest.java:109)


It looks like this test is failing:

    @Test
    public void taskDao_should_provide_basic_case_insensitive_full_text_search() {
        // given
        String taskTitlePart = "FIRST";

        // when
        List<Task> titledTasks = taskDao.getForTitle(detachedUser, taskTitlePart);

        // then
        assertEquals(1, titledTasks.size());  <--line 109: This assertion fails
        assertTrue(titledTasks.get(0).getTitle().contains("first"));
    }

Comment 4 sgilda 2013-10-07 13:23:31 UTC
I missed something earlier in the tests:

08:52:24,821 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 51) HHH000227: Running hbm2ddl schema export
08:52:24,822 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 51) HHH000389: Unsuccessful: alter table Task drop constraint FK_kxfu633bvt1sptgbnkxkrr3qf
08:52:24,823 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 51) Table "TASK" not found; SQL statement:
alter table Task drop constraint FK_kxfu633bvt1sptgbnkxkrr3qf [42102-168]
08:52:24,831 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 51) HHH000230: Schema export complete

Comment 5 Paul Gier 2013-10-07 23:54:01 UTC
*** Bug 1016315 has been marked as a duplicate of this bug. ***

Comment 6 sgilda 2013-10-08 16:04:50 UTC
VineetReynolds issued the fix in this commit: 
https://github.com/jboss-developer/jboss-eap-quickstarts/commit/f49e1f3fa7ec34f736c5be32f6a04e7200c0f96d

Comment 7 Vladimir Rastseluev 2013-10-10 09:12:02 UTC
Verified on EAP 6.2.0 ER5.1

Comment 9 sgilda 2014-04-15 15:13:20 UTC
*** Bug 977768 has been marked as a duplicate of this bug. ***