Examples of Tone


Examples of com.avaje.tests.model.basic.TOne

public class TestGeneratedKeys extends TestCase {

 
  public void testJdbcBatchInsert() {
   
    TOne c = new TOne();
    c.setName("Banana");
    c.setDescription("Test Gen Key");
   
    TOne c1 = new TOne();
    c1.setName("Two");
    c1.setDescription("Test Gen Key Two");
   
    Ebean.beginTransaction();
    try {
      Ebean.save(c);
      Ebean.save(c1);
    } finally {
      Ebean.commitTransaction();
    }
    Integer id = c.getId();
    Assert.assertNotNull("Get Id back after insert", id);

    Integer id1 = c1.getId();
    Assert.assertNotNull("Get Id back after insert", id1);

  }
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

    }

    EbeanServer eServer = EbeanServerFactory.create(serverConfig);

    long id = 1;
    TOne data = eServer.find(TOne.class, id);
    if (data == null) {
      System.out.println("This is the first run, saving data..");
      TOne tone = new TOne();
      tone.setName("banan");
      eServer.save(tone);// new TOne()id, "Hello World!"));
    } else {
      System.out.println(String.format("############\n%s############", data.getName()));
    }
    // ShutdownManager.shutdown();
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

     * This test loads just a single property of the Entity AuditLog and later on access
     * the description which should force a lazy load of this property
     */
    public void testPartialLoad() throws SQLException
    {
        TOne log = new TOne();
        log.setName("test partial");
        log.setDescription("log");

        getServer().save(log);

        assertNotNull(log.getId());

        List<TOne> logs = getServer().find(TOne.class)
                .select("id")
                .where().eq("id", log.getId())
                .findList();

        assertNotNull(logs);
        assertEquals(1, logs.size());

        TOne logLazy = logs.get(0);

        String description = logLazy.getDescription();
        assertEquals(log.getDescription(), description);
    }
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

  }

  private void simpleCheck(EbeanServer server) {

    TOne o = new TOne();
    o.setName("banan");
    o.setDescription("this one is true");
    o.setActive(true);

    server.save(o);

    TOne o2 = new TOne();
    o2.setName("banan");
    o2.setDescription("this one is false");
    o2.setActive(false);

    server.save(o2);

   
    List<TOne> list = server.find(TOne.class)
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

   
    Random r = new Random();
    Ebean.beginTransaction();
    try {
      for (int i = 0; i < 1000; i++) {
        TOne o = new TOne();
       
        int rvalue = r.nextInt(100000);
        o.setName(rvalue+"name");
        o.setDescription(rvalue+"");
        Ebean.save(o);
      }
      Ebean.commitTransaction();
    } finally {
      Ebean.endTransaction();
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

    List<TOne> asList = pagingList.getAsList();
    for (int i = 0; i < asList.size(); i++) {
      if (i % 10 == 0){
        //System.out.println("here");
      }
      TOne tOne = asList.get(i);
      tOne.hashCode();
      //System.out.print(".");
    }
  }
View Full Code Here

Examples of com.avaje.tests.model.basic.TOne

  @Test
  public void testSimple() {
   
    ResetBasicData.reset();
   
    TOne o = new TOne();
    o.setName("something");
   
    Ebean.save(o);
   
    //Ebean.find(TOne.class, o.getId());
   
    Query<TOne> queryFindId = Ebean.find(TOne.class)
      .setId(o.getId());
   
    TOne one = queryFindId.findUnique();
    Assert.assertNotNull(one);
    Assert.assertEquals(one.getId(), o.getId());
    String generatedSql = queryFindId.getGeneratedSql();
    Assert.assertTrue(generatedSql.contains(" 1=1"));
   
  }
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.Tone

          if (entity != null && entity instanceof Greeting)
          {
            Greeting greeting = (Greeting) entity;
            if (greeting.hasTone())
            {
              Tone tone = greeting.getTone();
              if (tone == Tone.INSULTING)
              {
                throw new RestLiServiceException(REQ_FILTER_ERROR_STATUS, REQ_FILTER_ERROR_MESSAGE);
              }
              greeting.setTone(mapToneForIncomingRequest(tone));
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.Tone

    checkHeaderForCompression(response, operationsForCompression, "finder:" + req.getMethodName());
    List<Greeting> greetings = response.getEntity().getElements();
    for (Greeting greeting : greetings)
    {
      Assert.assertTrue(greeting.hasTone());
      Tone tone = greeting.getTone();
      Assert.assertTrue(Tone.SINCERE.equals(tone) || Tone.INSULTING.equals(tone));
    }
  }
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.Tone

    Response<CollectionResponse<Greeting>> response = future.getResponse();
    List<Greeting> greetings = response.getEntity().getElements();
    for (Greeting greeting : greetings)
    {
      Assert.assertTrue(greeting.hasTone());
      Tone tone = greeting.getTone();
      Assert.assertTrue(Tone.SINCERE.equals(tone) || Tone.INSULTING.equals(tone));
    }
  }
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.