Examples of PriceSet


Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        checkPriceSetTaskServlet = new CheckPriceSetTaskServlet(priceSetDao, characterDao);
    }

    @Test
    public void testDoPost() throws Exception {
        PriceSet priceSet = new PriceSet();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        lv.odylab.evemanage.domain.eve.Character character = new Character();
        character.setCharacterID(3L);
        character.setName("characterName");
        character.setCorporationID(4L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        character.setAllianceID(5L);
        character.setAllianceName("allianceName");
        priceSet.setAttachedCharacterInfo(attachedCharacterInfo);
        when(httpServletRequest.getParameter("priceSetID")).thenReturn("1");
        when(priceSetDao.get(new Key<PriceSet>(PriceSet.class, 1))).thenReturn(priceSet);
        when(characterDao.get(new Key<Character>(Character.class, 2))).thenReturn(character);
        checkPriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        assertEquals("allianceName", attachedCharacterInfo.getAllianceName());
    }

    @Test
    public void testDoPost_WrongCharacter() throws Exception {
        PriceSet priceSet = new PriceSet();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        priceSet.setAttachedCharacterInfo(attachedCharacterInfo);
        when(httpServletRequest.getParameter("priceSetID")).thenReturn("1");
        when(priceSetDao.get(new Key<PriceSet>(PriceSet.class, 1))).thenReturn(priceSet);
        when(characterDao.get(new Key<Character>(Character.class, 2))).thenThrow(new NotFoundException(null));
        checkPriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        assertNull(priceSet.getAttachedCharacterInfo());
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        assertNull(priceSet.getAttachedCharacterInfo());
    }

    @Test
    public void testDoPost_NoCharacter() throws Exception {
        PriceSet priceSet = new PriceSet();
        when(httpServletRequest.getParameter("priceSetID")).thenReturn("1");
        when(priceSetDao.get(new Key<PriceSet>(PriceSet.class, 1))).thenReturn(priceSet);
        checkPriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao, never()).putWithoutChecks(priceSet);
    }
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        updatePriceSetTaskServlet = new UpdatePriceSetTaskServlet(priceSetDao);
    }

    @Test
    public void testDoPost() throws Exception {
        PriceSet priceSet = new PriceSet();
        when(priceSetDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(priceSet);
        when(httpServletRequest.getParameter("userID")).thenReturn("1");
        when(httpServletRequest.getParameter("priceSetID")).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");
        when(httpServletRequest.getParameter("allianceID")).thenReturn("5");
        when(httpServletRequest.getParameter("allianceName")).thenReturn("allianceName");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.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.priceset.PriceSet

        assertEquals("allianceName", characterInfo.getAllianceName());
    }

    @Test
    public void testDoPost_NoCorporation() throws Exception {
        PriceSet priceSet = new PriceSet();
        when(priceSetDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(priceSet);
        when(httpServletRequest.getParameter("userID")).thenReturn("1");
        when(httpServletRequest.getParameter("priceSetID")).thenReturn("2");
        when(httpServletRequest.getParameter("characterID")).thenReturn("3");
        when(httpServletRequest.getParameter("characterName")).thenReturn("characterName");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.getAttachedCharacterInfo();
        assertNotNull(characterInfo);
        assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
        assertEquals("characterName", characterInfo.getName());
        assertNull(characterInfo.getCorporationID());
        assertNull(characterInfo.getCorporationName());
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        assertNull(characterInfo.getAllianceName());
    }

    @Test
    public void testDoPost_NoAlliance() throws Exception {
        PriceSet priceSet = new PriceSet();
        when(priceSetDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(priceSet);
        when(httpServletRequest.getParameter("userID")).thenReturn("1");
        when(httpServletRequest.getParameter("priceSetID")).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");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.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.priceset.PriceSet

        assertNull(characterInfo.getAllianceName());
    }

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

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

    @Test
    public void testLaunchForDelete() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        PriceSet priceSet2 = new PriceSet();
        priceSets.add(priceSet1);
        priceSets.add(priceSet2);
        when(priceSetDao.getAll(new Key<User>(User.class, 1L), 2L)).thenReturn(priceSets);
        updatePriceSetTaskLauncher.launchForDelete(1L, 2L);
        verify(queue, times(2)).add(any(TaskOptions.class));
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        lv.odylab.evemanage.domain.eve.Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(2L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.setId(3L);
        priceSets.add(priceSet1);
        priceSets.add(priceSet2);
        when(priceSetDao.getAll(new Key<User>(User.class, 4L), 1L)).thenReturn(priceSets);
        updatePriceSetTaskLauncher.launchForDetach(4L, character);
        verify(queue, times(2)).add(any(TaskOptions.class));
View Full Code Here

Examples of lv.odylab.evemanage.domain.priceset.PriceSet

        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        character.setAllianceID(3L);
        character.setAllianceName("allianceName");
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(4L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.setId(5L);
        priceSets.add(priceSet1);
        priceSets.add(priceSet2);
        when(priceSetDao.getAll(new Key<User>(User.class, 4L), 1L)).thenReturn(priceSets);
        updatePriceSetTaskLauncher.launchForUpdate(4L, character);
        verify(queue, times(2)).add(any(TaskOptions.class));
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.