Search in sources :

Example 1 with Version

use of org.quiltmc.launchermeta.version.v1.Version in project java-dialogflow-cx by googleapis.

the class ITSystemTest method updateVersionTest.

@Test
public void updateVersionTest() {
    Version version = Version.newBuilder().setName(versionName).setDisplayName(DISPLAY_NAME).setState(Version.State.SUCCEEDED).build();
    FieldMask updateMask = FieldMask.newBuilder().build();
    UpdateVersionRequest versionRequest = UpdateVersionRequest.newBuilder().setVersion(version).setUpdateMask(updateMask).build();
    Version updatedVersion = versionsClient.updateVersion(versionRequest);
    assertEquals(Version.State.SUCCEEDED, updatedVersion.getState());
}
Also used : Version(com.google.cloud.dialogflow.cx.v3beta1.Version) UpdateVersionRequest(com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest) FieldMask(com.google.protobuf.FieldMask) Test(org.junit.Test)

Example 2 with Version

use of org.quiltmc.launchermeta.version.v1.Version in project java-dialogflow-cx by googleapis.

the class ITSystemTest method listVersionsTest.

@Test
public void listVersionsTest() {
    ListVersionsRequest versionsRequest = ListVersionsRequest.newBuilder().setParent(flowName).build();
    VersionsClient.ListVersionsPagedResponse pagedListResponse = versionsClient.listVersions(versionsRequest);
    List<Version> versions = Lists.newArrayList(pagedListResponse.iterateAll());
    boolean isVersionNameExists = false;
    for (Version version : versions) {
        if (version.getName().equals(versionName)) {
            assertVersionDetails(version);
            isVersionNameExists = true;
        }
    }
    assertTrue(isVersionNameExists);
}
Also used : Version(com.google.cloud.dialogflow.cx.v3beta1.Version) VersionsClient(com.google.cloud.dialogflow.cx.v3beta1.VersionsClient) ListVersionsRequest(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest) Test(org.junit.Test)

Example 3 with Version

use of org.quiltmc.launchermeta.version.v1.Version in project java-dialogflow-cx by googleapis.

the class ITSystemTest method getVersionTest.

@Test
public void getVersionTest() {
    GetVersionRequest versionRequest = GetVersionRequest.newBuilder().setName(versionName).build();
    Version version = versionsClient.getVersion(versionRequest);
    assertVersionDetails(version);
}
Also used : Version(com.google.cloud.dialogflow.cx.v3beta1.Version) GetVersionRequest(com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest) Test(org.junit.Test)

Example 4 with Version

use of org.quiltmc.launchermeta.version.v1.Version in project dcache by dCache.

the class DCapDoorInterpreterV3Tests method versionShouldMatchTo.

@Test
public void versionShouldMatchTo() {
    Version v1_2 = new Version(1, 2);
    Version v1_1 = new Version(1, 1);
    Version v2_1 = new Version(2, 1);
    Version v1_1_1 = new Version(1, 1, 1, null);
    Version v1_1_2 = new Version(1, 1, 2, null);
    Version v1_1_1_1 = new Version(1, 1, 1, "1");
    Version v1_1_1_2 = new Version(1, 1, 1, "2");
    assertThat(v1_1.matches(v1_1), is(equalTo(0)));
    assertThat(v1_2.matches(v1_2), is(equalTo(0)));
    assertThat(v2_1.matches(v2_1), is(equalTo(0)));
    assertThat(v1_1_1.matches(v1_1_1), is(equalTo(0)));
    assertThat(v1_1_2.matches(v1_1_2), is(equalTo(0)));
    assertThat(v1_1_1_1.matches(v1_1_1_1), is(equalTo(0)));
    assertThat(v1_1_1_2.matches(v1_1_1_2), is(equalTo(0)));
    assertThat(v1_1.matches(v1_1_1), is(equalTo(0)));
    assertThat(v1_1.matches(v1_1_1_1), is(equalTo(0)));
    assertThat(v1_1_1.matches(v1_1_1_1), is(equalTo(0)));
    assertThat(v1_1.matches(v1_2), is(equalTo(-1)));
    assertThat(v1_2.matches(v1_1), is(equalTo(1)));
    assertThat(v1_1.matches(v1_2), is(equalTo(-1)));
    assertThat(v2_1.matches(v1_1), is(equalTo(1)));
    assertThat(v1_2.matches(v2_1), is(equalTo(-1)));
    assertThat(v2_1.matches(v1_2), is(equalTo(1)));
    assertThat(v1_1_1.matches(v1_1), is(equalTo(1)));
    assertThat(v1_1_1.matches(v1_1_2), is(equalTo(-1)));
    assertThat(v1_1_2.matches(v1_1_1), is(equalTo(1)));
    assertThat(v1_1_1_1.matches(v1_1_1), is(equalTo(1)));
    assertThat(v1_1_1_1.matches(v1_1_1_2), is(equalTo(-1)));
    assertThat(v1_1_1_2.matches(v1_1_1_1), is(equalTo(1)));
}
Also used : Version(diskCacheV111.doors.DCapDoorInterpreterV3.Version) Test(org.junit.Test)

Example 5 with Version

use of org.quiltmc.launchermeta.version.v1.Version in project dcache by dCache.

the class DCapDoorInterpreterV3Tests method versionShouldConstructFromString.

@Test
public void versionShouldConstructFromString() {
    assertThat(new Version("1.2"), is(equalTo(new Version(1, 2))));
    assertThat(new Version("1.2.3"), is(equalTo(new Version(1, 2, 3, null))));
    assertThat(new Version("1.2.3-4"), is(equalTo(new Version(1, 2, 3, "4"))));
}
Also used : Version(diskCacheV111.doors.DCapDoorInterpreterV3.Version) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 Version (com.google.cloud.dialogflow.cx.v3beta1.Version)4 Version (diskCacheV111.doors.DCapDoorInterpreterV3.Version)3 Agent (com.google.cloud.dialogflow.cx.v3beta1.Agent)1 CreateEntityTypeRequest (com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest)1 CreateFlowRequest (com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest)1 CreateIntentRequest (com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest)1 CreatePageRequest (com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest)1 CreateTransitionRouteGroupRequest (com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest)1 CreateVersionRequest (com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest)1 EntityType (com.google.cloud.dialogflow.cx.v3beta1.EntityType)1 Flow (com.google.cloud.dialogflow.cx.v3beta1.Flow)1 GetVersionRequest (com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest)1 Intent (com.google.cloud.dialogflow.cx.v3beta1.Intent)1 ListVersionsRequest (com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest)1 Page (com.google.cloud.dialogflow.cx.v3beta1.Page)1 TransitionRouteGroup (com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup)1 UpdateVersionRequest (com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest)1 VersionsClient (com.google.cloud.dialogflow.cx.v3beta1.VersionsClient)1 FieldMask (com.google.protobuf.FieldMask)1