Package org.apache.oodt.cas.filemgr.structs

Examples of org.apache.oodt.cas.filemgr.structs.ProductType


    /**
     * @since OODT-219
     *
     */
    public void testReadBadFormattedDescriptionTrimImplicitTrue() {
        ProductType type = null;

        try {
            type = repositoryManager
                    .getProductTypeByName("GenericFileWithBlankMet");
        } catch (RepositoryManagerException e) {
            fail(e.getMessage());
        }

        assertNotNull(type);
        assertNotNull(type.getDescription());
        assertEquals(expectedGenericFileBlankMetDesc, type.getDescription());
    }
View Full Code Here


    /**
     * @since OODT-219
     *
     */
    public void testReadDescriptionTrimExplicitFalse() {
        ProductType type = null;

        try {
            type = repositoryManager
                    .getProductTypeByName("GenericFileNoTypeMetadata");
        } catch (RepositoryManagerException e) {
            fail(e.getMessage());
        }

        assertNotNull(type);
        assertNotNull(type.getDescription());
        assertEquals(expectedGenericFileNoMetDesc, type.getDescription());

    }
View Full Code Here

    /**
     * @since OODT-219
     *
     */
    public void testReadDescriptionTrimExplicitTrue() {
        ProductType type = null;

        try {
            type = repositoryManager.getProductTypeByName("GenericFile");
        } catch (RepositoryManagerException e) {
            fail(e.getMessage());
        }

        assertNotNull(type);
        assertNotNull(type.getDescription());
        assertEquals(expectedGenericFileDesc, type.getDescription());

    }
View Full Code Here

    /**
     * @since OODT-219
     *
     */
    public void testReadVersionerClass() {
        ProductType type = null;

        try {
            type = repositoryManager.getProductTypeByName("GenericFile");
        } catch (RepositoryManagerException e) {
            fail(e.getMessage());
        }

        assertNotNull(type);
        assertNotNull(type.getVersioner());
        assertEquals(expectedVersionerClassName, type.getVersioner());

    }
View Full Code Here

    /**
     * @since OODT-219
     *
     */
    public void testReadRepoPath() {
        ProductType type = null;

        try {
            type = repositoryManager.getProductTypeByName("GenericFile");
        } catch (RepositoryManagerException e) {
            fail(e.getMessage());
        }

        assertNotNull(type);
        assertNotNull(type.getProductRepositoryPath());
        assertEquals(expectedRepPath, type.getProductRepositoryPath());
    }
View Full Code Here

    public void testProductTypeMethods() throws RepositoryManagerException, MalformedURLException, ConnectionException {
        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        fmClient.setDataTransfer(new LocalDataTransferFactory().createDataTransfer());
       
        ProductType productType = fmClient.getProductTypeByName("GenericFile");
        Hashtable<String, Object> productTypeHash = XmlRpcStructFactory.getXmlRpcProductType(productType);
        ProductType convBackProdType = XmlRpcStructFactory.getProductTypeFromXmlRpc(productTypeHash);
       
        assertTrue(productType.getProductTypeId().equals(convBackProdType.getProductTypeId()));
        assertTrue(productType.getName().equals(convBackProdType.getName()));
        assertTrue(productType.getDescription().equals(convBackProdType.getDescription()));
        assertTrue(productType.getVersioner().equals(convBackProdType.getVersioner()));
        assertTrue(productType.getProductRepositoryPath().equals(convBackProdType.getProductRepositoryPath()));
        for (int i = 0; i < productType.getExtractors().size(); i++) {
            ExtractorSpec spec1 = productType.getExtractors().get(i);
            ExtractorSpec spec2 = convBackProdType.getExtractors().get(i);
            assertTrue(spec1.getClassName().equals(spec2.getClassName()));
            assertTrue(spec1.getConfiguration().equals(spec2.getConfiguration()));
        }
        for (int i = 0; i < productType.getHandlers().size(); i++) {
            TypeHandler handler1 = productType.getHandlers().get(i);
            TypeHandler handler2 = convBackProdType.getHandlers().get(i);
            assertTrue(handler1.getClass().getCanonicalName().equals(handler2.getClass().getCanonicalName()));
            assertTrue(handler1.getElementName().equals(handler2.getElementName()));
        }
    }
View Full Code Here

  public void testVersionerNoStatic() {
    String filePathSpec = "/[ProductType]/[ProductionDate]/[Filename]";
    Product product = new Product();
    product.setProductStructure(Product.STRUCTURE_FLAT);
    ProductType type = new ProductType();
    type.setProductRepositoryPath(productTypePath);
    product.setProductType(type);

    Metadata metadata = new Metadata();
    metadata.addMetadata("ProductType", "FooFile");
    metadata.addMetadata("ProductionDate", "060804");
View Full Code Here

  public void testVersionerWithStatic() {
    String filePathSpec = "/[ProductType]/some/other/path[ProductionDate]/[Filename]";
    Product product = new Product();
    product.setProductStructure(Product.STRUCTURE_FLAT);
    ProductType type = new ProductType();
    type.setProductRepositoryPath(productTypePath);
    product.setProductType(type);

    Metadata metadata = new Metadata();
    metadata.addMetadata("ProductType", "FooFile");
    metadata.addMetadata("ProductionDate", "060804");
View Full Code Here

        validationLayer.modifyElement(elem);
      } catch (Exception e) {
        fail(e.getMessage());
      }
 
      ProductType type = new ProductType();
      type.setProductTypeId("urn:oodt:GenericFile");
      List<Element> retrievedElems = null;
      try {
        retrievedElems = validationLayer.getElements(type);
      } catch (Exception e) {
        fail(e.getMessage());
View Full Code Here

        }
    }

    public void testGetElementsForProductType() {
        List elementList = null;
        ProductType type = new ProductType();

        type.setProductTypeId("urn:oodt:GenericFile");
        type.setName("Generic File");

        try {
            elementList = validationLayer.getElements(type);
        } catch (ValidationLayerException e) {
            fail(e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.ProductType

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.