Bug 1015948 - Test failures in 'tasks' quickstarts example
Test failures in 'tasks' quickstarts example
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Quickstarts (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ER5
: EAP 6.2.0
Assigned To: sgilda
Vladimir Rastseluev
Russell Dickenson
:
: 977768 1016315 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-07 01:53 EDT by Vladimir Rastseluev
Modified: 2014-04-15 11:13 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:17:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vladimir Rastseluev 2013-10-07 01:53:57 EDT
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 08:48:29 EDT
Adding the quickstart owners: lfryc@redhat.com and okiss@redhat.com
Comment 2 sgilda 2013-10-07 08:56:10 EDT
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 09:19:35 EDT
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 09:23:31 EDT
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 19:54:01 EDT
*** Bug 1016315 has been marked as a duplicate of this bug. ***
Comment 6 sgilda 2013-10-08 12:04:50 EDT
VineetReynolds issued the fix in this commit: 
https://github.com/jboss-developer/jboss-eap-quickstarts/commit/f49e1f3fa7ec34f736c5be32f6a04e7200c0f96d
Comment 7 Vladimir Rastseluev 2013-10-10 05:12:02 EDT
Verified on EAP 6.2.0 ER5.1
Comment 9 sgilda 2014-04-15 11:13:20 EDT
*** Bug 977768 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.