This repository was archived by the owner on Sep 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +15
-17
lines changed
src/test/java/com/silverpeas/openoffice Expand file tree Collapse file tree 5 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 21
21
* You should have received a copy of the GNU Affero General Public License
22
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
23
*/
24
-
25
- /*
26
- * To change this template, choose Tools | Templates
27
- * and open the template in the editor.
28
- */
29
24
package com .silverpeas .openoffice ;
30
25
31
26
import com .silverpeas .openoffice .util .MsOfficeType ;
Original file line number Diff line number Diff line change 22
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
23
*/
24
24
25
- /*
26
- * To change this template, choose Tools | Templates
27
- * and open the template in the editor.
28
- */
29
-
30
25
package com .silverpeas .openoffice .linux ;
31
26
32
27
/**
Original file line number Diff line number Diff line change 21
21
* You should have received a copy of the GNU Affero General Public License
22
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
23
*/
24
-
25
- /*
26
- * To change this template, choose Tools | Templates
27
- * and open the template in the editor.
28
- */
29
24
package com .silverpeas .openoffice .util ;
30
25
31
26
import junit .framework .TestCase ;
36
31
*/
37
32
public class UrlExtractorTest extends TestCase {
38
33
34
+ private static final String REAL_OS = System .getProperty ("os.name" );
39
35
public UrlExtractorTest (String testName ) {
40
36
super (testName );
41
37
}
@@ -48,6 +44,7 @@ protected void setUp() throws Exception {
48
44
@ Override
49
45
protected void tearDown () throws Exception {
50
46
super .tearDown ();
47
+ System .setProperty ("os.name" , REAL_OS );
51
48
}
52
49
53
50
/**
Original file line number Diff line number Diff line change @@ -51,18 +51,27 @@ protected void tearDown() throws Exception {
51
51
}
52
52
53
53
public void testFindExcel () throws Exception {
54
+ if (!System .getProperty ("os.name" ).startsWith ("Windows" )) {
55
+ return ;
56
+ }
54
57
String path = helper .findSpreadsheet ();
55
58
assertNotNull (path );
56
59
assertEquals ("\" " + INSTALLED_OFFICE_PATH + "EXCEL.EXE\" " , path );
57
60
}
58
61
59
62
public void testFindPowerpoint () throws Exception {
63
+ if (!System .getProperty ("os.name" ).startsWith ("Windows" )) {
64
+ return ;
65
+ }
60
66
String path = helper .findPresentation ();
61
67
assertNotNull (path );
62
68
assertEquals ("\" " + INSTALLED_OFFICE_PATH + "POWERPNT.EXE\" " , path );
63
69
}
64
70
65
71
public void testFindWord () throws Exception {
72
+ if (!System .getProperty ("os.name" ).startsWith ("Windows" )) {
73
+ return ;
74
+ }
66
75
String path = helper .findWordEditor ();
67
76
assertNotNull (path );
68
77
assertEquals ("\" " + INSTALLED_OFFICE_PATH + "WINWORD.EXE\" /m" , path );
@@ -80,6 +89,9 @@ public void testExtractPath() {
80
89
}
81
90
82
91
public void testIsMicrosoftOffice2007 () throws Exception {
92
+ if (!System .getProperty ("os.name" ).startsWith ("Windows" )) {
93
+ return ;
94
+ }
83
95
assertTrue (helper .isMicrosoftOffice2007 ());
84
96
}
85
97
}
Original file line number Diff line number Diff line change 24
24
25
25
package com .silverpeas .openoffice .windows ;
26
26
27
- import com .silverpeas .openoffice .util .OsEnum ;
28
27
import com .silverpeas .openoffice .util .RegistryKeyReader ;
29
28
import junit .framework .TestCase ;
30
29
@@ -52,7 +51,7 @@ protected void tearDown() throws Exception {
52
51
}
53
52
54
53
public void testReadKey () throws Exception {
55
- if (OsEnum . getOS () != OsEnum . LINUX && OsEnum . getOS () != OsEnum . MAC_OSX ) {
54
+ if (! System . getProperty ( "os.name" ). startsWith ( "Windows" ) ) {
56
55
return ;
57
56
}
58
57
String clockFormat = RegistryKeyReader .readKey (
You can’t perform that action at this time.
0 commit comments