Package jeeves.server.context

Examples of jeeves.server.context.ServiceContext


        assertFalse(metadata.getHarvestInfo().isHarvested());
    }

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

        final SearchManager searchManager = context.getBean(SearchManager.class);
        final long startMdCount = _metadataRepository.count();
        final String lang = "eng";
        final int startIndexDocs = numDocs(searchManager, lang);

        int md1 = importMetadata(this, context);
View Full Code Here


        for (Object o : content) {
            ((Content)o).detach();
        }
        final Element metadata = getSampleMetadataXml().setContent(content);

        ServiceContext context = createServiceContext();
        context.setAsThreadLocal();
        loginAsAdmin(context);
        _settingManager.setValue(SettingManager.SYSTEM_XLINKRESOLVER_ENABLE, true);

        String schema = _dataManager.autodetectSchema(metadata);
        String uuid = UUID.randomUUID().toString();
        int owner = context.getUserSession().getUserIdAsInt();
        String groupOwner = "" + ReservedGroup.intranet.getId();
        String source = _settingManager.getSiteId();
        String metadataType = MetadataType.METADATA.codeString;
        String changeDate;
        String createDate = changeDate = new ISODate().getDateAndTime();
View Full Code Here

    @Test
    public void testExecFindAllHarvesterWhenThereAreNone() throws Exception {
        final Get get = new Get();

        Element params = createParams();
        ServiceContext context = createServiceContext();
        final Element result = get.exec(params, context);

        Assert.assertEquals(0, result.getChildren().size());
    }
View Full Code Here

    }

    @Test
    public void testExecFindAllHarvesterWhenThereAreTwo() throws Exception {
        final Get get = new Get();
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        final String added = _harvestManager.addHarvesterReturnId(createHarvesterParams("csw"), context.getUserSession().getUserId());
        final String added2 = _harvestManager.addHarvesterReturnId(createHarvesterParams("geonetwork20"), context.getUserSession()
                .getUserId());
        Element params = createParams();
        final Element result = get.exec(params, context);

        Assert.assertEquals(2, result.getChildren().size());
View Full Code Here

        Assert.assertTrue(types.contains(((Element)result.getChildren().get(1)).getAttributeValue("type")));
    }

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

        final String added = _harvestManager.addHarvesterReturnId(createHarvesterParams("csw"), context.getUserSession().getUserId());

        final Get get = new Get();

        Element params = createParams(Pair.read("id", added));
        final Element result = get.exec(params, context);
View Full Code Here

        final Add add = new Add();

        Element params = createHarvesterParams("csw");
        CswHarvesterIntegrationTest.addCswSpecificParams(params);
        final ServiceContext serviceContext = createServiceContext();

        final Element response = add.exec(params, serviceContext);
        String id = response.getChildText("id");

        final Element afterAddSettings = _settingsManager.get("harvesting", -1);
View Full Code Here

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

        Element result = create(LIST).exec(createParams(), context);

        assertEquals(4, result.getChildren().size());
View Full Code Here

        }
    }

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

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

        assertEquals(1, result.getChildren().size());
        assertSchematronInfo(result.getChild(GeonetEntity.RECORD_EL_NAME));
    }
    @Test
    public void testExecExists() throws Exception {
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

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

    }
    @Test(expected = UnsupportedOperationException.class)
    public void testAdd() throws Exception {

        // will be implemented in the future.  For now throw exception when method is called.
        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        create(ADD).exec(createParams(), context);
    }
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.