Package org.thechiselgroup.choosel.core.client.resources

Examples of org.thechiselgroup.choosel.core.client.resources.DefaultResourceSet


    private DefaultResourceModelPresenter underTest;

    @Test
    public void addingUnlabeledSetDoesNotChangeOriginalSetsPresenter() {
        Resource resource = ResourceSetTestUtils.createResource(1);
        DefaultResourceSet resources = new DefaultResourceSet();
        resources.add(resource);

        resourceModel.addResourceSet(resources);

        verify(inputResourceSetsPresenter, never()).addResourceSet(resources);
    }
View Full Code Here


    }

    @Test
    public void doNotCallOriginalSetsPresenterOnAddingUnlabeledResources() {
        Resource resource = ResourceSetTestUtils.createResource(1);
        DefaultResourceSet resources = new DefaultResourceSet();
        resources.add(resource);

        resourceModel.addResourceSet(resources);

        verify(inputResourceSetsPresenter, never()).addResourceSet(
                any(ResourceSet.class));
View Full Code Here

        slotMappingInitializer = new TestSlotMappingInitializer(
                initialSlotMapping);

        DefaultVisualizationModel model = createViewModel(new ResourceByUriMultiCategorizer());

        model.setContentResourceSet(new DefaultResourceSet());

        Resource resource1 = ResourceSetTestUtils.createResource(1);
        resource1.putValue(property1, 1);
        resource1.putValue(property2, 2);
View Full Code Here

            throws ParseException {
        assert table != null;

        String uriType = uriHeaderProvider.nextLabel();

        ResourceSet resources = new DefaultResourceSet();
        resources.setLabel(label); // TODO changeable, inc number

        if (table.getRowCount() == 0) {
            return resources;
        }

        // use first row to determine types
        DataType[] columnTypes = determineColumnTypes(table);

        for (int row = 0; row < table.getRowCount(); row++) {
            resources.add(createResourceFromRow(table, columnTypes, row,
                    uriType));
        }

        return resources;
    }
View Full Code Here

    private DefaultVisualizationModel createViewModel(
            ResourceMultiCategorizer categorizer) {

        DefaultVisualizationModel model = new DefaultVisualizationModel(
                helper.getViewContentDisplay(), new DefaultResourceSet(),
                new DefaultResourceSet(), visualItemBehavior, errorHandler,
                new DefaultResourceSetFactory(), categorizer);
        new DefaultManagedSlotMappingConfiguration(resolverProvider,
                slotMappingInitializer, model, model);
        return model;
    }
View Full Code Here

        slotMappingInitializer = new TestSlotMappingInitializer(
                initialSlotMapping);

        DefaultVisualizationModel model = createViewModel(new ResourceByUriMultiCategorizer());

        model.setContentResourceSet(new DefaultResourceSet());
        Resource resource1 = ResourceSetTestUtils.createResource(1);
        resource1.putValue(property1, 1);
        resource1.putValue(property2, 2);

        model.getContentResourceSet().add(resource1);
        /* Should have 1 View Item with Value 1 */
        model.setContentResourceSet(new DefaultResourceSet());

        assertEquals(resolver, model.getResolver(requiredSlots[0]));
    }
View Full Code Here

        resource.putValue(property2, 2);

        model.getContentResourceSet().add(resource);

        /* Should have 1 View Item with Value 1 */
        model.setContentResourceSet(new DefaultResourceSet());

        assertEquals(
                model.getFullVisualItemContainer().getVisualItems().size(), 0);
    }
View Full Code Here

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);

        numberSlot = new Slot("id-2", "number-slot", DataType.NUMBER);
        resources = new DefaultResourceSet();
        underTest = spy(new DefaultVisualItem(VIEW_ITEM_ID, resources,
                resolverContext, mock(VisualItemInteractionHandler.class)));

        when(resolverContext.getResolver(numberSlot)).thenReturn(resolver);
    }
View Full Code Here

        /*
         * XXX shouldn't this is use method in ResourceSetUtils that calculates
         * the properties that are valid accross all visual items or is this the
         * same?
         */
        ResourceSet resources = new DefaultResourceSet();
        for (VisualItem visualItem : visualItems) {
            resources.addAll(visualItem.getResources());
        }
        return ResourceSetUtils.getProperties(resources, dataType);
    }
View Full Code Here

    private DefaultVisualizationModelTestHelper helper;

    @Test
    public void addResourcesToInitialContentCreatesVisualItems() {
        DefaultVisualizationModel model = new DefaultVisualizationModel(
                helper.getViewContentDisplay(), new DefaultResourceSet(),
                new DefaultResourceSet(), new CompositeVisualItemBehavior(),
                mock(ErrorHandler.class), new DefaultResourceSetFactory(),
                new ResourceByUriMultiCategorizer());

        Resource r1 = createResource(1);
        r1.putValue(TEXT_PROPERTY_1, "value1-1");
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.resources.DefaultResourceSet

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.