Examples of Blueprint


Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        assertNull(characterInfo.getAllianceName());
    }

    @Test
    public void testDoPost_NoAlliance() throws Exception {
        Blueprint blueprint = new Blueprint();
        when(blueprintDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(blueprint);
        when(httpServletRequest.getParameter("userID")).thenReturn("1");
        when(httpServletRequest.getParameter("blueprintID")).thenReturn("2");
        when(httpServletRequest.getParameter("characterID")).thenReturn("3");
        when(httpServletRequest.getParameter("characterName")).thenReturn("characterName");
        when(httpServletRequest.getParameter("corporationID")).thenReturn("4");
        when(httpServletRequest.getParameter("corporationName")).thenReturn("corporationName");
        when(httpServletRequest.getParameter("corporationTicker")).thenReturn("corporationTicker");
        updateBlueprintTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(blueprintDao).putWithoutChecks(blueprint);
        CharacterInfo characterInfo = blueprint.getAttachedCharacterInfo();
        assertNotNull(characterInfo);
        assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
        assertEquals("characterName", characterInfo.getName());
        assertEquals(Long.valueOf(4), characterInfo.getCorporationID());
        assertEquals("corporationName", characterInfo.getCorporationName());
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        assertNull(characterInfo.getAllianceName());
    }

    @Test
    public void testDoPost_Detach() throws Exception {
        Blueprint blueprint = new Blueprint();
        when(blueprintDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(blueprint);
        when(httpServletRequest.getParameter("userID")).thenReturn("1");
        when(httpServletRequest.getParameter("blueprintID")).thenReturn("2");
        updateBlueprintTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(blueprintDao).putWithoutChecks(blueprint);
        assertNull(blueprint.getAttachedCharacterInfo());
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

    }

    @Override
    public Blueprint createBlueprint(Long blueprintTypeID, Long itemID, Integer meLevel, Integer peLevel, Long attachedCharacterID, String sharingLevel, Key<User> userKey) throws EveDbException {
        BlueprintTypeDto blueprintTypeDto = eveDbGateway.getBlueprintTypeByTypeID(blueprintTypeID);
        Blueprint blueprint = new Blueprint();
        blueprint.setUser(userKey);
        blueprint.setItemID(itemID);
        blueprint.setItemTypeID(blueprintTypeID);
        blueprint.setItemTypeName(blueprintTypeDto.getBlueprintTypeName());
        blueprint.setProductTypeID(blueprintTypeDto.getProductTypeID());
        blueprint.setProductTypeName(blueprintTypeDto.getProductTypeName());
        blueprint.setProductGraphicIcon(blueprintTypeDto.getProductGraphicIcon());
        blueprint.setProductTypeCategoryID(blueprintTypeDto.getProductCategoryID());
        blueprint.setProductivityLevel(peLevel);
        blueprint.setMaterialLevel(meLevel);
        if (attachedCharacterID != null) {
            Character character = characterDao.getByCharacterID(attachedCharacterID, userKey);
            blueprint.setAttachedCharacterInfo(mapper.map(character, CharacterInfo.class));
        } else {
            blueprint.setAttachedCharacterInfo(null);
        }
        blueprint.setSharingLevel(sharingLevel);
        blueprint.setCreatedDate(new Date());
        blueprint.setUpdatedDate(new Date());
        blueprintDao.put(blueprint, userKey);
        return blueprint;
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        return blueprintDao.getAllForAllianceID(mainCharacterInfo.getAllianceID());
    }

    @Override
    public Blueprint saveBlueprint(Long blueprintID, Long itemID, Integer meLevel, Integer peLevel, Long attachedCharacterID, String sharingLevel, Key<User> userKey) {
        Blueprint blueprint = blueprintDao.get(blueprintID, userKey);
        blueprint.setItemID(itemID);
        blueprint.setMaterialLevel(meLevel);
        blueprint.setProductivityLevel(peLevel);
        if (attachedCharacterID != null) {
            Character character = characterDao.getByCharacterID(attachedCharacterID, userKey);
            blueprint.setAttachedCharacterInfo(mapper.map(character, CharacterInfo.class));
        } else {
            blueprint.setAttachedCharacterInfo(null);
        }
        blueprint.setSharingLevel(sharingLevel);
        blueprint.setUpdatedDate(new Date());
        blueprintDao.put(blueprint, userKey);
        return blueprint;
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        return blueprint;
    }

    @Override
    public void deleteBlueprint(Long blueprintID, Key<User> userKey) {
        Blueprint blueprint = blueprintDao.get(blueprintID, userKey);
        blueprintDao.delete(blueprint);
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Long userID = Long.valueOf(req.getParameter("userID"));
            Long blueprintID = Long.valueOf(req.getParameter("blueprintID"));
            Long characterID = req.getParameter("characterID") == null ? null : Long.valueOf(req.getParameter("characterID"));
            Blueprint blueprint = blueprintDao.get(blueprintID, new Key<User>(User.class, userID));
            if (characterID != null) {
                CharacterInfo characterInfo = new CharacterInfo();
                characterInfo.setCharacterID(characterID);
                characterInfo.setName(req.getParameter("characterName"));
                String corporationID = req.getParameter("corporationID");
                characterInfo.setCorporationID(corporationID == null ? null : Long.valueOf(corporationID));
                characterInfo.setCorporationName(req.getParameter("corporationName"));
                characterInfo.setCorporationTicker(req.getParameter("corporationTicker"));
                String allianceID = req.getParameter("allianceID");
                characterInfo.setAllianceID(allianceID == null ? null : Long.valueOf(allianceID));
                characterInfo.setAllianceName(req.getParameter("allianceName"));
                blueprint.setAttachedCharacterInfo(characterInfo);
            } else {
                blueprint.setAttachedCharacterInfo(null);
            }
            blueprintDao.putWithoutChecks(blueprint);
        } catch (Throwable t) {
            logger.error("Caught Throwable", t);
        }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        return fullApiKeyDtos;
    }

    @Override
    public BlueprintDto createBlueprint(String blueprintTypeName, Integer meLevel, Integer peLevel) throws EveDbException, InvalidNameException {
        Blueprint blueprint = applicationFacade.createBlueprint(blueprintTypeName, meLevel, peLevel);
        return mapper.map(blueprint, BlueprintDto.class);
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

        return blueprintDtos;
    }

    @Override
    public BlueprintDto saveBlueprint(Long blueprintID, Long itemID, Integer meLevel, Integer peLevel, Long attachedCharacterID, String sharingLevel) {
        Blueprint blueprint = applicationFacade.saveBlueprint(blueprintID, itemID, meLevel, peLevel, attachedCharacterID, sharingLevel);
        return mapper.map(blueprint, BlueprintDto.class);
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.blueprint.Blueprint

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Long blueprintID = Long.valueOf(req.getParameter("blueprintID"));
            logger.debug("Checking blueprint for consistency: {}", blueprintID);
            Blueprint blueprint = blueprintDao.get(new Key<Blueprint>(Blueprint.class, blueprintID));
            CharacterInfo attachedCharacterInfo = blueprint.getAttachedCharacterInfo();
            if (attachedCharacterInfo == null) {
                logger.debug("Blueprint does not have attached character, skipping");
                return;
            }
            try {
                Character character = characterDao.get(new Key<Character>(Character.class, attachedCharacterInfo.getId()));
                logger.debug("Updating blueprint attached character information: {} ({})", character.getName(), character.getCharacterID());
                attachedCharacterInfo.setCharacterID(character.getCharacterID());
                attachedCharacterInfo.setName(character.getName());
                attachedCharacterInfo.setCorporationID(character.getCorporationID());
                attachedCharacterInfo.setCorporationName(character.getCorporationName());
                attachedCharacterInfo.setCorporationTicker(character.getCorporationTicker());
                attachedCharacterInfo.setAllianceID(character.getAllianceID());
                attachedCharacterInfo.setAllianceName(character.getAllianceName());
            } catch (NotFoundException e) {
                logger.warn("Attached character does not exist: {}", attachedCharacterInfo.getId());
                blueprint.setAttachedCharacterInfo(null);
            }
            blueprint.setUpdatedDate(new Date());
            blueprintDao.putWithoutChecks(blueprint);
        } catch (Throwable t) {
            logger.error("Caught Throwable", t);
        }
    }
View Full Code Here

Examples of org.apache.ambari.shell.completion.Blueprint

  @Test
  public void testBuildClusterForNonExistingBlueprint() {
    when(client.doesBlueprintExist("id")).thenReturn(false);

    String result = clusterCommands.buildCluster(new Blueprint("id"));

    verify(client).doesBlueprintExist("id");
    assertEquals("Not a valid blueprint id", result);
  }
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.