Package io.lumify.web.clientapi

Examples of io.lumify.web.clientapi.LumifyApi.logout()


    private void assertUser3HasAccessWithAuth1Visibility() throws ApiException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_3);
        addUserAuth(lumifyApi, USERNAME_TEST_USER_3, "auth1");
        assertArtifactCorrect(lumifyApi, false, "auth1");
        lumifyApi.logout();
    }

    public void assertArtifactCorrect(LumifyApi lumifyApi, boolean hasWorkspaceIdInVisibilityJson, String expectedVisibilitySource) throws ApiException {
        ClientApiElement artifactVertex = lumifyApi.getVertexApi().getByVertexId(artifactVertexId);
        assertNotNull("could not get vertex: " + artifactVertexId, artifactVertex);
View Full Code Here


        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);

        byte[] found = IOUtils.toByteArray(lumifyApi.getVertexApi().getRaw(artifactVertexId));
        assertArrayEquals(expected, found);

        lumifyApi.logout();
    }

    private void alterVisibilityOfArtifactToAuth2() throws ApiException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
View Full Code Here

        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);

        lumifyApi.getVertexApi().setVisibility(artifactVertexId, "auth2");
        assertArtifactCorrect(lumifyApi, false, "auth2");

        lumifyApi.logout();
    }

    private void assertUser2DoesNotHaveAccessToAuth2() throws ApiException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_2);
View Full Code Here

    private void assertUser2DoesNotHaveAccessToAuth2() throws ApiException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_2);

        lumifyApi.getVertexApi().getByVertexId(artifactVertexId);

        lumifyApi.logout();
    }

    private void testGeoSearch() throws ApiException, JsonProcessingException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
View Full Code Here

        lumifyApi.getVertexApi().setProperty(artifactVertexId, "", TestOntology.GEO_LOCATION.getPropertyName(), geoPoint, "", "justification", null, null);

        ClientApiVertexSearchResponse geoSearchResults = lumifyApi.getVertexApi().vertexGeoSearch(38.8951, -77.0367, 1000.0);
        assertEquals(1, geoSearchResults.getVertices().size());

        lumifyApi.logout();
    }

    private void testSetTitleAndCheckConfidence() throws ApiException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
View Full Code Here

                assertEquals(GraphUtil.SET_PROPERTY_CONFIDENCE, LumifyProperties.CONFIDENCE.getMetadataValue(prop.getMetadata()), 0.01);
            }
        }
        assertTrue("Could not find new title", foundNewTitle);

        lumifyApi.logout();
        lumifyApi.setWorkspaceId(workspaceId);
    }
}
View Full Code Here

        for (ClientApiProperty property : properties) {
            assertEquals(SandboxStatus.PUBLIC, property.getSandboxStatus());
        }

        lumifyApi.logout();
    }

    private void addPropertyWithPublicChangeSandboxStatus() throws ApiException, IOException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
        ClientApiElement susanFengVertex = lumifyApi.getVertexApi().setProperty(susanFengVertexId, "key1", NAME_PROPERTY_IRI, "Tom", "A", "test", null, null);
View Full Code Here

        List<ClientApiProperty> key2Properties = getProperties(susanFengVertex.getProperties(), "key2", NAME_PROPERTY_IRI);
        assertEquals("Bob", key2Properties.get(0).getValue());
        assertEquals(SandboxStatus.PUBLIC, key2Properties.get(0).getSandboxStatus());
        assertEquals("Sam", key2Properties.get(1).getValue());
        assertEquals(SandboxStatus.PUBLIC, key2Properties.get(1).getSandboxStatus());
        lumifyApi.logout();
    }

    private void addPropertyWithPrivateSandboxStatus() throws ApiException, IOException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
        lumifyApi.getVertexApi().setProperty(susanFengVertexId, "key2", NAME_PROPERTY_IRI, "Dave", "C", "test", null, null);
View Full Code Here

        List<ClientApiProperty> key3Properties = getProperties(susanFengVertex.getProperties(), "key3", NAME_PROPERTY_IRI);
        assertEquals(1, key3Properties.size());
        assertEquals("Susan", key3Properties.get(0).getValue());
        assertEquals(SandboxStatus.PRIVATE, key3Properties.get(0).getSandboxStatus());
        lumifyApi.logout();
    }

    private void assertAllPropertiesArePublic() throws ApiException, IOException {
        LumifyApi lumifyApi = login(USERNAME_TEST_USER_1);
        assertPublishAll(lumifyApi, 3);
View Full Code Here

        List<ClientApiProperty> key3Properties = getProperties(susanFengVertex.getProperties(), "key3", NAME_PROPERTY_IRI);
        assertEquals(1, key3Properties.size());
        assertHasProperty(key3Properties, "key3", NAME_PROPERTY_IRI, "Susan");
        ClientApiProperty key3Property = key3Properties.get(0);
        checkVisibility(key3Property, visibilityJsonNoSource);
        lumifyApi.logout();
    }

    private void checkVisibility(ClientApiProperty property, VisibilityJson expectedVisibilityJson) {
        try {
            String visibilityJson = ObjectMapperFactory.getInstance().writeValueAsString(property.getMetadata().get(LumifyProperties.VISIBILITY_JSON.getPropertyName()));
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.