org.objectweb.jonas.jtests.clients.entity
Class F_BasicEjbqlEC2

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.objectweb.jonas.jtests.util.JTestCase
                    |
                    +--org.objectweb.jonas.jtests.clients.entity.F_BasicEjbqlEC2
All Implemented Interfaces:
junit.framework.Test

public class F_BasicEjbqlEC2
extends JTestCase

For testing basic EJB QL queries.

Author:
Helene Joanin

Field Summary
protected static E4QueryHome home
           
 
Fields inherited from class org.objectweb.jonas.jtests.util.JTestCase
ictx, isInit, jonasName, msgerror, testtorun, utx
 
Constructor Summary
F_BasicEjbqlEC2(java.lang.String name)
           
 
Method Summary
static void main(java.lang.String[] args)
           
protected  void setUp()
          common setUp routine, used for every test.
static junit.framework.Test suite()
           
 void testAbsInt()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE ABS(o.fint) = ?
 void testConcat()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE CONCAT(o.id, o.fstring) = ?
 void testInStrings()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IN ('helene', 'eric')
 void testIntEqualExpr()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fint = ?
 void testIsNull()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IS NULL
 void testLength()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LENGTH(o.fstring) = ?
 void testLessThanMinus100()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE ABS(o.fint) = -100
 void testLocate()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(o.fstring, ?
 void testLocateAt()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(o.fstring, ?
 void testSqrt()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE SQRT(o.fdouble) BETWEEN ?
 void testSubstring()
          Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE SUBSTRING(o.fstring, ?
 
Methods inherited from class org.objectweb.jonas.jtests.util.JTestCase
debug, getDBEnv, random, sleep, tearDown, testEmpty, unloadBeans, useBeans
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

home

protected static E4QueryHome home
Constructor Detail

F_BasicEjbqlEC2

public F_BasicEjbqlEC2(java.lang.String name)
Method Detail

setUp

protected void setUp()
Description copied from class: JTestCase
common setUp routine, used for every test.
Overrides:
setUp in class JTestCase

testLength

public void testLength()
                throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LENGTH(o.fstring) = ?1

testLocate

public void testLocate()
                throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(o.fstring, ?1) > -1

testLocateAt

public void testLocateAt()
                  throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(o.fstring, ?1, ?2) > -1

testSubstring

public void testSubstring()
                   throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE SUBSTRING(o.fstring, ?2, ?3) = ?1

testConcat

public void testConcat()
                throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE CONCAT(o.id, o.fstring) = ?1

testAbsInt

public void testAbsInt()
                throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE ABS(o.fint) = ?1

testSqrt

public void testSqrt()
              throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE SQRT(o.fdouble) BETWEEN ?1 - 0.1 AND ?1 + 0.1

testIsNull

public void testIsNull()
                throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IS NULL

testInStrings

public void testInStrings()
                   throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IN ('helene', 'eric')

testLessThanMinus100

public void testLessThanMinus100()
                          throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE ABS(o.fint) = -100

testIntEqualExpr

public void testIntEqualExpr()
                      throws java.lang.Exception
Test the EJB-QL: SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fint = ?1 + ?2 - ?3

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)