Revision 37599 branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/java/org/gvsig/installer/lib/impl/info/InstallerInfoFileWriterTest.java

View differences:

InstallerInfoFileWriterTest.java
40 40
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
41 41
 */
42 42
public class InstallerInfoFileWriterTest extends
43
    AbstractLibraryAutoInitTestCase {
43
		AbstractLibraryAutoInitTestCase {
44 44

  
45
    @Override
46
    protected void doSetUp() throws Exception {
47
        // TODO Auto-generated method stub
45
	@Override
46
	protected void doSetUp() throws Exception {
47
		// TODO Auto-generated method stub
48 48

  
49
    }
49
	}
50 50

  
51
    public void testWriteFile() throws LocatorException,
52
        InstallerInfoFileException {
53
        DefaultPackageInfo installerInfo = new DefaultPackageInfo();
51
	public void testWriteFile() throws LocatorException,
52
			InstallerInfoFileException {
53
		DefaultPackageInfo installerInfo = new DefaultPackageInfo();
54 54

  
55
        installerInfo.setCode("org.gvsig.myplugin");
56
        installerInfo.setName("My name");
57
        installerInfo.setDescription("My description");
58
        installerInfo.setVersion("1.0.0");
59
        installerInfo.setBuild(4);
60
        installerInfo.setState("final");
61
        installerInfo.setOfficial(false);
62
        installerInfo.setType("plugin");
55
		installerInfo.setCode("org.gvsig.myplugin");
56
		installerInfo.setName("My name");
57
		installerInfo.setDescription("My description");
58
		installerInfo.setVersion("1.0.0");
59
		installerInfo.setBuild(4);
60
		installerInfo.setState("final");
61
		installerInfo.setOfficial(false);
62
		installerInfo.setType("plugin");
63 63

  
64
        ByteArrayOutputStream out = new ByteArrayOutputStream();
64
		ByteArrayOutputStream out = new ByteArrayOutputStream();
65 65

  
66
        InstallerInfoFileWriter installerInfoFileWriter =
67
            new InstallerInfoFileWriter();
68
        installerInfoFileWriter.write(installerInfo, out);
66
		InstallerInfoFileWriter installerInfoFileWriter = new InstallerInfoFileWriter();
67
		installerInfoFileWriter.write(installerInfo, out);
69 68

  
70
        PackageInfo installerInfo2 = new DefaultPackageInfo();
69
		PackageInfo installerInfo2 = new DefaultPackageInfo();
71 70

  
72
        InstallerInfoFileReader installerInfoFileReader =
73
            new InstallerInfoFileReader();
74
        installerInfoFileReader.read(installerInfo2, new ByteArrayInputStream(
75
            out.toByteArray()));
71
		InstallerInfoFileReader installerInfoFileReader = new InstallerInfoFileReader();
72
		installerInfoFileReader.read(installerInfo2, new ByteArrayInputStream(
73
				out.toByteArray()));
76 74

  
77
        assertEquals("org.gvsig.myplugin", installerInfo2.getCode());
78
        assertEquals("My name", installerInfo2.getName());
79
        assertEquals("My description", installerInfo2.getDescription());
80
        assertEquals("1.0.0", installerInfo2.getVersion());
81
        assertEquals(4, installerInfo2.getBuild());
82
        assertEquals("final", installerInfo2.getState());
83
        assertEquals(false, installerInfo2.isOfficial());
84
    }
75
		assertEquals("org.gvsig.myplugin", installerInfo2.getCode());
76
		assertEquals("My name", installerInfo2.getName());
77
		assertEquals("My description", installerInfo2.getDescription());
78
		assertEquals("1.0.0", installerInfo2.getVersion());
79
		assertEquals(4, installerInfo2.getBuild());
80
		assertEquals("final", installerInfo2.getState());
81
		assertEquals(false, installerInfo2.isOfficial());
82
	}
85 83
}

Also available in: Unified diff