Examples of AllTypes


Examples of org.apache.jdo.tck.pc.fieldtypes.AllTypes

        if( query_result == null )
            return;
        Iterator iter = query_result.iterator();
        int cnt = 0;
        while(iter.hasNext()){
            AllTypes obj = (AllTypes) iter.next();
            Boolean val = obj.getBoolean();
            if( val.equals(value) ){
                fail(ASSERTION_FAILED, "JDOQL NotEquals test returns object with incorrect value, retrieved value: " + val + ", Boolean parameter value: " + value + ", Object parameter value: " + parameterValue, filter, parameter);
            }
            cnt++;
        }
View Full Code Here

Examples of org.apache.uima.taeconfigurator.model.AllTypes

    // Model initialization
    fileDirty = false;
    dirtyTypeNameHash = new HashSet();
    descriptorCAS = new DescriptorTCAS(this);
    allTypes = new AllTypes(this);
    definedTypesWithSupers = new DefinedTypesWithSupers(this);

    // reasonable initial values
    aeDescription = UIMAFramework.getResourceSpecifierFactory().createAnalysisEngineDescription();
    typeSystemDescription = null;
View Full Code Here

Examples of org.eclipse.persistence.platform.database.oracle.publisher.viewcache.AllTypes

            /* determine whether this is an opaque type */
            Iterator<ViewRow> iter = m_viewCache.getRows(ALL_TYPES, new String[0], new String[]{
                OWNER, TYPE_NAME, "PREDEFINED"}, new Object[]{schema, type, "NO"},
                new String[0]);
            if (iter.hasNext()) {
                AllTypes allTypes = (AllTypes)iter.next();
                String typeCode = allTypes.typeCode;
                byte[] typeOID = allTypes.typeOid;
                int dbTypeCode = 0;
                int kind = 0;
                if (!m_getTypeCodeWarning) {
View Full Code Here

Examples of org.jboss.test.dbtest.interfaces.AllTypes

         throw new Exception();
      }

      getLog().debug(++test + "- " + "Calling findByPrimaryKey on AllTypesHome with name seb...");

      AllTypes allTypes = null;

      try
      {
         allTypes = allTypesHome.findByPrimaryKey("seb");
      }
      catch (Exception e)
      {
         getLog().debug(e.getMessage());
      }

      if (allTypes == null)
      {

         getLog().debug("not found OK");
         getLog().debug(++test + "- " + "Calling create on AllTypesHome with name seb...");
         allTypes = allTypesHome.create("seb");
      }

      if (allTypes != null)
      {
         getLog().debug("OK");
      }
      else
      {
         getLog().debug("Could not find or create the alltypes bean");
         getLog().debug("Check the server trace for details");

         throw new Exception();
      }

      getLog().debug("Getting all the fields");
      getLog().debug(++test + "- " + "boolean " + allTypes.getBoolean() + " OK");
      getLog().debug(++test + "- " + "byte " + allTypes.getByte() + " OK");
      getLog().debug(++test + "- " + "short " + allTypes.getShort() + " OK");
      getLog().debug(++test + "- " + "int " + allTypes.getInt() + " OK");
      getLog().debug(++test + "- " + "long " + allTypes.getLong() + " OK");
      getLog().debug(++test + "- " + "float " + allTypes.getFloat() + " OK");
      getLog().debug(++test + "- " + "double " + allTypes.getDouble() + " OK");
      getLog().debug("No char test yet, bug in jdk");
      getLog().debug(++test + "- " + "String " + allTypes.getString() + " OK");
      getLog().debug(++test + "- " + "Date " + allTypes.getDate() + " OK");
      getLog().debug(++test + "- " + "Time " + allTypes.getTime() + " OK");
      getLog().debug(++test + "- " + "Timestamp " + allTypes.getTimestamp() + " OK");

      getLog().debug(++test + "- " + "MyObject ");
      MyObject obj = allTypes.getObject();
      getLog().debug("OK");

      getLog().debug(++test + "- " + "Creating Record beans and adding them to the Collection in Alltypes..");
      RecordHome recordHome = (RecordHome)ctx.lookup("Record");

      Record[] record = new Record[3];
      for (int i = 0; i < 3; i++)
      {
         try
         {
            record[i] = recordHome.findByPrimaryKey("bill " + i);
         }
         catch (FinderException e)
         {
            record[i] = recordHome.create("bill " + i);
         }

         record[i].setAddress("SanFrancisco, CA 9411" + i);
         allTypes.addObjectToList(record[i]);
      }
      getLog().debug("OK");

      getLog().debug(++test + "- " + "Getting them back..");

      Collection collection = allTypes.getObjectList();
      boolean ok = true;

      for (int i = 0; i < 3; i++)
      {
         ok = ok && collection.contains(record[i]);
      }

      if (ok)
      {
         getLog().debug("OK");
      }
      else
      {
         getLog().debug("failed");
         throw new Exception("abort");
      }

      getLog().debug("All basic tests passed; Now testing min/max values.");
      getLog().debug("This is just for information, it's okay if some fail.");
      getLog().debug("Not all DBs have a column type that supports 8-byte numbers.");
      // NOTE: In order from most likely to fail to least likely to fail
      //       Oracle in particular demonstrates cascading failures and
      //       we don't want to miss that

      // Double
      try
      {
         allTypes.setDouble(Double.MIN_VALUE);
         double d;
         if ((d = allTypes.getDouble()) == Double.MIN_VALUE)
         {
            getLog().debug(++test + "- Double Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Double Min Value Different (" + d + " <> " + Double.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Double Min Value Failed");
      }
      try
      {
         allTypes.setDouble(Double.MAX_VALUE);
         double d;
         if ((d = allTypes.getDouble()) == Double.MAX_VALUE)
         {
            getLog().debug(++test + "- Double Max Value OK");
         }
         else
         {
            getLog().debug(++test + "- Double Max Value Different (" + d + " <> " + Double.MAX_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Double Max Value Failed");
      }
      // Float
      try
      {
         allTypes.setFloat(Float.MIN_VALUE);
         float f;
         if ((f = allTypes.getFloat()) == Float.MIN_VALUE)
         {
            getLog().debug(++test + "- Float Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Float Min Value Different (" + f + " <> " + Float.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Float Min Value Failed");
      }
      try
      {
         allTypes.setFloat(Float.MAX_VALUE);
         float f;
         if ((f = allTypes.getFloat()) == Float.MAX_VALUE)
         {
            getLog().debug(++test + "- Float Max Value OK");
         }
         else
         {
            getLog().debug(++test + "- Float Max Value Different (" + f + " <> " + Float.MAX_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Float Max Value Failed");
      }

      // Long
      try
      {
         allTypes.setLong(Long.MIN_VALUE);
         long l;
         if ((l = allTypes.getLong()) == Long.MIN_VALUE)
         {
            getLog().debug(++test + "- Long Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Long Min Value Different (" + l + " <> " + Long.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Long Min Value Failed");
      }
      try
      {
         allTypes.setLong(Long.MAX_VALUE);
         long l;
         if ((l = allTypes.getLong()) == Long.MAX_VALUE)
         {
            getLog().debug(++test + "- Long Max Value OK");
         }
         else
         {
            getLog().debug(++test + "- Long Max Value Different (" + l + " <> " + Long.MAX_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Long Max Value Failed");
      }
      // Short
      try
      {
         allTypes.setShort(Short.MIN_VALUE);
         short s;
         if ((s = allTypes.getShort()) == Short.MIN_VALUE)
         {
            getLog().debug(++test + "- Short Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Short Min Value Different (" + s + " <> " + Short.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Short Min Value Failed");
      }
      try
      {
         allTypes.setShort(Short.MAX_VALUE);
         short s;
         if ((s = allTypes.getShort()) == Short.MAX_VALUE)
         {
            getLog().debug(++test + "- Short Max Value OK");
         }
         else
         {
            getLog().debug(++test + "- Short Max Value Different (" + s + " <> " + Short.MAX_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Short Max Value Failed");
      }
      // Byte
      try
      {
         allTypes.setByte(Byte.MIN_VALUE);
         byte b;
         if ((b = allTypes.getByte()) == Byte.MIN_VALUE)
         {
            getLog().debug(++test + "- Byte Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Byte Min Value Different (" + b + " <> " + Byte.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Byte Min Value Failed");
      }
      try
      {
         allTypes.setByte(Byte.MAX_VALUE);
         byte b;
         if ((b = allTypes.getByte()) == Byte.MAX_VALUE)
         {
            getLog().debug(++test + "- Byte Max Value OK");
         }
         else
         {
            getLog().debug(++test + "- Byte Max Value Different (" + b + " <> " + Byte.MAX_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Byte Max Value Failed");
      }
      // Int
      try
      {
         allTypes.setInt(Integer.MIN_VALUE);
         int i;
         if ((i = allTypes.getInt()) == Integer.MIN_VALUE)
         {
            getLog().debug(++test + "- Int Min Value OK");
         }
         else
         {
            getLog().debug(++test + "- Int Min Value Different (" + i + " <> " + Integer.MIN_VALUE + ")");
         }
      }
      catch (Exception e)
      {
         getLog().debug(++test + "- Int Min Value Failed");
      }
      try
      {
         allTypes.setInt(Integer.MAX_VALUE);
         int i;
         if ((i = allTypes.getInt()) == Integer.MAX_VALUE)
         {
            getLog().debug(++test + "- Int Max Value OK");
         }
         else
         {
View Full Code Here

Examples of org.jboss.test.testbean2.interfaces.AllTypes

      aHome = aMetaData.getEJBHome();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"Calling findByPrimaryKey on AllTypesHome with name seb...");

      AllTypes allTypes = null;
      try {
         allTypes = allTypesHome.findByPrimaryKey("seb");
      }
      catch (Exception e) {getLog().debug(e.getMessage());}
      if (allTypes == null) {

         getLog().debug("not found OK");
         getLog().debug(++test+"- "+"Calling create on AllTypesHome with name seb...");
         allTypes = allTypesHome.create("seb");
      }

      if (allTypes != null) getLog().debug("ok");

      getLog().debug(++test+"- "+"Calling business method A an AllTypes (B2B with external ejb-ref)...");
      getLog().debug("OK, result is" + allTypes.callBusinessMethodA());

      getLog().debug("Getting all the fields");
      getLog().debug(++test+"- "+"boolean " + allTypes.getBoolean() + " Ok");
      getLog().debug(++test+"- "+"byte " + allTypes.getByte() + " Ok");
      getLog().debug(++test+"- "+"short " + allTypes.getShort() + " Ok");
      getLog().debug(++test+"- "+"int " + allTypes.getInt() + " Ok");
      getLog().debug(++test+"- "+"long " + allTypes.getLong() + " Ok");
      getLog().debug(++test+"- "+"float " + allTypes.getFloat() + " Ok");
      getLog().debug(++test+"- "+"double " + allTypes.getDouble() + " Ok");
      getLog().debug("No char test yet, bug in jdk");
      getLog().debug(++test+"- "+"String " + allTypes.getString() + " Ok");
      getLog().debug(++test+"- "+"Date " + allTypes.getDate() + " Ok");
      getLog().debug(++test+"- "+"Timestamp " + allTypes.getTimestamp() + " Ok");

      getLog().debug(++test+"- "+"MyObject ");
      MyObject obj = allTypes.getObject();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting handle of stateful...");
      Handle sfHandle = allTypes.getStateful();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting the bean back from the handle...");
      StatefulSession sfBean = (StatefulSession)sfHandle.getEJBObject();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"comparing serialized handles...");
      assertTrue(Arrays.equals(new MarshalledValue(sfHandle).toByteArray(), new MarshalledValue(sfBean.getHandle()).toByteArray()));
      getLog().debug("OK");

      getLog().debug(++test+"- "+"calling business method A on stateful: ");
      getLog().debug("OK, result is " + sfBean.callBusinessMethodA());

      getLog().debug(++test+"- "+"adding the stateful bean as an object in AllTypes..");
      allTypes.addObjectToList(sfBean);
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting handle of stateless...");
      Handle slHandle = allTypes.getStateless();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting the bean back from the handle...");
      StatelessSession slBean = (StatelessSession)slHandle.getEJBObject();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"comparing serialized handles...");
      assertTrue(Arrays.equals(new MarshalledValue(slHandle).toByteArray(), new MarshalledValue(slBean.getHandle()).toByteArray()));
      getLog().debug("OK");

      getLog().debug(++test+"- "+"calling business method B on stateless: ");
      getLog().debug("OK, result is " + slBean.callBusinessMethodB());

      getLog().debug(++test+"- "+"adding the stateless bean as an object in AllTypes..");
      allTypes.addObjectToList(slBean);
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting handle of entity...");
      Handle eeHandle = allTypes.getEntity();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"getting the bean back from the handle...");
      EnterpriseEntity eeBean = (EnterpriseEntity)eeHandle.getEJBObject();
      getLog().debug("OK");

      getLog().debug(++test+"- "+"comparing serialized handles...");
      assertTrue(Arrays.equals(new MarshalledValue(eeHandle).toByteArray(), new MarshalledValue(eeBean.getHandle()).toByteArray()));
      getLog().debug("OK");

      getLog().debug(++test+"- "+"calling business method A on stateless: ");
      getLog().debug("OK, result is" + eeBean.callBusinessMethodA());

      getLog().debug(++test+"- "+"adding the entity bean as an object in AllTypes..");
      allTypes.addObjectToList(eeBean);
      getLog().debug("OK");

      getLog().debug(++test+"- "+"Getting the list of objects back (should contain the 3 beans)...");
      Collection coll = allTypes.getObjectList();
      assertEquals(coll.size(), 3);
      getLog().debug("OK");
      getLog().debug(++test+"- "+"stateful bean ");
      assertTrue(coll.contains(sfBean));
      getLog().debug("OK");
      getLog().debug(++test+"- "+"stateless bean ");
      assertTrue(coll.contains(slBean));
      getLog().debug("OK");
      getLog().debug(++test+"- "+"entity bean ");
      assertTrue(coll.contains(eeBean));
      getLog().debug("OK");

      getLog().debug("Testing automatically generated finders");

      getLog().debug(++test+"- "+"findAll()..");
      coll = allTypesHome.findAll();
      assertTrue(coll.contains(allTypes));
      getLog().debug("OK");

      getLog().debug(++test+"- "+"findByPrimaryKey()...");
      AllTypes result = allTypesHome.findByPrimaryKey("seb");
      assertTrue(result.equals(allTypes));
      getLog().debug("OK");

      getLog().debug(++test+"- "+"findByABoolean()..");
      coll = allTypesHome.findByABoolean(allTypes.getBoolean());
      assertTrue(coll.contains(allTypes));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.