File { public boolean setChecksum(int checksum) { return attribute.setChecksum(checksum); } File(final String fileName, final int fileSize);  File(final File file); protected  File(final File file, final boolean masterCopy); static boolean isValid(final String fileName); static boolean isValid(final File file); File makeReplica(); File makeMasterCopy(); FileAttribute getAttribute(); int getAttributeSize(); String getName(); final void setName(String name); boolean setOwnerName(String name); String getOwnerName(); int getSize(); int getSizeInByte(); boolean setSize(int fileSize); boolean setUpdateTime(double time); double getLastUpdateTime(); boolean setRegistrationID(int id); long getRegistrationID(); boolean setType(int type); int getType(); boolean setChecksum(int checksum); int getChecksum(); boolean setCost(double cost); double getCost(); long getCreationTime(); boolean isRegistered(); boolean isMasterCopy(); void setMasterCopy(boolean masterCopy); boolean isDeleted(); void setDeleted(boolean deleted); boolean setTransactionTime(double time); double getTransactionTime(); @Override String toString(); Datacenter getDatacenter(); final File setDatacenter(Datacenter datacenter); static final int NOT_REGISTERED; static final int TYPE_UNKNOWN; }
@Test public void testSetChecksum() { final File instance = createFile(); final int checksum1 = 1; assertTrue(instance.setChecksum(checksum1)); assertEquals(checksum1, instance.getChecksum()); final int checksum0 = 0; assertTrue(instance.setChecksum(checksum0)); assertEquals(checksum0, instance.getChecksum()); final int checksum2 = 2; assertTrue(instance.setChecksum(checksum2)); assertEquals(checksum2, instance.getChecksum()); assertFalse(instance.setChecksum(-1)); assertEquals(checksum2, instance.getChecksum()); }