Skip to content
Snippets Groups Projects
Commit a0b32b1f authored by cramakri's avatar cramakri
Browse files

LMS-1503 Refatoring + added test.

SVN: 16186
parent 99904a8b
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,9 @@ package ch.systemsx.cisd.openbis.dss.generic.shared.api.v1;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* Represents information about a file stored in DSS.
*
......@@ -80,12 +83,9 @@ public class FileInfoDssDTO implements Serializable
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("FileInfoDss[");
ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
sb.append(getPathInDataSet());
sb.append(",");
sb.append(getFileSize());
sb.append("]");
return sb.toString();
}
}
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.dss.generic.shared.api.v1;
import org.testng.AssertJUnit;
import org.testng.annotations.Test;
/**
* @author Chandrasekhar Ramakrishnan
*/
public class FileInfoDssDTOTest extends AssertJUnit
{
@Test
public void testToString()
{
FileInfoDssDTO fi = new FileInfoDssDTO("path/in/data/set", "path/in/listing", false, 800);
assertEquals("FileInfoDssDTO[path/in/data/set,800]", fi.toString());
fi = new FileInfoDssDTO("path/in/data/set", "path/in/listing", true, -1);
assertEquals("FileInfoDssDTO[path/in/data/set,-1]", fi.toString());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment