Package org.kie.workbench.common.services.datamodel.oracle

Examples of org.kie.workbench.common.services.datamodel.oracle.ProjectDataModelOracle


    @Test
    @SuppressWarnings("serial")
    public void testNumeric() {
        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        final ProjectDataModelOracle pd = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
                .addFact( "Driver" )
                .addField( new ModelField( "age",
                                           Integer.class.getName(),
                                           ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                           FieldAccessorsAndMutators.BOTH,
View Full Code Here


    @Test
    @SuppressWarnings("serial")
    public void testGetType() {
        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        final ProjectDataModelOracle pd = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
                .addFact( "Driver" )
                .addField( new ModelField( "age",
                                           Integer.class.getName(),
                                           ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                           FieldAccessorsAndMutators.BOTH,
View Full Code Here

    @SuppressWarnings("serial")
    @Test
    public void testNoConstraints() {
        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        final ProjectDataModelOracle pd = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
                .addFact( "Driver" )
                .addField( new ModelField( "age",
                                           Integer.class.getName(),
                                           ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                           FieldAccessorsAndMutators.BOTH,
View Full Code Here

    @SuppressWarnings("serial")
    @Test
    public void testConditionPredicateChoices() {
        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        final ProjectDataModelOracle pd = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
                .addFact( "Driver" )
                .addField( new ModelField( "age",
                                           Integer.class.getName(),
                                           ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                           FieldAccessorsAndMutators.BOTH,
View Full Code Here

    @SuppressWarnings("serial")
    @Test
    public void testConditionFormulaChoices() {
        final GuidedDecisionTable52 dt = new GuidedDecisionTable52();
        final ProjectDataModelOracle pd = ProjectDataModelOracleBuilder.newProjectOracleBuilder()
                .addFact( "Driver" )
                .addField( new ModelField( "age",
                                           Integer.class.getName(),
                                           ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                           FieldAccessorsAndMutators.BOTH,
View Full Code Here

            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(paths.convert(projectPath)));

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(paths.convert(projectPath));

            String annotationTest = "org.kie.test.AnnotationsBean";
            String annotationTestSerializable = "org.kie.test.AnnotationsBeanSerializable";

            boolean isTestLoaded = false;
            boolean isTestSerializableLoaded = false;

            String types[] = projectDataModelOracle.getFactTypes();
            if (types != null) {
                for (int i = 0; i < types.length; i++) {
                    logger.info("**************************** -> Loading type: " + types[i]);
                    if (annotationTest.equals(types[i])) isTestLoaded = true;
                    if (annotationTestSerializable.equals(types[i])) isTestSerializableLoaded = true;
View Full Code Here

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);
            String types[] = projectDataModelOracle.getFactTypes();
            if (types != null) {
                for (String type : types) {
                    if ((objectPackage + "." + objectName).equals(type)) {
                        // Check type annotations
                        Set<Annotation> annotations = projectDataModelOracle.getTypeAnnotations(type);
                        assertNotNull(annotations);
                        assertEquals("Type " + type + " should hold 3 annotations: ", 3, annotations.size());
                        checkAnnotation(annotations, AnnotationDefinitionTO.LABEL_ANNOTATION, objectLabelValue);
                        checkAnnotation(annotations, AnnotationDefinitionTO.DESCRIPTION_ANNOTATION, objectDescriptionValue);
                        checkAnnotation(annotations, AnnotationDefinitionTO.ROLE_ANNOTATION, objectRoleValue);

                        // Check type field annotations
                        ModelField[] fields = projectDataModelOracle.getModelFields().get(type);
                        assertNotNull(fields);
                        assertEquals("Error in type " + type + "'s fields: ", 2, fields.length);
                        Map<String, Set<Annotation>> mFieldAnnotations = projectDataModelOracle.getTypeFieldsAnnotations(type);
                        assertNotNull(mFieldAnnotations);
                        Set fieldAnnotations = mFieldAnnotations.get(fieldName);
                        assertNotNull(fieldAnnotations);
                        assertEquals("Field " + fieldName + "should have 3 annotations: ", 3, fieldAnnotations.size());
                        checkAnnotation(fieldAnnotations, AnnotationDefinitionTO.LABEL_ANNOTATION, fieldLabelValue);
View Full Code Here

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);

            // TODO for the ProjectDataModelOracle, in fact, the getModelFields() method should only return the declared
            // TODO fields per fact type, i.e. similar to getClass().getDeclaredFields(), which may including @this
            Map<String, ModelField[]> modelFields = projectDataModelOracle.getModelFields();
            if (modelFields != null) {
                String inheritorFullName = extendingPackage + "." + extendingName;
                ModelField[] fields = modelFields.get(inheritorFullName);

                assertNotNull(fields);
View Full Code Here

TOP

Related Classes of org.kie.workbench.common.services.datamodel.oracle.ProjectDataModelOracle

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.