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

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


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


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

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

      String productTypeName = "TestProductType";
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --getProductPctTransferred"
                  + " --productId " + productId + " --productTypeName " + productTypeName)
                  .split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getProductPctTransferred",
            methodCallDetails.getMethodName());
      assertEquals(productId,
            ((Product) methodCallDetails.getArgs().get(0)).getProductId());
   }
View Full Code Here

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

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

                  + " --productName " + productName + " --productStructure "
                  + structure + " --productTypeName " + productTypeName
                  + " --metadataFile " + metadataFile + " --refs " + ref
                  + " --clientTransfer --dataTransfer " + dataTransferer)
                  .split(" "));
      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("ingestProduct", methodCallDetails.getMethodName());
      assertEquals(productName,
            ((Product) methodCallDetails.getArgs().get(0)).getProductName());
      assertEquals(structure,
            ((Product) methodCallDetails.getArgs().get(0))
                  .getProductStructure());
      assertEquals(productTypeName,
            ((Product) methodCallDetails.getArgs().get(0)).getProductType()
                  .getName());
      assertTrue(((Product) methodCallDetails.getArgs().get(0))
            .getProductReferences().get(0).getOrigReference().endsWith(ref));

      assertEquals("test.txt",
            ((Metadata) methodCallDetails.getArgs().get(1))
                  .getMetadata("Filename"));
      assertEquals("GenericFile", ((Metadata) methodCallDetails.getArgs()
            .get(1)).getMetadata("ProductType"));
      assertEquals(true, methodCallDetails.getArgs().get(2));
   }
View Full Code Here

            .run(("--url http://localhost:9000 --operation --dumpMetadata"
                  + " --productId " + productId).split(" "));

      OptionPropertyRegister.clearRegister();

      MethodCallDetails methodCallDetails = client.getLastMethodCallDetails();
      assertEquals("getMetadata", methodCallDetails.getMethodName());
      assertEquals(productId,
            ((Product) methodCallDetails.getArgs().get(0)).getProductId());
      cmdLineUtility
            .run(("--url http://localhost:9000 --operation --dumpMetadata"
                  + " --productId " + productId + " --outputDir " + tmpFile
                  .getAbsolutePath()).split(" "));
      FileUtils.forceDelete(tmpFile);
View Full Code Here

   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

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.