Examples of Hero


Examples of jodd.json.mock.superhero.Hero

  @Test
  public void testNoClassHintsForCollections() {
    JoddJson.classMetadataName = "class";

    Hero superman = creator.createSuperman();
    String json = new JsonSerializer()
        .include("powers")        // redudant
        .include("powers.class")
        .use("powers.class", new SimpleClassnameTransformer())
        .exclude("*.class")
        .serialize(superman);

    int count = StringUtil.count(json, "***");
    assertEquals(4, count);

    json = StringUtil.remove(json, "***");

    Hero jsonSuperMan = new JsonParser()
        .map("lair", SecretLair.class)
        .map("secretIdentity", SecretIdentity.class)
        .parse(json, Hero.class);

    assertHeroHasSuperPowers(jsonSuperMan);
View Full Code Here

Examples of jodd.json.mock.superhero.Hero

        new Address("123 Finland Dr", "Cubicleville", "Hell", new Zipcode("66666")),
        new Address("123 Finland Dr", "Cubicleville", "Hell", new Zipcode("66666")), "Initech");
  }

  public Hero createSuperman() {
    return new Hero("Super Man",
        new SecretIdentity("Clark Kent"),
        new SecretLair("Fortress of Solitude"),
        new XRayVision(0.8f),
        new HeatVision(0.7f),
        new Flight(1000.0f),
View Full Code Here

Examples of jodd.json.mock.superhero.Hero

    assertEquals(dilbert.getCompany(), ((Employee) jsonDilbert).getCompany());
  }

  @Test
  public void testDeserializeInterfaces() {
    Hero superman = creator.createSuperman();
    String json = new JsonSerializer().include("powers").setClassMetadataName("class").serialize(superman);
    Hero jsonSuperMan = new JsonParser().setClassMetadataName("class").parse(json, Hero.class);

    assertNotNull(jsonSuperMan);
    assertEquals(4, jsonSuperMan.getPowers().size());
    assertHeroHasSuperPowers(jsonSuperMan);

    JoddJson.classMetadataName = null;
  }
View Full Code Here

Examples of jodd.json.mock.superhero.Hero

  @Test
  public void testNoClassHints() {
    JoddJson.classMetadataName = null;

    Hero superman = creator.createSuperman();
    String json = new JsonSerializer().exclude("*.class").serialize(superman);

    Hero jsonSuperMan = new JsonParser()
        .map(Hero.class)
        .map("lair", SecretLair.class)
        .map("secretIdentity", SecretIdentity.class)
        .parse(json);

    assertNotNull(jsonSuperMan);
    assertEquals("Super Man", jsonSuperMan.getName());
    assertNotNull(jsonSuperMan.getIdentity());
    assertEquals("Clark Kent", jsonSuperMan.getIdentity().getName());
    assertNotNull(jsonSuperMan.getLair());
    assertEquals("Fortress of Solitude", jsonSuperMan.getLair().getName());
  }
View Full Code Here

Examples of jodd.proxetta.data.Hero

        ;

    ProxettaBuilder proxettaBuilder = proxetta.builder();
    proxettaBuilder.setTarget(Hero.class);
    proxetta.setVariableClassName(true);
    Hero hero = (Hero) proxettaBuilder.newInstance();

    assertEquals("BatmanHero37W88.3CatWoman99speeeeedXRAYnull", hero.name());
  }
View Full Code Here

Examples of jodd.proxetta.data.Hero

        ;

    ProxettaBuilder proxettaBuilder = proxetta.builder();
    proxettaBuilder.setTarget(Hero.class);
    proxetta.setVariableClassName(true);
    Hero hero = (Hero) proxettaBuilder.newInstance();

    assertEquals("SilverHero89W99.222None1000speeeeedXRAYnull", hero.name());
  }
View Full Code Here

Examples of m33.entities.Hero

  public void gameReset() {
    // should I create a reset method in entityManager?
    entities = new EntityManager();
   
    hero = new Hero();
    hero.load("hero.png");

    level = new Map(entities);
    hero.updateMap(level); // I also set spawn point here
View Full Code Here

Examples of org.drools.examples.wumpus.Hero



    public GameUI() {
        this.gameData = new GameView();
        this.gameData.init( new Cell[5][5], new SensorsView(), new ArrayList<Pitt>(), new Wumpus( 2, 1 ), new Gold( 3, 1 ), new Hero( 0, 0 ) );
    }
View Full Code Here

Examples of org.drools.examples.wumpus.Hero

                                    image = javax.imageio.ImageIO.read( getClass().getResource( "dead_wumpus.png" ) );
                                }
                            } else if ( row == gameData.getGold().getRow() && col == gameData.getGold().getCol() ) {
                                image = javax.imageio.ImageIO.read( getClass().getResource( "g.png" ) );
                            } else if ( row == gameData.getHero().getRow() && col == gameData.getHero().getCol() ) {
                                Hero hero = gameData.getHero();
                                switch( hero.getDirection() ) {
                                    case UP:
                                        image = javax.imageio.ImageIO.read( getClass().getResource( "hero_up.png" ) );
                                        break;
                                    case DOWN:
                                        image = javax.imageio.ImageIO.read( getClass().getResource( "hero_down.png" ) );
View Full Code Here

Examples of org.hibernate.ogm.backendtck.simpleentity.Hero

    TransactionManager transactionManager = extractJBossTransactionManager( emf );

    transactionManager.begin();
    final EntityManager em = emf.createEntityManager();
    Hero h = new Hero();
    h.setName( "Spartacus" );
    em.persist( h );
    SuperHero sh = new SuperHero();
    sh.setName( "Batman" );
    sh.setSpecialPower( "Technology and samurai techniques" );
    em.persist( sh );
    transactionManager.commit();

    em.clear();

    transactionManager.begin();
    Hero lh = em.find( Hero.class, h.getName() );
    assertThat( lh ).isNotNull();
    assertThat( lh ).isInstanceOf( Hero.class );
    Hero lsh = em.find( Hero.class, sh.getName() );
    assertThat( lsh ).isNotNull();
    assertThat( lsh ).isInstanceOf( SuperHero.class );
    em.remove( lh );
    em.remove( lsh );
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.