Package jeeves.server.context

Examples of jeeves.server.context.ServiceContext


        create(ADD).exec(createParams(), context);
    }

    @Test
    public void testEdit() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        int newPriority = _group1_Name1_SchematronId1.getSchematron().getDisplayPriority() + 1000;
        final int id = _group1_Name1_SchematronId1.getId().getSchematronId();
        final Element params = createParams(
View Full Code Here


        assertEquals(newPriority, _schematronRepository.findOne(id).getDisplayPriority());
    }

    @Test(expected = UnsupportedOperationException.class)
    public void testDelete() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        // might be be implemented in the future.  For now throw exception when method is called.
        create(DELETE).exec(createParams(), context);
    }
View Full Code Here

    @Autowired
    private HarvestHistoryRepository _repo;

    @Test
    public void testExecWithHistory() throws Exception {
        final ServiceContext context = createServiceContext();
        loginAsAdmin(context);
       
        final Element csw = createHarvesterParams("csw");
        CswHarvesterIntegrationTest.addCswSpecificParams(csw);
        final String id = _harvestManager.addHarvesterReturnId(csw, context.getUserSession().getUserId());
        final Element harvesterConfig = _harvestManager.get(id, context, null);
        final String harvesterName = "Name";
        final String harvesterUuid = Xml.selectString(harvesterConfig, "*//uuid");
        final HarvestHistory history = createHistory(harvesterName, harvesterUuid, new ISODate("1980-01-01T10:00:00"));
        final HarvestHistory history2 = createHistory(harvesterName, harvesterUuid, new ISODate("1980-02-01T10:00:00"));
View Full Code Here

        assertEquals(history3.getId(), Integer.parseInt(harvestHistory.get(2).getChildText("id")));
    }

    @Test
    public void testExecWithoutHistory() throws Exception {
        final ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        final Element csw = createHarvesterParams("csw");
        CswHarvesterIntegrationTest.addCswSpecificParams(csw);
        final String id = _harvestManager.addHarvesterReturnId(csw, context.getUserSession().getUserId());
        final Element harvesterConfig = _harvestManager.get(id, context, null);
        final String harvesterUuid = Xml.selectString(harvesterConfig, "*//uuid");

        final History historyService = new History();
        Element params = Xml.loadString("<request><id>"+id+"</id><uuid>"+harvesterUuid+"</uuid></request>", false);
View Full Code Here

* Created by Jesse on 2/13/14.
*/
public class SchematronCriteriaServiceIntegrationTest extends AbstractSchematronServiceIntegrationTest {
    @Test
    public void testExecListAll() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams();

        Element result = createService(LIST).exec(params, context);
View Full Code Here

        assertGroupOnlyId(result);
    }

    @Test
    public void testExecListAllIncludeGroup() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams(
                read(SchematronCriteriaService.PARAM_INCLUDE_GROUP, true)
        );
View Full Code Here

        assertFullGroup(result);
    }

    @Test
    public void testExecListAllHavingGroupName() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams(
                read(SchematronCriteriaService.PARAM_GROUP_NAME, _group2_Name2_SchematronId2.getId().getName())
        );
View Full Code Here

        assertGroupOnlyId(result);
    }

    @Test
    public void testExecListAllHavingSchematronId() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams(
                read(SchematronCriteriaService.PARAM_SCHEMATRON_ID, "" + _group1_Name1_SchematronId1.getId().getSchematronId())
        );
View Full Code Here

        assertGroupOnlyId(result);
    }

    @Test
    public void testExecListOne() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams(
                read(Params.ID, _group1_Name1_SchematronId1.getCriteria().get(0).getId())
        );
View Full Code Here

        assertFullGroup(result);
    }

    @Test
    public void testExecExists() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams(
                read(Params.ID, _group1_Name1_SchematronId1.getCriteria().get(0).getId())
        );
View Full Code Here

TOP

Related Classes of jeeves.server.context.ServiceContext

Copyright © 2018 www.massapicom. 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.