Examples of CollectionService


Examples of com.imaginea.mongodb.services.CollectionService

                               @Context final HttpServletRequest request) throws JSONException {

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {

                CollectionService collectionService = new CollectionServiceImpl(connectionId);
                // Get the result;
                return collectionService.getCollStats(dbName, collectionName);
            }
        });
        return response;
    }
View Full Code Here

Examples of com.imaginea.mongodb.services.CollectionService

    @Produces(MediaType.APPLICATION_JSON)
    public String getCollList(@PathParam("dbName") final String dbName, @QueryParam("connectionId") final String connectionId, @Context final HttpServletRequest request) {

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                CollectionService collectionService = new CollectionServiceImpl(connectionId);
                return collectionService.getCollList(dbName);
            }
        });
        return response;
    }
View Full Code Here

Examples of com.imaginea.mongodb.services.CollectionService

            return formErrorResponse(logger, e);
        }

        String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
            public Object execute() throws Exception {
                CollectionService collectionService = new CollectionServiceImpl(connectionId);
                String status = null;
                RequestMethod method = null;
                for (RequestMethod m : RequestMethod.values()) {
                    if ((m.toString()).equals(action)) {
                        method = m;
                        break;
                    }
                }
                switch (method) {
                    case PUT: {
                        if (updateColl.equals("false")) {
                            status = collectionService.insertCollection(dbName, newCollName, (isCapped != null && isCapped.equals("on")), capSize, maxDocs, (autoIndexId != null && autoIndexId.equals("on")));
                        } else {
                            status = collectionService.updateCollection(dbName, selectedCollection, newCollName, (isCapped != null && isCapped.equals("on")), capSize, maxDocs, (autoIndexId != null && autoIndexId.equals("on")));
                        }
                        break;
                    }
                    case DELETE: {
                        status = collectionService.deleteCollection(dbName, selectedCollection);
                        break;
                    }
                    default: {
                        status = "Action parameter value is wrong";
                        break;
View Full Code Here

Examples of test.component3.CollectionService

    log.debug(set1.toString());
  }

  @Test
  public void testArrayInject() {
    CollectionService collectionService = xmlApplicationContext
        .getBean("collectionService3");
    String[] strArray = collectionService.getStrArray();
    Assert.assertThat(strArray.length, greaterThan(0));
    log.debug(Arrays.toString(strArray));

    collectionService = xmlApplicationContext.getBean("collectionService4");
    int[] intArray = collectionService.getIntArray();
    Assert.assertThat(intArray.length, greaterThan(0));
    log.debug(Arrays.toString(intArray));

    collectionService = xmlApplicationContext.getBean("collectionService5");
    Object[] obj = collectionService.getObjArray();
    Assert.assertThat(obj.length, greaterThan(0));
    Object[] obj2 = (Object[]) obj[3];
    Assert.assertThat(obj2.length, greaterThan(0));
    Assert.assertThat((Long) obj2[1], is(10000000000L));
  }
View Full Code Here

Examples of test.component3.CollectionService

  }

  @Test(expected = ClassCastException.class)
  public void testIdTypeError() {
    ApplicationContext context = new XmlApplicationContext("firefly2.xml");
    CollectionService collectionService = context
        .getBean("collectionService");
    for (Integer i : collectionService.getSet())
      i++;

  }
View Full Code Here

Examples of test.component3.CollectionService

  }

  @Test
  public void testXmlLinkedListInject() {
    // 注入的不仅仅是List
    CollectionService collectionService = xmlApplicationContext
        .getBean("collectionService");
    List<Object> list = collectionService.getList();
    Assert.assertThat(list.size(), greaterThan(0));
    log.debug(list.toString());
  }
View Full Code Here

Examples of test.component3.CollectionService

  @SuppressWarnings("unchecked")
  @Test
  public void testListInject() {
    // list的值也是list
    CollectionService collectionService = xmlApplicationContext
        .getBean("collectionService2");
    List<Object> list = collectionService.getList();
    Assert.assertThat(list.size(), greaterThan(2));
    Set<String> set = (Set<String>) list.get(2);
    Assert.assertThat(set.size(), is(2));
    log.debug(set.toString());

    // set赋值
    Set<Integer> set1 = collectionService.getSet();
    Assert.assertThat(set1.size(), is(2));
    log.debug(set1.toString());
  }
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.