1 package org.apache.maven.scm.provider.integrity.command.checkin;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.scm.CommandParameter;
23 import org.apache.maven.scm.provider.integrity.command.IntegrityCommandTest;
24 import org.apache.maven.scm.provider.integrity.command.edit.IntegrityEditCommand;
25
26 import java.io.BufferedWriter;
27 import java.io.File;
28 import java.io.FileWriter;
29
30
31
32
33
34
35 public class IntegrityCheckInCommandTest
36 extends IntegrityCommandTest
37 {
38
39
40
41 public void setUp()
42 throws Exception
43 {
44 super.setUp();
45 }
46
47
48
49
50
51
52 public void testCheckInCommandTest()
53 throws Exception
54 {
55
56 IntegrityEditCommand edit = new IntegrityEditCommand();
57 edit.setLogger( logger );
58 assertResultIsSuccess( edit.execute( iRepo, fileSet, parameters ) );
59
60 String nl = System.getProperty( "line.separator" );
61 BufferedWriter bw =
62 new BufferedWriter( new FileWriter( fileSet.getBasedir() + File.separator + fileName, true ) );
63 bw.write( nl + nl + "A new change appended to file by the check-in command test" + nl );
64 bw.flush();
65 bw.close();
66
67 parameters.setString( CommandParameter.MESSAGE, "Attempting change to an existing file " + fileName );
68
69 IntegrityCheckInCommand checkin = new IntegrityCheckInCommand();
70 checkin.setLogger( logger );
71 assertResultIsSuccess( checkin.execute( iRepo, fileSet, parameters ) );
72 }
73 }
74