Package jeeves.server.context

Examples of jeeves.server.context.ServiceContext


    @Autowired
    private SourceRepository _sourceRepo;

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

        final String id = importMetadata(context);

        int sampleGroup = _groupRepo.findByName("sample").getId();
View Full Code Here


        assertNotNull(_metadataRepo.findOne(element.getChildText(Geonet.Elem.ID)));
    }

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

        final String id = importMetadata(context);

        String mdPublicDataDir = Lib.resource.getDir(context, Params.Access.PUBLIC, id);
View Full Code Here

        return outFile.getAbsolutePath();
    }

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

        final String id = importMetadata(context);

        _dataManager.setThumbnail(context, id, true, "abc/small.gif", false);
View Full Code Here

*/
public class SampleDataAddIntegrationTest extends AbstractServiceIntegrationTest {
    @Test
    public void testExec() throws Exception {
        final Add add = new Add();
        ServiceContext context = createServiceContext();

        final Collection<String> schemas = Arrays.asList("iso19115", "fgdc-std", "iso19139", "dublin-core");
        StringBuilder builder = new StringBuilder();

        for (String schema : schemas) {
View Full Code Here

    CswCapabilitiesInfoFieldRepository _infoRepository;
    @Autowired
    SettingRepository _settingsRepository;
    @Test
    public void testExec() throws Exception {
        final ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        assertEquals("true", _settingsRepository.findOne("system/csw/enable").getValue());
        assertEquals(null, _settingsRepository.findOne("system/csw/contactId").getValue());
View Full Code Here

    @Test
    public void testExec() throws Exception {
        addSchematron("iso19139");
        addSchematron("iso19115");

        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element params = createParams();

        final SchematronCriteriaTypeService service = new SchematronCriteriaTypeService();
View Full Code Here

    @Test(expected = ObjectNotFoundEx.class)
    public void testExecNoSuchHarvester() throws Exception {
        final Get get = new Get();

        Element params = createParams(Pair.read("id", "912"));
        ServiceContext context = createServiceContext();
        get.exec(params, context);
    }
View Full Code Here

  final SelfRegister sfController = new SelfRegister();

  @Test
    public void selfRegisterTest() throws Exception {
    ServiceContext svcCtx = createServiceContext();


    Element params = createParams(Pair.write("surname", "john"),
              Pair.write("name", "Doe"),
              Pair.write("email", "root@localhost"),
View Full Code Here

   
  }

  @Test
    public void badParametersSelfRegisterTest() throws Exception {
    ServiceContext svcCtx = createServiceContext();


    Element params = createParams(
              Pair.write("notExpectedParameter", "NotExpectedValue")
              );
View Full Code Here

   
  }

  @Test
    public void highProfileSelfRegisterTest() throws Exception {
    ServiceContext svcCtx = createServiceContext();


    Element params = createParams(Pair.write("surname", "john"),
              Pair.write("name", "Doe"),
              Pair.write("email", "root@localhost"),
              Pair.write("profile", Profile.Administrator));
   
   
   
    Element ret = sfController.exec(params, svcCtx);
   
    assertTrue(ret.getAttribute("surname").getValue().equals("john"));
    assertTrue(ret.getAttribute("name").getValue().equals("Doe"));
    assertTrue(ret.getAttribute("email").getValue().equals("root@localhost"));
    assertTrue(ret.getAttribute("username").getValue().equals("root@localhost"));
       
    // Checks that the user has the  expected requested profile

    // TODO: I am not sure this is the expected behaviour: allowing people to create
    // even temporary account as administrator, just noticing the admin catalogue
    // might be a dangerous behaviour.

    final UserRepository userRepository = svcCtx.getBean(UserRepository.class);
    User newUsr = userRepository.findOneByEmail("root@localhost");
       
    assertTrue (newUsr.getProfile() == Profile.Administrator);
   
  }
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.