Examples of SchemaManager


Examples of org.kitesdk.data.hbase.impl.SchemaManager

    HTablePool tablePool = HBaseTestUtils.startHBaseAndGetPool();

    // managed table should be created by HBaseDatasetRepository
    HBaseTestUtils.util.deleteTable(Bytes.toBytes(managedTableName));

    SchemaManager schemaManager = new DefaultSchemaManager(tablePool);
    HBaseAdmin admin = new HBaseAdmin(HBaseTestUtils.getConf());
    provider = new HBaseMetadataProvider(admin, schemaManager);
  }
View Full Code Here

Examples of org.rhq.cassandra.schema.SchemaManager

        getLog().info("Starting cluster nodes");
        ccm.startCluster();

        getLog().info("Installing RHQ schema");
        SchemaManager schemaManager = new SchemaManager(deploymentOptions.getUsername(),
            deploymentOptions.getPassword(), ccm.getNodes(), ccm.getCqlPort());

        try {
            schemaManager.install();
            schemaManager.updateTopology();
        } catch (Exception e) {
            throw new MojoExecutionException("Schema installation failed.", e);
        }

        long end = System.currentTimeMillis();
View Full Code Here

Examples of org.wso2.carbon.governance.api.schema.SchemaManager

import org.wso2.carbon.governance.api.schema.dataobjects.Schema;
import org.wso2.carbon.governance.api.test.utils.BaseTestCase;

public class SchemaTest extends BaseTestCase {
    public void testAddSchema() throws Exception {
        SchemaManager schemaManager = new SchemaManager(registry);

        Schema schema = schemaManager.newSchema("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/xsd/purchasing.xsd");
        schema.addAttribute("creator", "it is me");
        schema.addAttribute("version", "0.01");
        schemaManager.addSchema(schema);

        Schema newSchema = schemaManager.getSchema(schema.getId());
        assertEquals(schema.getSchemaElement().toString(), newSchema.getSchemaElement().toString());
        assertEquals("it is me", newSchema.getAttribute("creator"));
        assertEquals("0.01", newSchema.getAttribute("version"));

        // change the target namespace and check
        String oldSchemaPath = newSchema.getPath();
        assertEquals(oldSchemaPath, "/schemas/org/bar/purchasing/purchasing.xsd");
        assertTrue(registry.resourceExists("/schemas/org/bar/purchasing/purchasing.xsd"));

        OMElement schemaElement = newSchema.getSchemaElement();
        schemaElement.addAttribute("targetNamespace", "http://ww2.wso2.org/schema-test", null);
        schemaElement.declareNamespace("http://ww2.wso2.org/schema-test", "tns");
        schemaManager.updateSchema(newSchema);

        assertEquals("/schemas/org/wso2/ww2/schema_test/purchasing.xsd", newSchema.getPath());
        assertFalse(registry.resourceExists("/test_schemas/org/bar/purchasing.xsd"));

        // doing an update without changing anything.
        schemaManager.updateSchema(newSchema);

        assertEquals("/schemas/org/wso2/ww2/schema_test/purchasing.xsd", newSchema.getPath());
        assertEquals("0.01", newSchema.getAttribute("version"));

        newSchema = schemaManager.getSchema(schema.getId());
        assertEquals("it is me", newSchema.getAttribute("creator"));
        assertEquals("0.01", newSchema.getAttribute("version"));

        Schema[] schemas = schemaManager.findSchemas(new SchemaFilter() {
            public boolean matches(Schema schema) throws GovernanceException {
                if (schema.getAttribute("version").equals("0.01")) {
                    return true;
                }
                return false;
            }
        });
        assertEquals(1, schemas.length);
        assertEquals(newSchema.getId(), schemas[0].getId());

        // deleting the schema
        schemaManager.removeSchema(newSchema.getId());
        Schema deletedSchema = schemaManager.getSchema(newSchema.getId());
        assertNull(deletedSchema);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.