Examples of EntityId


Examples of org.sonatype.nexus.component.model.EntityId

  @Test(expected = IllegalStateException.class)
  public void readNonExistingComponent() {
    registerTestAdapters();

    componentStore.readComponent(TestComponent.class, new EntityId("bogusId"));
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test(expected = IllegalStateException.class)
  public void readNonExistingAsset() {
    registerTestAdapters();

    componentStore.readAsset(TestAsset.class, new EntityId("bogusId"));
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void readComponent() {
    registerTestAdapters();

    TestComponent sourceComponent = testComponent(TEST_STRING_1, true);
    EntityId componentId = componentStore.createComponent(sourceComponent).getId();

    TestComponent storedComponent = componentStore.readComponent(TestComponent.class, componentId);

    checkComponent(storedComponent, sourceComponent);
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void readAsset() {
    registerTestAdapters();

    EntityId componentId = componentStore.createComponent(testComponent()).getId();
    EntityId assetId = componentStore.createAsset(componentId, testAsset(1)).getId();

    TestAsset storedAsset = componentStore.readAsset(TestAsset.class, assetId);

    checkAsset(storedAsset, componentId, 1);
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test(expected = IllegalStateException.class)
  public void updateNonExistingComponent() {
    registerTestAdapters();

    componentStore.updateComponent(new EntityId("bogusId"), testComponent());
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test(expected = IllegalStateException.class)
  public void updateNonExistingAsset() {
    registerTestAdapters();

    componentStore.updateAsset(new EntityId("bogusId"), testAsset(1));
  }
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void updateComponent() {
    registerTestAdapters();

    EntityId componentId = componentStore.createComponent(testComponent()).getId();

    TestComponent sourceComponent = testComponent();
    sourceComponent.setStringProp(TEST_STRING_2);
    TestComponent updatedComponent = componentStore.updateComponent(componentId, sourceComponent);
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void updateAsset() throws Exception {
    registerTestAdapters();

    EntityId componentId = componentStore.createComponent(testComponent()).getId();
    EntityId assetId = componentStore.createAsset(componentId, testAsset(1)).getId();

    TestAsset sourceAsset = testAsset(2);
    Thread.sleep(1000); // ensure different modified date
    TestAsset updatedAsset = componentStore.updateAsset(assetId, sourceAsset);
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void updateAssetWithoutModifyingStream() throws IOException {
    registerTestAdapters();

    EntityId componentId = componentStore.createComponent(testComponent()).getId();
    EntityId assetId = componentStore.createAsset(componentId, testAsset(1)).getId();

    TestAsset sourceAsset = testAsset(2);
    sourceAsset.setStreamSupplier(null);
    TestAsset updatedAsset = componentStore.updateAsset(assetId, sourceAsset);
View Full Code Here

Examples of org.sonatype.nexus.component.model.EntityId

  @Test
  public void deleteNonExistingComponent() {
    registerTestAdapters();

    assertThat(componentStore.deleteComponent(TestComponent.class, new EntityId("bogusId")), is(false));
  }
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.