Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
269 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.alm.model; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
@XmlRootElement | ||
public class Attachment extends Entity | ||
{ | ||
public Attachment(Entity entity) | ||
{ | ||
super(entity); | ||
} | ||
|
||
public Attachment() | ||
{ | ||
type("attachment"); | ||
} | ||
|
||
public String description() | ||
{ | ||
return fieldValue("description"); | ||
} | ||
|
||
public void description(String value) | ||
{ | ||
fieldValue("description", value); | ||
} | ||
|
||
public String fileSize() | ||
{ | ||
return fieldValue("file-size"); | ||
} | ||
|
||
public void fileSize(String value) | ||
{ | ||
fieldValue("file-size", value); | ||
} | ||
|
||
public String refType() | ||
{ | ||
return fieldValue("ref-type"); | ||
} | ||
|
||
public void refType(String value) | ||
{ | ||
fieldValue("ref-type", value); | ||
} | ||
|
||
public String parentType() | ||
{ | ||
return fieldValue("parent-type"); | ||
} | ||
|
||
public void parentType(String value) | ||
{ | ||
fieldValue("parent-type", value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.alm.model; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
public class TestAttachment | ||
{ | ||
Attachment attachment; | ||
|
||
@BeforeMethod | ||
public void initAttachmentEntity() | ||
{ | ||
attachment = new Attachment(); | ||
} | ||
|
||
@Test(groups = { "attachment" }) | ||
public void type() | ||
{ | ||
Assert.assertEquals(attachment.type(), "attachment"); | ||
} | ||
|
||
@Test(groups = { "attachment" }) | ||
public void description() | ||
{ | ||
attachment.description("raw results"); | ||
|
||
Assert.assertEquals(attachment.description(), "raw results"); | ||
} | ||
|
||
@Test(groups = { "attachment" }) | ||
public void fileSize() | ||
{ | ||
attachment.fileSize("412"); | ||
|
||
Assert.assertEquals(attachment.fileSize(), "412"); | ||
} | ||
|
||
@Test(groups = { "attachment" }) | ||
public void refType() | ||
{ | ||
attachment.refType("File"); | ||
|
||
Assert.assertEquals(attachment.refType(), "File"); | ||
} | ||
|
||
@Test(groups = { "attachment" }) | ||
public void parentType() | ||
{ | ||
attachment.parentType("defect"); | ||
|
||
Assert.assertEquals(attachment.parentType(), "defect"); | ||
} | ||
} |