1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-07 00:04:36 +03:00

first upload code

This commit is contained in:
Federico Fissore
2013-04-05 17:05:21 +02:00
parent 6b6e9248d1
commit e6468f0387
9 changed files with 145 additions and 15 deletions

View File

@@ -0,0 +1,12 @@
package processing.app;
import org.junit.BeforeClass;
public abstract class AbstractWithPreferencesTest {
@BeforeClass
public static void setUp() throws Exception {
Base.initPlatform();
Preferences.init(null);
}
}

View File

@@ -0,0 +1,30 @@
package processing.app.debug;
import org.junit.Test;
import processing.app.AbstractWithPreferencesTest;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertTrue;
public class UploaderFactoryTest extends AbstractWithPreferencesTest {
@Test
public void shouldCreateAnInstanceOfHttpUploader() throws Exception {
Map<String, String> prefs = new HashMap<String, String>();
prefs.put("upload.tool", "http");
Uploader uploader = new UploaderFactory().newUploader(prefs);
assertTrue(uploader instanceof HttpUploader);
}
@Test
public void shouldCreateAnInstanceOfBasicUploader() throws Exception {
Map<String, String> prefs = new HashMap<String, String>();
prefs.put("upload.tool", "whatever");
Uploader uploader = new UploaderFactory().newUploader(prefs);
assertTrue(uploader instanceof BasicUploader);
}
}