Exemplo n.º 1
0
  @Test
  public void testSetGetArtifactAction() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    classUnderTest.setArtifactAction(ArtifactAction.INSTALL);
    assertEquals(ArtifactAction.INSTALL, classUnderTest.getArtifactAction());
  }
Exemplo n.º 2
0
  @Test
  public void testSetGetDisplayType() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    classUnderTest.setDisplayType(coreType);
    assertEquals(coreType, classUnderTest.getDisplayType());
  }
Exemplo n.º 3
0
  @Test
  public void testToString() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    assertNotNull(classUnderTest.toString());
    assertTrue(classUnderTest.toString().length() > 0);
  }
Exemplo n.º 4
0
  @Test
  public void testSetGetChecksum() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    assertEquals(coreChecksum, classUnderTest.getChecksum());
    classUnderTest.setChecksum(2);
    assertEquals(2, classUnderTest.getChecksum());
  }
Exemplo n.º 5
0
  @Test
  public void testSetGetInstalled() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    assertEquals(coreIsInstalled, classUnderTest.isInstalled());
    classUnderTest.setInstalled(false);
    assertFalse(classUnderTest.isInstalled());
  }
Exemplo n.º 6
0
  @Test
  public void testIsTranslationArtifact() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockTranslationArtifactXmlBean);
    mockHelper.verifyAll();

    assertTrue(classUnderTest.isTranslationArtifact());
    assertFalse(classUnderTest.isPluginArtifact());
    assertFalse(classUnderTest.isCoreArtifact());
  }
Exemplo n.º 7
0
  @Test
  public void testSetGetType() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    assertEquals(UpdateUtil.CORE_ARTIFACT_ID, classUnderTest.getType());
    classUnderTest.setType(UpdateUtil.PLUGIN_ARTIFACT_ID);
    assertEquals(UpdateUtil.PLUGIN_ARTIFACT_ID, classUnderTest.getType());
  }
Exemplo n.º 8
0
  @Test
  public void testArtifactStatusArtifactXmlBean() {
    mockHelper.replayAll();
    classUnderTest = new ArtifactStatus(mockCoreArtifactXmlBean);
    mockHelper.verifyAll();

    assertEquals(coreArtifactName, classUnderTest.getName());
    assertEquals(coreIsInstalled, classUnderTest.isInstalled());
    assertEquals(this.coreSize, classUnderTest.getSize());
    assertEquals(coreChecksum, classUnderTest.getChecksum());
  }
Exemplo n.º 9
0
  @Test
  public void testEqualsAndHashCode() {
    mockHelper.replayAll();
    final ArtifactStatus a = new ArtifactStatus(mockCoreArtifactXmlBean); // original object
    final ArtifactStatus b =
        new ArtifactStatus(mockCoreArtifactXmlBean); // another object that has the
    // same values as the original
    final ArtifactStatus c =
        new ArtifactStatus(mockPluginArtifactXmlBean); // another object with different
    // values
    final ArtifactStatus d =
        new ArtifactStatus(mockCoreArtifactXmlBean) {
          private static final long serialVersionUID = 1L;
        }; // a subclass of Foo with the same values as the original
    new EqualsTester(a, b, c, d);
    mockHelper.verifyAll();

    a.setName(null);
    b.setName(null);
    d.setName(null);
    new EqualsTester(a, b, c, d);

    // different only by type - same name
    a.setName(coreArtifactName);
    b.setName(coreArtifactName);
    c.setName(coreArtifactName);
    a.setType(null);
    b.setType(null);
    d.setType(null);
    new EqualsTester(a, b, c, d);

    a.setType(coreType);
    b.setType(coreType);
    c.setType(null);
    d.setType(coreType);
    new EqualsTester(a, b, c, d);

    a.setType(null);
    b.setType(null);
    c.setType(pluginType);
    d.setType(null);
    new EqualsTester(a, b, c, d);
  }