You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ep...@apache.org on 2004/02/14 17:18:00 UTC
cvs commit: jakarta-turbine-fulcrum/mimetype/impl/src/java/org/apache/fulcrum/mimetype DefaultMimeTypeService.java
epugh 2004/02/14 08:18:00
Modified: mimetype/impl/src/test/org/apache/fulcrum/mimetype
MimetypeTest.java
mimetype/impl/src/java/org/apache/fulcrum/mimetype
DefaultMimeTypeService.java
Log:
Update to work with latest Merlin Unit test
Revision Changes Path
1.2 +4 -29 jakarta-turbine-fulcrum/mimetype/impl/src/test/org/apache/fulcrum/mimetype/MimetypeTest.java
Index: MimetypeTest.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/mimetype/impl/src/test/org/apache/fulcrum/mimetype/MimetypeTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MimetypeTest.java 13 Nov 2003 20:28:29 -0000 1.1
+++ MimetypeTest.java 14 Feb 2004 16:18:00 -0000 1.2
@@ -55,9 +55,7 @@
// Cactus and Junit imports
import java.io.File;
import java.util.Locale;
-import junit.awtui.TestRunner;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+
import org.apache.avalon.merlin.unit.AbstractMerlinTestCase;
import org.apache.fulcrum.mimetype.util.MimeType;
@@ -83,36 +81,16 @@
{
super(name);
}
- /**
- * Start the tests.
- *
- * @param args the arguments. Not used
- */
- public static void main(String args[])
- {
- TestRunner.main(new String[] { MimetypeTest.class.getName()});
- }
- /**
- * Creates the test suite.
- *
- * @return a test suite (<code>TestSuite</code>) that includes all methods
- * starting with "test"
- */
- public static Test suite()
- {
- // All methods starting with "test" will be executed in the test suite.
- return new TestSuite(MimetypeTest.class);
- }
+
public void setUp() throws Exception
{
super.setUp();
try
{
- mimeTypeService = (MimeTypeService) this.resolve( "mimetype" );
+ mimeTypeService = (MimeTypeService) this.resolve( "/test/mimetype" );
}
catch (Throwable e)
{
- getLogger().error( "Setup failure.", e );
fail(e.getMessage());
}
}
@@ -121,7 +99,6 @@
Locale locale = new Locale("en", "US");
String s = mimeTypeService.getCharSet(locale);
assertEquals("ISO-8859-1", s);
- getLogger().info( "OK" );
}
public void testSetGetContentType() throws Exception
{
@@ -133,7 +110,6 @@
assertEquals(mimeType, mimeTypeService.getContentType(files[0]));
assertEquals(mimeType, mimeTypeService.getContentType(files[1]));
assertEquals(mimeType, mimeTypeService.getContentType(files[2]));
- getLogger().info( "OK" );
}
public void testGetDefaultExtension() throws Exception
{
@@ -143,6 +119,5 @@
MimeType mt = new MimeType(mimeType);
result = mimeTypeService.getDefaultExtension(mt);
assertEquals("crazy", result);
- getLogger().info( "OK" );
}
}
1.2 +3 -3 jakarta-turbine-fulcrum/mimetype/impl/src/java/org/apache/fulcrum/mimetype/DefaultMimeTypeService.java
Index: DefaultMimeTypeService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-fulcrum/mimetype/impl/src/java/org/apache/fulcrum/mimetype/DefaultMimeTypeService.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultMimeTypeService.java 13 Nov 2003 20:28:29 -0000 1.1
+++ DefaultMimeTypeService.java 14 Feb 2004 16:18:00 -0000 1.2
@@ -55,10 +55,10 @@
import java.io.File;
import java.io.IOException;
import java.util.Locale;
+
import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.context.Contextualizable;
@@ -299,7 +299,7 @@
/**
* Avalon component lifecycle method
*/
- public void configure(Configuration conf) throws ConfigurationException
+ public void configure(Configuration conf)
{
mimetypePath = conf.getAttribute(MIME_TYPES, null);
charsetPath = conf.getAttribute(CHARSETS, null);
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org