use of org.syncany.plugins.dummy.DummyTransferSettings in project syncany by syncany.
the class PluginOptionsTest method nestedSettingsTest.
@Test
@Ignore
public // TODO rewrite to make this test work again with generic nested transfer settings
void nestedSettingsTest() throws Exception {
DummyTransferSettings dts = new DummyTransferSettings();
for (TransferPluginOption option : TransferPluginOptions.getOrderedOptions(DummyTransferSettings.class)) {
askNestedPluginSettings(dts, option, 0);
}
assertNotNull(dts.baz);
assertNotNull(dts.foo);
assertNotNull(dts.number);
assertNotNull(dts.subsettings);
}
use of org.syncany.plugins.dummy.DummyTransferSettings in project syncany by syncany.
the class TransferSettingsTest method testEnumSettingInvalid.
@Test(expected = StorageException.class)
public void testEnumSettingInvalid() throws Exception {
// does not exist
final String enumValue = "C";
DummyTransferSettings testTransferSettings = new DummyTransferSettings();
testTransferSettings.setField("enumField", enumValue);
}
use of org.syncany.plugins.dummy.DummyTransferSettings in project syncany by syncany.
the class TransferSettingsTest method createNewInvalidConnectionTO.
@Test
public void createNewInvalidConnectionTO() throws Exception {
TransferPlugin p = Plugins.get("dummy", TransferPlugin.class);
DummyTransferSettings ts = p.createEmptySettings();
assertFalse(ts.isValid());
}
use of org.syncany.plugins.dummy.DummyTransferSettings in project syncany by syncany.
the class TransferSettingsTest method testRestore.
@Test
public void testRestore() throws Exception {
final String fooTest = "foo-test";
final String bazTest = "baz";
final int numberTest = 1234;
final DummyTransferSettings ts = new DummyTransferSettings();
final LocalTransferSettings lts = new LocalTransferSettings();
final InitOperationOptions initOperationOptions = TestConfigUtil.createTestInitOperationOptions("syncanytest");
final ConfigTO conf = initOperationOptions.getConfigTO();
File repoDir = ((LocalTransferSettings) initOperationOptions.getConfigTO().getTransferSettings()).getPath();
File localDir = initOperationOptions.getLocalDir();
conf.setTransferSettings(ts);
ts.foo = fooTest;
ts.baz = bazTest;
ts.number = numberTest;
lts.setPath(File.createTempFile("aaa", "bbb"));
ts.subsettings = lts;
assertTrue(ts.isValid());
Serializer serializer = new Persister();
serializer.write(conf, tmpFile);
System.out.println(new String(Files.readAllBytes(Paths.get(tmpFile.toURI()))));
ConfigTO confRestored = ConfigTO.load(tmpFile);
TransferPlugin plugin = Plugins.get(confRestored.getTransferSettings().getType(), TransferPlugin.class);
assertNotNull(plugin);
TransferSettings tsRestored = confRestored.getTransferSettings();
assertNotNull(tsRestored);
DummyTransferManager transferManager = plugin.createTransferManager(tsRestored, config);
assertNotNull(transferManager);
// Tear down
FileUtils.deleteDirectory(localDir);
FileUtils.deleteDirectory(repoDir);
}
use of org.syncany.plugins.dummy.DummyTransferSettings in project syncany by syncany.
the class TransferSettingsTest method createNewValidConnectionTO.
@Test
public void createNewValidConnectionTO() throws Exception {
TransferPlugin p = Plugins.get("dummy", TransferPlugin.class);
DummyTransferSettings ts = p.createEmptySettings();
ts.foo = "foo-value";
ts.number = 5;
assertTrue(ts.isValid());
}
Aggregations