Package org.apache.oodt.cas.filemgr.system.MockXmlRpcFileManagerClient

Examples of org.apache.oodt.cas.filemgr.system.MockXmlRpcFileManagerClient.MethodCallDetails


   public void testLuceneQuery() {
      String query = "ProductId:TestProductId";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --luceneQuery"
                  + " --query " + query).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("complexQuery", methodCallDetails.getMethodName());
      assertEquals("ProductId", ((TermQueryCriteria) ((Query) methodCallDetails
            .getArgs().get(0)).getCriteria().get(0)).getElementName());
      assertEquals("TestProductId",
            ((TermQueryCriteria) ((Query) methodCallDetails.getArgs().get(0))
                  .getCriteria().get(0)).getValue());

      OptionPropertyRegister.clearRegister();

      String reducedMetadataKeys = "ProductId ProductType";
      String outputFormat = "$ProductId";
      String reducedProductTypes = "TestProductType";
      String sortBy = "ProductId";
      String delimiter = ",";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --luceneQuery"
                  + " --query " + query + " --reducedMetadataKeys " + reducedMetadataKeys
                  + " --outputFormat " + outputFormat
                  + " --reducedProductTypes " + reducedProductTypes
                  + " --sortBy " + sortBy
                  + " --delimiter " + delimiter).split(" "));
      methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("complexQuery", methodCallDetails.getMethodName());
      ComplexQuery complexQuery = (ComplexQuery) methodCallDetails.getArgs().get(0);
      assertEquals("ProductId", ((TermQueryCriteria) complexQuery.getCriteria().get(0)).getElementName());
      assertEquals("TestProductId",
            ((TermQueryCriteria) complexQuery.getCriteria().get(0)).getValue());
      assertEquals(Lists.newArrayList(reducedMetadataKeys.split(" ")), complexQuery.getReducedMetadata());
      assertEquals(outputFormat, complexQuery.getToStringResultFormat());
View Full Code Here


      String transferer = "org.apache.oodt.cas.filemgr.datatransfer.InPlaceDataTransferFactory";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --retrieveFilesById"
                  + " --productId " + productId + " --destination " + destination
                  + " --transferer " + transferer).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getProductReferences", methodCallDetails.getMethodName());
      assertEquals(productId, ((Product) methodCallDetails.getArgs().get(0)).getProductId());
   }
View Full Code Here

      String transferer = "org.apache.oodt.cas.filemgr.datatransfer.InPlaceDataTransferFactory";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --retrieveFilesByName"
                  + " --productName " + productName + " --destination " + destination
                  + " --transferer " + transferer).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getProductReferences", methodCallDetails.getMethodName());
      assertEquals(productName, ((Product) methodCallDetails.getArgs().get(0)).getProductName());
   }
View Full Code Here

      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --addProductType"
                  + " --typeName " + productTypeName + " --typeDesc "
                  + productTypeDesc + " --repository " + productTypeRepo
                  + " --versionClass " + productTypeVersioner).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("addProductType", methodCallDetails.getMethodName());
      assertEquals(1, methodCallDetails.getArgs().size());
      ProductType pt = (ProductType) methodCallDetails.getArgs().get(0);
      assertEquals(productTypeName, pt.getName());
      assertEquals(productTypeDesc, pt.getDescription());
      assertEquals(productTypeRepo, pt.getProductRepositoryPath());
      assertEquals(productTypeVersioner, pt.getVersioner());
   }
View Full Code Here

   public void testDeleteProductById() {
      String productId = "TestProductId";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --deleteProductById"
                  + " --productId " + productId).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("removeProduct", methodCallDetails.getMethodName());
      assertEquals(1, methodCallDetails.getArgs().size());
      assertEquals(productId,
            ((Product) methodCallDetails.getArgs().get(0)).getProductId());
   }
View Full Code Here

   public void testDeleteProductByName() {
      String productName = "TestProductName";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --deleteProductByName"
                  + " --productName " + productName).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("removeProduct", methodCallDetails.getMethodName());
      assertEquals(1, methodCallDetails.getArgs().size());
      assertEquals(productName,
            ((Product) methodCallDetails.getArgs().get(0)).getProductName());
   }
View Full Code Here

   public void testGetCurrentTransfer() {
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --getCurrentTransfer")
                  .split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getCurrentFileTransfer", methodCallDetails.getMethodName());
      assertEquals(0, methodCallDetails.getArgs().size());
   }
View Full Code Here

   public void testGetCurrentTransfers() {
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --getCurrentTransfers")
                  .split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getCurrentFileTransfers", methodCallDetails.getMethodName());
      assertEquals(0, methodCallDetails.getArgs().size());
   }
View Full Code Here

   public void testGetFilePercentTransferred() {
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --getFilePctTransferred"
                  + " --origRef src/testdata/test.txt").split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getRefPctTransferred", methodCallDetails.getMethodName());
      assertTrue(((Reference) methodCallDetails.getArgs().get(0))
            .getOrigReference().endsWith("src/testdata/test.txt"));
   }
View Full Code Here

   public void testGetFirstPage() {
      String productTypeName = "ProductTypeName";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --getFirstPage"
                  + " --productTypeName " + productTypeName).split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getFirstPage", methodCallDetails.getMethodName());
      assertEquals(productTypeName, ((ProductType) methodCallDetails.getArgs()
            .get(0)).getName());
   }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.system.MockXmlRpcFileManagerClient.MethodCallDetails

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.