1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-06 13:11:08 +01:00

Add OMEMO support

This commit adds the modules smack-omemo and smack-omemo-signal.
smack-omemo is licensed under the Apache license like the rest of the smack project.
smack-omemo-signal on the other hand is licensed under the GPLv3.
Due to the fact, that smack-omemo is not of much use without smack-omemo-signal,
the OMEMO feature can currently only be used by GPLv3 compatible software.
This may change in the future, when a more permissively licensed module becomes available.

Fixes SMACK-743.
This commit is contained in:
vanitasvitae 2017-06-02 12:26:37 +02:00 committed by Florian Schmaus
parent ce36fb468c
commit e86700b040
95 changed files with 11770 additions and 22 deletions

View file

@ -196,10 +196,14 @@ public final class Configuration {
return addTestPackage(enabledTest.getPackage().getName());
}
public Builder addTestPackage(String testPackage) {
private void ensureTestPackagesIsSet(int length) {
if (testPackages == null) {
testPackages = new HashSet<>();
testPackages = new HashSet<>(length);
}
}
public Builder addTestPackage(String testPackage) {
ensureTestPackagesIsSet(4);
testPackages.add(testPackage);
return this;
}
@ -260,10 +264,12 @@ public final class Configuration {
return this;
}
public Builder setTestPackages(String testPackagesString) {
public Builder addTestPackages(String testPackagesString) {
if (testPackagesString != null) {
String[] testPackagesArray = testPackagesString.split(",");
testPackages = new HashSet<>(testPackagesArray.length);
ensureTestPackagesIsSet(testPackagesArray.length);
for (String s : testPackagesArray) {
testPackages.add(s.trim());
}
@ -271,6 +277,19 @@ public final class Configuration {
return this;
}
public Builder addTestPackages(String[] testPackagesString) {
if (testPackagesString == null) {
return this;
}
ensureTestPackagesIsSet(testPackagesString.length);
for (String testPackage : testPackagesString) {
testPackages.add(testPackage);
}
return this;
}
public Configuration build() throws KeyManagementException, NoSuchAlgorithmException {
return new Configuration(service, serviceTlsPin, securityMode, replyTimeout, debug, accountOneUsername,
accountOnePassword, accountTwoUsername, accountTwoPassword, accountThreeUsername, accountThreePassword, enabledTests, disabledTests,
@ -280,7 +299,7 @@ public final class Configuration {
private static final String SINTTEST = "sinttest.";
public static Configuration newConfiguration()
public static Configuration newConfiguration(String[] testPackages)
throws IOException, KeyManagementException, NoSuchAlgorithmException {
Properties properties = new Properties();
@ -330,7 +349,9 @@ public final class Configuration {
builder.setDebug(properties.getProperty("debug"));
builder.setEnabledTests(properties.getProperty("enabledTests"));
builder.setDisabledTests(properties.getProperty("disabledTests"));
builder.setTestPackages(properties.getProperty("testPackages"));
builder.addTestPackages(properties.getProperty("testPackages"));
builder.addTestPackages(testPackages);
return builder.build();
}

View file

@ -78,7 +78,7 @@ public class SmackIntegrationTestFramework {
public static void main(String[] args) throws IOException, KeyManagementException,
NoSuchAlgorithmException, SmackException, XMPPException, InterruptedException {
Configuration config = Configuration.newConfiguration();
Configuration config = Configuration.newConfiguration(args);
SmackIntegrationTestFramework sinttest = new SmackIntegrationTestFramework(config);
TestRunResult testRunResult = sinttest.run();