Examples of Cat


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

public class TestInheritanceOnMany extends BaseTestCase {

  @Test
  public void test() {
   
    Cat cat = new Cat();
    cat.setName("Puss");
    Ebean.save(cat);
   
    Dog dog = new Dog();
    dog.setRegistrationNumber("DOGGIE");
    Ebean.save(dog);
View Full Code Here

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

public class TestJsonInheritanceDiscriminator extends BaseTestCase {

  @Test
  public void testNoDiscriminator() throws IOException {

    Cat cat = new Cat();
    cat.setName("Gemma");

    Ebean.save(cat);

    JsonContext json = Ebean.json();
    String jsonContent = json.toJson(cat);

    Cat cat2 = json.toBean(Cat.class, jsonContent);

    Assert.assertEquals(cat.getId(), cat2.getId());
    Assert.assertEquals(cat.getName(), cat2.getName());
    Assert.assertEquals(cat.getVersion(), cat2.getVersion());

    String noDiscriminator = "{\"id\":1,\"name\":\"Gemma\",\"version\":1}";

    Cat cat3 = json.toBean(Cat.class, noDiscriminator);

    Assert.assertEquals(1L, cat3.getId().longValue());
    Assert.assertEquals("Gemma", cat3.getName());
    Assert.assertEquals(1L, cat3.getVersion().longValue());

    Dog dog = new Dog();
    dog.setRegistrationNumber("ABC123");
    dog.setDateOfBirth(new Date(System.currentTimeMillis()));
View Full Code Here

Examples of com.eafit.collectionhomework.model.Cat

    dog2.setDogName("Trosky");
    dog2.setId("123ABCD");
    Dog dog3 = new Dog();
    dog3.setDogName("Malu");
    dog3.setId("123A");
    Cat cat1 = new Cat();
    cat1.setId("666321");
    Cat cat2 = new Cat();
    cat2.setId("ABC321");
   
    dogToValiate = dog2;
    animalToValidate = cat1;
    firstAnimalToValidate = dog1;
View Full Code Here

Examples of com.geekhub.lessons.lesson7.objects.Cat

        }
        cats = storage.list(Cat.class);
        if (!cats.isEmpty()) throw new Exception("Cats should not be in database!");

        for (int i = 1; i <= 20; i++) {
            Cat cat = new Cat();
            cat.setName("cat" + i);
            cat.setAge(i);
            storage.save(cat);
        }

        cats = storage.list(Cat.class);
        if (cats.size() != 20) throw new Exception("Number of cats in storage should be 20!");
View Full Code Here

Examples of com.googlecode.objectify.test.PolymorphicAAATests.Cat

    this.mammal = new Mammal();
    this.mammal.name = "Mamet";
    this.mammal.longHair = true;
    ofy().save().entity(this.mammal).now();

    this.cat = new Cat();
    this.cat.name = "Catrina";
    this.cat.longHair = true;
    this.cat.hypoallergenic = true;
    ofy().save().entity(this.cat).now();
View Full Code Here

Examples of com.mysema.query.collections.Cat

        }
    };

    @Test
    public void test() {
        Cat kitten = data.get(0).getKittens().get(0);
        standardTest.runArrayTests(cat.kittenArray, otherCat.kittenArray, kitten, new Cat());
        standardTest.runBooleanTests(cat.name.isNull(), otherCat.kittens.isEmpty());
        standardTest.runCollectionTests(cat.kittens, otherCat.kittens, kitten, new Cat());
        standardTest.runDateTests(cat.dateField, otherCat.dateField, date);
        standardTest.runDateTimeTests(cat.birthdate, otherCat.birthdate, birthDate);
        standardTest.runListTests(cat.kittens, otherCat.kittens, kitten, new Cat());
        standardTest.runMapTests(cat.kittensByName, otherCat.kittensByName, "Kitty", kitten, "NoName", new Cat());

        // int
        standardTest.runNumericCasts(cat.id, otherCat.id, 1);
        standardTest.runNumericTests(cat.id, otherCat.id, 1);
View Full Code Here

Examples of com.mysema.query.jpa.domain.Cat

    @Test
    public void test() throws SecurityException, IllegalArgumentException,
            NoSuchMethodException, IllegalAccessException,
            InvocationTargetException, IOException {
        entityManager.persist(new Cat("Beck", 1));
        entityManager.flush();

        SAnimal cat = new SAnimal("cat");
        JPASQLQuery query = query().from(cat);
        new QueryMutability(query).test(cat.id, cat.name);
View Full Code Here

Examples of com.opensymphony.xwork2.util.Cat

            bar.setTitle(title);
            bar.setSomethingElse(Integer.parseInt(rest));

            return bar;
        } else if (toType == Cat.class) {
            Cat cat = new Cat();
            cat.setName((String) value);

            return cat;
        } else if (toType == AnnotatedCat.class) {
            AnnotatedCat cat = new AnnotatedCat();
            cat.setName((String) value);

            return cat;
        } else {
            System.out.println("Don't know how to convert between " + value.getClass().getName() +
                    " and " + toType.getName());
View Full Code Here

Examples of com.opensymphony.xwork2.util.Cat

        Bar1 bar = (Bar1) stack.findValue("bar", Bar1.class);
        assertNotNull(bar);
    }

    public void testNestedConverters() {
        Cat cat = new Cat();
        cat.setFoo(new Foo());
        stack.push(cat);
        stack.setValue("foo.number", "123");
        assertEquals(321, cat.getFoo().getNumber());
    }
View Full Code Here

Examples of games.stendhal.server.entity.creature.Cat

    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("No player or pet named \"pet\" is currently logged in."));
 
   
    final Pet testPet = new Cat();
   
    final Sheep testSheep = new Sheep();

    player = PlayerTestHelper.createPlayer("player");
   
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.