Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit 84ab97d

Browse files
author
Emmanuel Hugonnet
committed
Passing Tests on Linux
git-svn-id: https://www.silverpeas.org/svn/silverpeas/services/office-online/trunk@1158 a8e77078-a1c7-4fa5-b8fc-53c5178a176c
1 parent 344661d commit 84ab97d

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

src/test/java/com/silverpeas/openoffice/MimeTypesTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
* You should have received a copy of the GNU Affero General Public License
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
*/
24-
25-
/*
26-
* To change this template, choose Tools | Templates
27-
* and open the template in the editor.
28-
*/
2924
package com.silverpeas.openoffice;
3025

3126
import com.silverpeas.openoffice.util.MsOfficeType;

src/test/java/com/silverpeas/openoffice/linux/WhereisStubHelper.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
*/
2424

25-
/*
26-
* To change this template, choose Tools | Templates
27-
* and open the template in the editor.
28-
*/
29-
3025
package com.silverpeas.openoffice.linux;
3126

3227
/**

src/test/java/com/silverpeas/openoffice/util/UrlExtractorTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
* You should have received a copy of the GNU Affero General Public License
2222
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2323
*/
24-
25-
/*
26-
* To change this template, choose Tools | Templates
27-
* and open the template in the editor.
28-
*/
2924
package com.silverpeas.openoffice.util;
3025

3126
import junit.framework.TestCase;
@@ -36,6 +31,7 @@
3631
*/
3732
public class UrlExtractorTest extends TestCase {
3833

34+
private static final String REAL_OS = System.getProperty("os.name");
3935
public UrlExtractorTest(String testName) {
4036
super(testName);
4137
}
@@ -48,6 +44,7 @@ protected void setUp() throws Exception {
4844
@Override
4945
protected void tearDown() throws Exception {
5046
super.tearDown();
47+
System.setProperty("os.name", REAL_OS);
5148
}
5249

5350
/**

src/test/java/com/silverpeas/openoffice/windows/MsOfficeFinderTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,27 @@ protected void tearDown() throws Exception {
5151
}
5252

5353
public void testFindExcel() throws Exception {
54+
if (!System.getProperty("os.name").startsWith("Windows")) {
55+
return;
56+
}
5457
String path = helper.findSpreadsheet();
5558
assertNotNull(path);
5659
assertEquals("\"" + INSTALLED_OFFICE_PATH + "EXCEL.EXE\"", path);
5760
}
5861

5962
public void testFindPowerpoint() throws Exception {
63+
if (!System.getProperty("os.name").startsWith("Windows")) {
64+
return;
65+
}
6066
String path = helper.findPresentation();
6167
assertNotNull(path);
6268
assertEquals("\"" + INSTALLED_OFFICE_PATH + "POWERPNT.EXE\"", path);
6369
}
6470

6571
public void testFindWord() throws Exception {
72+
if (!System.getProperty("os.name").startsWith("Windows")) {
73+
return;
74+
}
6675
String path = helper.findWordEditor();
6776
assertNotNull(path);
6877
assertEquals("\"" + INSTALLED_OFFICE_PATH + "WINWORD.EXE\" /m", path);
@@ -80,6 +89,9 @@ public void testExtractPath() {
8089
}
8190

8291
public void testIsMicrosoftOffice2007() throws Exception {
92+
if (!System.getProperty("os.name").startsWith("Windows")) {
93+
return;
94+
}
8395
assertTrue(helper.isMicrosoftOffice2007());
8496
}
8597
}

src/test/java/com/silverpeas/openoffice/windows/RegistryHelperTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
package com.silverpeas.openoffice.windows;
2626

27-
import com.silverpeas.openoffice.util.OsEnum;
2827
import com.silverpeas.openoffice.util.RegistryKeyReader;
2928
import junit.framework.TestCase;
3029

@@ -52,7 +51,7 @@ protected void tearDown() throws Exception {
5251
}
5352

5453
public void testReadKey() throws Exception {
55-
if (OsEnum.getOS() != OsEnum.LINUX && OsEnum.getOS() != OsEnum.MAC_OSX) {
54+
if (!System.getProperty("os.name").startsWith("Windows")) {
5655
return;
5756
}
5857
String clockFormat = RegistryKeyReader.readKey(

0 commit comments

Comments
 (0)