Examples of ConstantMapping


Examples of net.paoding.rose.web.impl.mapping.ConstantMapping

        return modules;
    }

    private MappingNode prepareMappingTree(List<Module> modules) {
        Mapping rootMapping = new ConstantMapping("");
        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);
View Full Code Here

Examples of net.paoding.rose.web.impl.mapping.ConstantMapping

        return modules;
    }

    private MappingNode prepareMappingTree(List<Module> modules) {
        Mapping rootMapping = new ConstantMapping("");
        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);
View Full Code Here

Examples of net.paoding.rose.web.impl.mapping.ConstantMapping

        return modules;
    }

    private MappingNode prepareMappingTree(List<Module> modules) {
        Mapping rootMapping = new ConstantMapping("");
        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);
View Full Code Here

Examples of net.paoding.rose.web.impl.mapping.ConstantMapping

        return modules;
    }

    private MappingNode prepareMappingTree(List<Module> modules) {
        Mapping rootMapping = new ConstantMapping("");
        MappingNode mappingTree = new MappingNode(rootMapping);
        LinkedEngine rootEngine = new LinkedEngine(null, new RootEngine(instructionExecutor),
                mappingTree);
        mappingTree.getMiddleEngines().addEngine(ReqMethod.ALL, rootEngine);
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

      protected void configure() {
        when(CONDITION).using(UPPERCASE_CONVERTER).map().setEmployerName("joe");
      }
    }));

    ConstantMapping employer = (ConstantMapping) mappings.get("setEmployerName");
    assertEquals(employer.getCondition(), CONDITION);
    assertEquals(employer.getConverter(), UPPERCASE_CONVERTER);
    assertEquals(employer.getConstant(), "joe");
  }
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

        map().setSurName("jones");
      }
    }));

    PropertyMapping employer = (PropertyMapping) mappings.get("setEmployerName");
    ConstantMapping surName = (ConstantMapping) mappings.get("setSurName");
    assertEquals(employer.getLastSourceProperty().getMember().getName(), "getEmployer");
    assertEquals(employer.getLastDestinationProperty().getMember().getName(), "setEmployerName");
    assertEquals(surName.getConstant(), "jones");
    assertEquals(surName.getLastDestinationProperty().getMember().getName(), "setSurName");
  }
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

      protected void configure() {
        using(UPPERCASE_CONVERTER).map().setEmployerName("joe");
      }
    }));

    ConstantMapping employer = (ConstantMapping) mappings.get("setEmployerName");
    assertEquals(employer.getConverter(), UPPERCASE_CONVERTER);
    assertEquals(employer.getConstant(), "joe");
  }
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

        when(CONDITION).skip().setEmployerName(null);
        when(CONDITION).map().setSurName("smith");
      }
    }));

    ConstantMapping employer = (ConstantMapping) mappings.get("setEmployerName");
    assertEquals(employer.getCondition(), CONDITION);
    assertTrue(employer.isSkipped());
    assertEquals(employer.getConstant(), null);

    ConstantMapping surName = (ConstantMapping) mappings.get("setSurName");
    assertEquals(surName.getCondition(), CONDITION);
    assertFalse(surName.isSkipped());
    assertEquals(surName.getConstant(), "smith");
  }
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

      }
    });

    assertEquals(personMap.getMappings().size(), 1);
    Map<String, Mapping> mappings = Mappings.groupByLastMemberName(personMap.getMappings());
    ConstantMapping firstName = (ConstantMapping) mappings.get("setFirstName");
    assertEquals(firstName.getConstant(), "bob");
  }
View Full Code Here

Examples of org.modelmapper.spi.ConstantMapping

        map().setSurName("smith");
      }
    });

    Map<String, Mapping> mappings = Mappings.groupByLastMemberName(personMap.getMappings());
    ConstantMapping surName = (ConstantMapping) mappings.get("setSurName");
    assertEquals(surName.getConstant(), "smith");
  }
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.