Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.RepositoryInfo


public class ConverterTest extends TestCase {

    public void testRepositoryInfo() throws Exception {
        // dry run
        RepositoryInfoImpl obj1 = new RepositoryInfoImpl();
        RepositoryInfo obj2 = Converter.convert(Converter.convert(obj1));

        assertDataObjectsEquals("RepositoryInfo", obj1, obj2);

        // values
        obj1 = new RepositoryInfoImpl();
View Full Code Here


    private void createGUI() {
        setTitle(WINDOW_TITLE + " - " + model.getRepositoryName());
        setPreferredSize(new Dimension(700, 700));
        setMinimumSize(new Dimension(200, 60));

        RepositoryInfo repInfo = null;
        try {
            repInfo = model.getRepositoryInfo();
        } catch (Exception e) {
            ClientHelper.showError(this, e);
            dispose();
View Full Code Here

    @Override
    public void run(Session session) {
        CmisTestResult success;
        CmisTestResult failure;

        RepositoryInfo ri = getRepositoryInfo(session);

        // id
        success = createResult(OK, "Repository id: " + ri.getId());
        failure = createResult(FAILURE, "Repository id is not set!", true);
        addResult(assertStringNotEmpty(ri.getId(), success, failure));

        // name
        failure = createResult(FAILURE, "Repository name is not set!");
        addResult(assertNotNull(ri.getName(), null, failure));

        success = createResult(OK, "Repository name: " + ri.getName());
        failure = createResult(WARNING, "Repository name is empty!");
        addResult(assertStringNotEmpty(ri.getName(), success, failure));

        // description
        failure = createResult(FAILURE, "Repository description is not set!");
        addResult(assertNotNull(ri.getDescription(), null, failure));

        success = createResult(OK, "Repository description: " + ri.getDescription());
        failure = createResult(WARNING, "Repository description is empty!");
        addResult(assertStringNotEmpty(ri.getDescription(), success, failure));

        // vendor
        failure = createResult(FAILURE, "Vendor name is not set!");
        addResult(assertStringNotEmpty(ri.getVendorName(), null, failure));

        success = createResult(OK, "Vendor name: " + ri.getVendorName());
        failure = createResult(WARNING, "Vendor name is empty!");
        addResult(assertStringNotEmpty(ri.getVendorName(), success, failure));

        // product name
        failure = createResult(FAILURE, "Product name is not set!");
        addResult(assertStringNotEmpty(ri.getProductName(), null, failure));

        success = createResult(OK, "Product name: " + ri.getProductName());
        failure = createResult(WARNING, "Product name is empty!");
        addResult(assertStringNotEmpty(ri.getProductName(), success, failure));

        // product version
        failure = createResult(FAILURE, "Product version is not set!");
        addResult(assertStringNotEmpty(ri.getProductVersion(), null, failure));

        success = createResult(OK, "Product version: " + ri.getProductVersion());
        failure = createResult(WARNING, "Product version is empty!");
        addResult(assertStringNotEmpty(ri.getProductVersion(), success, failure));

        // CMIS version supported
        success = createResult(OK, "CMIS Version Supported: " + ri.getCmisVersionSupported());
        failure = createResult(FAILURE, "CMIS Version Supported is not set!");
        addResult(assertStringNotEmpty(ri.getCmisVersionSupported(), success, failure));

        failure = createResult(FAILURE, "CMIS Version Supported is not '1.0'!");
        addResult(assertEquals("1.0", ri.getCmisVersionSupported(), null, failure));

        // root folder
        success = createResult(OK, "Root folder id: " + ri.getRootFolderId());
        failure = createResult(FAILURE, "Root folder id is not set!");
        addResult(assertStringNotEmpty(ri.getRootFolderId(), success, failure));

        // thin client uri
        success = createResult(OK, "Thin client URI: " + ri.getThinClientUri());
        failure = createResult(WARNING, "Thin client URI is not set!");
        addResult(assertStringNotEmpty(ri.getThinClientUri(), success, failure));

        // principal id anonymous
        success = createResult(OK, "Principal Id anonymous: " + ri.getPrincipalIdAnonymous());
        failure = createResult(WARNING, "Principal Id anonymous is not set!");
        addResult(assertStringNotEmpty(ri.getPrincipalIdAnonymous(), success, failure));

        // principal id anyone
        success = createResult(OK, "Principal Id anyone: " + ri.getPrincipalIdAnyone());
        failure = createResult(WARNING, "Principal Id anyone is not set!");
        addResult(assertStringNotEmpty(ri.getPrincipalIdAnyone(), success, failure));

        // latest change log token
        success = createResult(OK, "Latest change log token: " + ri.getLatestChangeLogToken());
        failure = createResult(WARNING, "Latest change log token is not set!");
        addResult(assertStringNotEmpty(ri.getLatestChangeLogToken(), success, failure));

        // changes incomplete
        success = createResult(OK, "Changes Incomplete: " + ri.getChangesIncomplete());
        failure = createResult(WARNING, "Changes Incomplete is not set!");
        addResult(assertNotNull(ri.getChangesIncomplete(), success, failure));

        // changes on type
        success = createResult(OK, "Changes on type: " + ri.getChangesOnType());
        failure = createResult(WARNING, "Changes on type is not set!");
        addResult(assertNotNull(ri.getChangesOnType(), success, failure));

        if (ri.getChangesOnType() != null) {
            failure = createResult(WARNING, "Changes on type has more than 4 entries!");
            addResult(assertIsTrue(ri.getChangesOnType().size() < 5, null, failure));
        }

        // capabilities
        if (ri.getCapabilities() == null) {
            addResult(createResult(FAILURE, "Capabilities are not set!"));
        } else {
            RepositoryCapabilities cap = ri.getCapabilities();

            // ACL capability
            success = createResult(OK, "ACL capability: " + cap.getAclCapability());
            failure = createResult(FAILURE, "ACL capability is not set!");
            addResult(assertNotNull(cap.getAclCapability(), success, failure));

            // changes capability
            success = createResult(OK, "Changes capability: " + cap.getChangesCapability());
            failure = createResult(WARNING, "Changes capability is not set!");
            addResult(assertNotNull(cap.getChangesCapability(), success, failure));

            // content stream updates capability
            success = createResult(OK, "Content stream updates capability: " + cap.getContentStreamUpdatesCapability());
            failure = createResult(FAILURE, "Content stream updates is not set!");
            addResult(assertNotNull(cap.getContentStreamUpdatesCapability(), success, failure));

            // get descendants capability
            success = createResult(OK, "Get descendants capability: " + cap.isGetDescendantsSupported());
            failure = createResult(FAILURE, "Get descendants capability is not set!");
            addResult(assertNotNull(cap.isGetDescendantsSupported(), success, failure));

            // get folder tree capability
            success = createResult(OK, "Get folder tree capability: " + cap.isGetFolderTreeSupported());
            failure = createResult(FAILURE, "Get folder tree capability is not set!");
            addResult(assertNotNull(cap.isGetFolderTreeSupported(), success, failure));

            // multifiling capability
            success = createResult(OK, "Multifiling capability: " + cap.isMultifilingSupported());
            failure = createResult(FAILURE, "Multifiling capability is not set!");
            addResult(assertNotNull(cap.isMultifilingSupported(), success, failure));

            // unfiling capability
            success = createResult(OK, "Unfiling capability: " + cap.isUnfilingSupported());
            failure = createResult(FAILURE, "Unfiling capability is not set!");
            addResult(assertNotNull(cap.isUnfilingSupported(), success, failure));

            // version specific filing capability
            success = createResult(OK, "Version specific filing capability: " + cap.isVersionSpecificFilingSupported());
            failure = createResult(FAILURE, "Version specific filing capability is not set!");
            addResult(assertNotNull(cap.isVersionSpecificFilingSupported(), success, failure));

            // query capability
            success = createResult(OK, "Query capability: " + cap.getQueryCapability());
            failure = createResult(FAILURE, "Query capability is not set!");
            addResult(assertNotNull(cap.getQueryCapability(), success, failure));

            // JOIN capability
            success = createResult(OK, "JOIN capability: " + cap.getJoinCapability());
            failure = createResult(FAILURE, "JOIN capability is not set!");
            addResult(assertNotNull(cap.getJoinCapability(), success, failure));

            // all versions searchable capability
            success = createResult(OK, "All versions searchable capability: " + cap.isAllVersionsSearchableSupported());
            failure = createResult(FAILURE, "All versions searchable capability is not set!");
            addResult(assertNotNull(cap.isAllVersionsSearchableSupported(), success, failure));

            // PWC searchable capability
            success = createResult(OK, "PWC searchable capability: " + cap.isPwcSearchableSupported());
            failure = createResult(FAILURE, "PWC searchable capability is not set!");
            addResult(assertNotNull(cap.isPwcSearchableSupported(), success, failure));

            // PWC updatable capability
            success = createResult(OK, "PWC updatable capability: " + cap.isPwcUpdatableSupported());
            failure = createResult(FAILURE, "PWC updatable capability is not set!");
            addResult(assertNotNull(cap.isPwcUpdatableSupported(), success, failure));

            // renditions capability
            success = createResult(OK, "Renditions capability: " + cap.getRenditionsCapability());
            failure = createResult(FAILURE, "Renditions capability is not set!");
            addResult(assertNotNull(cap.getRenditionsCapability(), success, failure));
        }

        // ACL capabilities
        if (ri.getAclCapabilities() == null) {
            addResult(createResult(WARNING, "ACL capabilities are not set!"));
        } else {
            AclCapabilities aclCap = ri.getAclCapabilities();

            // supported permissions
            success = createResult(OK, "Supported permissions: " + aclCap.getSupportedPermissions());
            failure = createResult(WARNING, "Supported permissions are not set!");
            addResult(assertNotNull(aclCap.getSupportedPermissions(), success, failure));
View Full Code Here

    private AclCapabilities aclCapabilities = null;

    @Before
    public void setup() throws Exception {
        RepositoryInfo r = this.session.getRepositoryInfo();
        // capabilities
        RepositoryCapabilities repcap = r.getCapabilities();
        CapabilityAcl capacl = repcap.getAclCapability();

        if (capacl != CapabilityAcl.NONE) {
            // acl capabilities
            this.aclCapabilities = r.getAclCapabilities();
        }

        Assume.assumeNotNull(this.aclCapabilities);
    }
View Full Code Here

    /**
     * Returns the info object of the test repository.
     */
    protected RepositoryInfo getRepositoryInfo() {
        RepositoryInfo repositoryInfo = getBinding().getRepositoryService().getRepositoryInfo(getTestRepositoryId(),
                null);

        assertNotNull(repositoryInfo);
        assertNotNull(repositoryInfo.getId());
        assertEquals(getTestRepositoryId(), repositoryInfo.getId());

        return repositoryInfo;
    }
View Full Code Here

    /**
     * Returns the root folder of the test repository.
     */
    protected String getRootFolderId() {
        RepositoryInfo repository = getRepositoryInfo();

        assertNotNull(repository.getRootFolderId());

        return repository.getRootFolderId();
    }
View Full Code Here

    /**
     * Returns if the test repository supports reading ACLs.
     */
    protected boolean supportsDiscoverACLs() {
        RepositoryInfo repository = getRepositoryInfo();

        assertNotNull(repository.getCapabilities());

        return (repository.getCapabilities().getAclCapability() != CapabilityAcl.NONE);
    }
View Full Code Here

    /**
     * Returns if the test repository supports setting ACLs.
     */
    protected boolean supportsManageACLs() {
        RepositoryInfo repository = getRepositoryInfo();

        assertNotNull(repository.getCapabilities());

        return (repository.getCapabilities().getAclCapability() == CapabilityAcl.MANAGE);
    }
View Full Code Here

    /**
     * Returns if the test repository supports renditions.
     */
    protected boolean supportsRenditions() {
        RepositoryInfo repository = getRepositoryInfo();

        assertNotNull(repository.getCapabilities());

        if (repository.getCapabilities().getRenditionsCapability() == null) {
            return false;
        }

        return (repository.getCapabilities().getRenditionsCapability() != CapabilityRenditions.NONE);
    }
View Full Code Here

    /**
     * Returns if the test repository supports descendants.
     */
    protected boolean supportsDescendants() {
        RepositoryInfo repository = getRepositoryInfo();

        assertNotNull(repository.getCapabilities());

        if (repository.getCapabilities().isGetDescendantsSupported() == null) {
            return false;
        }

        return repository.getCapabilities().isGetDescendantsSupported().booleanValue();
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.RepositoryInfo

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.