Package org.apache.oodt.cas.cli.action.CmdLineAction

Examples of org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter


   private static final String PRODUCT_STRUCTURE = "Flat";
   private static final String PRODUCT_STATUS = "DONE";
   private static final String PRODUCT_TYPE_NAME = "TestProductType";

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      GetPrevPageCliAction cliAction = new NullPTGetPrevPageCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.setCurrentPageNum(1);
      try {
         cliAction.execute(printer);
View Full Code Here


      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetPrevPageCliAction cliAction = new MockGetPrevPageCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.setCurrentPageNum(PAGE_NUM);
      cliAction.execute(printer);
      assertEquals(6, printer.getPrintedMessages().size());
      assertEquals("Page: [num=" + (PAGE_NUM - 1) + ", totalPages=" + TOTAL_PAGES
            + ", pageSize=" + PAGE_SIZE + "]", printer.getPrintedMessages()
            .get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
      assertEquals("Products:", printer.getPrintedMessages().get(2));
      assertEquals("\n", printer.getPrintedMessages().get(3));
      assertEquals("Product: [id=" + PRODUCT_ID_4 + ",name=" + PRODUCT_NAME_4
            + ",type=" + PRODUCT_TYPE_NAME + ",structure=" + PRODUCT_STRUCTURE
            + ", transferStatus=" + PRODUCT_STATUS + "]", printer
            .getPrintedMessages().get(4));
      assertEquals("\n", printer.getPrintedMessages().get(5));
   }
View Full Code Here

   private static final String PRODUCT_ID = "TestProductId";
   private static final String PRODUCT_TYPE_NAME = "TestProductType";
   private static final double PERCENT_TRANSFERRED = 0.5;

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      GetProductPercentTransferredCliAction cliAction = new NullPTGetProductPercentTransferredCliAction();
      cliAction.setProductId(PRODUCT_ID);
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      try {
         cliAction.execute(printer);
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetProductPercentTransferredCliAction cliAction = new MockGetProductPercentTransferredCliAction();
      cliAction.setProductId(PRODUCT_ID);
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("Product: [id=" + PRODUCT_ID + ", transferPct="
            + PERCENT_TRANSFERRED + "]", printer.getPrintedMessages()
            .get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
   }
View Full Code Here

   private static final int NUM_PRODUCTS = 10;
   private static final String PRODUCT_TYPE_NAME = "TestProductType";

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetNumProductsCliAction cliAction = new MockGetNumProductsCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("Type: [" + PRODUCT_TYPE_NAME+ "], Num Products: [" + NUM_PRODUCTS + "]", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
   }
View Full Code Here

      assertEquals("Type: [" + PRODUCT_TYPE_NAME+ "], Num Products: [" + NUM_PRODUCTS + "]", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
   }

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      NullPTGetNumProductsCliAction cliAction = new NullPTGetNumProductsCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
View Full Code Here

   }

   public void testDataFlow() throws CmdLineActionException, IOException {
      MockDumpMetadataCliAction cliAction = new MockDumpMetadataCliAction();
      cliAction.setProductId(PRODUCT_ID);
      ActionMessagePrinter printer = new ActionMessagePrinter();
      cliAction.execute(printer);
      assertEquals(
            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
          + "<cas:metadata xmlns:cas=\"http://oodt.jpl.nasa.gov/1.0/cas\">\n"
          + "<keyval type=\"vector\">\n"
          + "<key>Filename</key>\n"
          + "<val>data.dat</val>\n"
          + "</keyval>\n"
          + "</cas:metadata>\n",
            printer.getPrintedMessages().get(0));

      cliAction.setOutputDir(tmpFile);
      cliAction.execute(printer);
      assertTrue(new File(tmpFile, FILE_NAME + ".met").exists());
      assertEquals(
View Full Code Here

   private static final String PRODUCT_TYPE_DESC = "ProductTypeDesc";
   private static final String PRODUCT_TYPE_VERSIONER = BasicVersioner.class.getCanonicalName();
   private static final String PRODUCT_TYPE_REPO = "/path/to/repo";

   public void testValidateErrors() {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      GetProductTypeByNameCliAction cliAction = new NullPTGetProductTypeByNameCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
View Full Code Here

      } catch (CmdLineActionException ignore) {
      }
   }

   public void testDataFlow() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockGetProductTypeByNameCliAction cliAction = new MockGetProductTypeByNameCliAction();
      cliAction.setProductTypeName(PRODUCT_TYPE_NAME);
      cliAction.execute(printer);
      assertEquals(2, printer.getPrintedMessages().size());
      assertEquals("getProductTypeByName: Result: [name="
               + PRODUCT_TYPE_NAME + ", description=" + PRODUCT_TYPE_DESC
               + ", id=" + PRODUCT_TYPE_ID + ", versionerClass="
               + PRODUCT_TYPE_VERSIONER + ", repositoryPath="
               + PRODUCT_TYPE_REPO + "]", printer.getPrintedMessages().get(0));
      assertEquals("\n", printer.getPrintedMessages().get(1));
   }
View Full Code Here

         .getCanonicalName();

   private static ProductType productTypePassedToClient;

   public void testValidateErrors() throws CmdLineActionException {
      ActionMessagePrinter printer = new ActionMessagePrinter();
      MockAddProductTypeCliAction cliAction = new MockAddProductTypeCliAction();
      try {
         cliAction.execute(printer);
         fail("Expected throw CmdLineActionException");
      } catch (CmdLineActionException ignore) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.cli.action.CmdLineAction.ActionMessagePrinter

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.