Added
Link Here
|
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2009 Standards for Technology in Automotive Retail and others. |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
8 |
* Contributors: |
9 |
* David Carver (STAR) - bug 264788 - initial API and implementation |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.wst.xsl.core.internal.utils.tests; |
12 |
|
13 |
import org.eclipse.wst.xsl.core.internal.util.XMLContentType; |
14 |
|
15 |
import junit.framework.TestCase; |
16 |
|
17 |
public class TestXMLContentType extends TestCase { |
18 |
|
19 |
public TestXMLContentType() { |
20 |
super(); |
21 |
} |
22 |
|
23 |
public void testGetFileExtensions() { |
24 |
XMLContentType xmlContentType = new XMLContentType(); |
25 |
String[] exts = xmlContentType.getFileExtensions(); |
26 |
assertTrue("Missing xslt extension.", findExtension("xslt", exts)); |
27 |
assertTrue("Missing xml extension.", findExtension("xml", exts)); |
28 |
assertTrue("Missing xsl extension.", findExtension("xsl", exts)); |
29 |
assertTrue("Missing fragx extension.", findExtension("fragx", exts)); |
30 |
|
31 |
} |
32 |
|
33 |
private boolean findExtension(String extension, String[] exts) { |
34 |
boolean foundsw = false; |
35 |
for (int i = 0; i < exts.length; i++) { |
36 |
if (extension.equalsIgnoreCase(exts[i])) { |
37 |
foundsw = true; |
38 |
} |
39 |
} |
40 |
return foundsw; |
41 |
} |
42 |
|
43 |
} |