mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-16 09:12:06 +01:00
Compare commits
No commits in common. "b83dacc60a3a23ea0b432079f7e70ffd455720f3" and "f2e1d7ddd594e6bda1bb4c650fe3c83c7a6d1d3e" have entirely different histories.
b83dacc60a
...
f2e1d7ddd5
25 changed files with 217 additions and 121 deletions
|
@ -36,7 +36,7 @@ install: gradle assemble --stacktrace
|
||||||
# functional. Which hasn't always be the case in the past, see
|
# functional. Which hasn't always be the case in the past, see
|
||||||
# 90cbcaebc7a89f4f771f733a33ac9f389df85be2
|
# 90cbcaebc7a89f4f771f733a33ac9f389df85be2
|
||||||
# Also run javadocAll to ensure it works.
|
# Also run javadocAll to ensure it works.
|
||||||
script: gradle check publishToMavenLocal javadocAll --stacktrace
|
script: gradle check install javadocAll --stacktrace
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- JAVAC_VERSION=$((javac -version) 2>&1)
|
- JAVAC_VERSION=$((javac -version) 2>&1)
|
||||||
|
|
142
build.gradle
142
build.gradle
|
@ -1,3 +1,5 @@
|
||||||
|
import org.gradle.plugins.signing.Sign
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
|
@ -36,8 +38,7 @@ allprojects {
|
||||||
rootConfigDir = new File(rootDir, 'config')
|
rootConfigDir = new File(rootDir, 'config')
|
||||||
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
|
sonatypeCredentialsAvailable = project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')
|
||||||
isReleaseVersion = !isSnapshot
|
isReleaseVersion = !isSnapshot
|
||||||
isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI'))
|
signingRequired = isReleaseVersion
|
||||||
signingRequired = !(isSnapshot || isContinuousIntegrationEnvironment)
|
|
||||||
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
|
||||||
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
|
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
|
||||||
// Returns only the date in yyyy-MM-dd format, as otherwise, with
|
// Returns only the date in yyyy-MM-dd format, as otherwise, with
|
||||||
|
@ -131,7 +132,6 @@ allprojects {
|
||||||
].collect { project(it) }
|
].collect { project(it) }
|
||||||
junitVersion = '5.4.2'
|
junitVersion = '5.4.2'
|
||||||
powerMockVersion = '2.0.2'
|
powerMockVersion = '2.0.2'
|
||||||
commonsIoVersion = '2.6'
|
|
||||||
}
|
}
|
||||||
group = 'org.igniterealtime.smack'
|
group = 'org.igniterealtime.smack'
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
@ -387,7 +387,7 @@ ${oneLineDesc}."""
|
||||||
|
|
||||||
evaluationDependsOnChildren()
|
evaluationDependsOnChildren()
|
||||||
subprojects {
|
subprojects {
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
apply plugin: 'checkstyle'
|
apply plugin: 'checkstyle'
|
||||||
apply plugin: 'org.kordamp.gradle.clirr'
|
apply plugin: 'org.kordamp.gradle.clirr'
|
||||||
|
@ -403,62 +403,89 @@ subprojects {
|
||||||
classifier = 'javadoc'
|
classifier = 'javadoc'
|
||||||
from javadoc.destinationDir
|
from javadoc.destinationDir
|
||||||
}
|
}
|
||||||
task testsJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
classifier = 'tests'
|
classifier = 'tests'
|
||||||
from sourceSets.test.output
|
from sourceSets.test.output
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
// Does install unique snapshosts (and release)s in the local maven
|
||||||
// See http://stackoverflow.com/a/21946676/194894
|
// repository, unlike the 'install' task.
|
||||||
testRuntime testsJar
|
// You can specify the path of the local maven repository using 'maven.repo.local', e.g.
|
||||||
|
// gradle uploadLocal -Dmaven.repo.local=/var/www/repo
|
||||||
|
task uploadLocal(type: Upload) {
|
||||||
|
description "Uploads artifacts into the local maven repositories URL."
|
||||||
|
configuration = configurations['archives']
|
||||||
|
repositories {
|
||||||
|
mavenDeployer {
|
||||||
|
repository url: repositories.mavenLocal().url
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
configurations {
|
||||||
publications {
|
archivesOutput.extendsFrom (testCompile)
|
||||||
mavenJava(MavenPublication) {
|
}
|
||||||
from components.java
|
|
||||||
artifact sourcesJar
|
artifacts {
|
||||||
artifact javadocJar
|
archives sourcesJar
|
||||||
artifact testsJar
|
archives javadocJar
|
||||||
pom {
|
archives testJar
|
||||||
name = 'Smack'
|
// See http://stackoverflow.com/a/21946676/194894
|
||||||
packaging = 'jar'
|
testRuntime testJar
|
||||||
inceptionYear = '2003'
|
}
|
||||||
url = 'http://www.igniterealtime.org/projects/smack/'
|
|
||||||
|
uploadArchives {
|
||||||
|
repositories {
|
||||||
|
mavenDeployer {
|
||||||
|
if (signingRequired) {
|
||||||
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||||||
|
}
|
||||||
|
repository(url: project.sonatypeStagingUrl) {
|
||||||
|
if (sonatypeCredentialsAvailable) {
|
||||||
|
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
snapshotRepository(url: project.sonatypeSnapshotUrl) {
|
||||||
|
if (sonatypeCredentialsAvailable) {
|
||||||
|
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pom.project {
|
||||||
|
name 'Smack'
|
||||||
|
packaging 'jar'
|
||||||
|
inceptionYear '2003'
|
||||||
|
url 'http://www.igniterealtime.org/projects/smack/'
|
||||||
description project.description
|
description project.description
|
||||||
|
|
||||||
issueManagement {
|
issueManagement {
|
||||||
system = 'JIRA'
|
system 'JIRA'
|
||||||
url = 'https://igniterealtime.org/issues/browse/SMACK'
|
url 'https://igniterealtime.org/issues/browse/SMACK'
|
||||||
|
}
|
||||||
|
|
||||||
|
distributionManagement {
|
||||||
|
snapshotRepository {
|
||||||
|
id 'smack.snapshot'
|
||||||
|
url project.sonatypeSnapshotUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scm {
|
scm {
|
||||||
url = 'https://github.com/igniterealtime/Smack'
|
url 'https://github.com/igniterealtime/Smack'
|
||||||
connection = 'scm:git:https://github.com/igniterealtime/Smack.git'
|
connection 'scm:git:https://github.com/igniterealtime/Smack.git'
|
||||||
developerConnection = 'scm:git:https://github.com/igniterealtime/Smack.git'
|
developerConnection 'scm:git:https://github.com/igniterealtime/Smack.git'
|
||||||
}
|
}
|
||||||
|
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
id = 'flow'
|
id 'flow'
|
||||||
name = 'Florian Schmaus'
|
name 'Florian Schmaus'
|
||||||
email = 'flow@igniterealtime.org'
|
email 'flow@igniterealtime.org'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
|
||||||
if (sonatypeCredentialsAvailable) {
|
|
||||||
credentials {
|
|
||||||
username = sonatypeUsername
|
|
||||||
password = sonatypePassword
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
rootProject.distributionZip {
|
rootProject.distributionZip {
|
||||||
dependsOn build
|
dependsOn build
|
||||||
|
@ -480,7 +507,7 @@ subprojects {
|
||||||
signing {
|
signing {
|
||||||
useGpgCmd()
|
useGpgCmd()
|
||||||
required { signingRequired }
|
required { signingRequired }
|
||||||
sign publishing.publications.mavenJava
|
sign configurations.archives
|
||||||
}
|
}
|
||||||
|
|
||||||
clirr {
|
clirr {
|
||||||
|
@ -562,15 +589,15 @@ configure(subprojects - gplLicensedProjects) {
|
||||||
checkstyle {
|
checkstyle {
|
||||||
configProperties.checkstyleLicenseHeader = "header"
|
configProperties.checkstyleLicenseHeader = "header"
|
||||||
}
|
}
|
||||||
publishing {
|
uploadArchives {
|
||||||
publications {
|
repositories {
|
||||||
mavenJava(MavenPublication) {
|
mavenDeployer {
|
||||||
pom {
|
pom.project {
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name = 'The Apache Software License, Version 2.0'
|
name 'The Apache Software License, Version 2.0'
|
||||||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
distribution = 'repo'
|
distribution 'repo'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -583,16 +610,15 @@ configure(gplLicensedProjects) {
|
||||||
checkstyle {
|
checkstyle {
|
||||||
configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header"
|
configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header"
|
||||||
}
|
}
|
||||||
publishing {
|
uploadArchives {
|
||||||
publications {
|
repositories {
|
||||||
mavenJava(MavenPublication) {
|
mavenDeployer {
|
||||||
pom {
|
pom.project {
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name = 'GNU General Public License, version 3 or any later version'
|
name 'GNU General Public License, version 3 or any later version'
|
||||||
url = 'https://www.gnu.org/licenses/gpl.txt'
|
url 'https://www.gnu.org/licenses/gpl.txt'
|
||||||
distribution = 'repo'
|
distribution 'repo'
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -600,6 +626,8 @@ configure(gplLicensedProjects) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
configure(androidBootClasspathProjects) {
|
configure(androidBootClasspathProjects) {
|
||||||
compileJava {
|
compileJava {
|
||||||
options.bootstrapClasspath = files(androidBootClasspath)
|
options.bootstrapClasspath = files(androidBootClasspath)
|
||||||
|
|
|
@ -24,5 +24,5 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the Android jar to the Eclipse .classpath.
|
// Add the Android jar to the Eclipse .classpath.
|
||||||
compileOnly files(androidBootClasspath)
|
compile files(androidBootClasspath)
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,23 +66,15 @@ public class AbstractError {
|
||||||
* @return the descriptive text or null.
|
* @return the descriptive text or null.
|
||||||
*/
|
*/
|
||||||
public String getDescriptiveText() {
|
public String getDescriptiveText() {
|
||||||
if (descriptiveTexts.isEmpty())
|
String defaultLocale = Locale.getDefault().getLanguage();
|
||||||
return null;
|
String descriptiveText = getDescriptiveText(defaultLocale);
|
||||||
// attempt to obtain the text in the user's locale, the English text, or the "" default
|
if (descriptiveText == null) {
|
||||||
Locale l = Locale.getDefault();
|
descriptiveText = getDescriptiveText("en");
|
||||||
String[] tags = new String[] {
|
if (descriptiveText == null) {
|
||||||
l.getLanguage() + "-" + l.getCountry() + "-" + l.getVariant(),
|
descriptiveText = getDescriptiveText("");
|
||||||
l.getLanguage() + "-" + l.getCountry(),
|
}
|
||||||
l.getLanguage(),
|
|
||||||
"en",
|
|
||||||
""
|
|
||||||
};
|
|
||||||
for (String tag : tags) {
|
|
||||||
String descriptiveText = getDescriptiveText(tag);
|
|
||||||
if (descriptiveText != null)
|
|
||||||
return descriptiveText;
|
|
||||||
}
|
}
|
||||||
return descriptiveTexts.values().iterator().next();
|
return descriptiveText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2014-2019 Florian Schmaus
|
* Copyright 2014-2017 Florian Schmaus
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -19,9 +19,13 @@ package org.jivesoftware.smack.util;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class LazyStringBuilder implements Appendable, CharSequence {
|
public class LazyStringBuilder implements Appendable, CharSequence {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(LazyStringBuilder.class.getName());
|
||||||
|
|
||||||
private final List<CharSequence> list;
|
private final List<CharSequence> list;
|
||||||
|
|
||||||
private String cache;
|
private String cache;
|
||||||
|
@ -76,7 +80,8 @@ public class LazyStringBuilder implements Appendable, CharSequence {
|
||||||
}
|
}
|
||||||
catch (NullPointerException npe) {
|
catch (NullPointerException npe) {
|
||||||
StringBuilder sb = safeToStringBuilder();
|
StringBuilder sb = safeToStringBuilder();
|
||||||
throw new RuntimeException("The following LazyStringBuilder threw a NullPointerException: " + sb, npe);
|
LOGGER.log(Level.SEVERE, "The following LazyStringBuilder threw a NullPointerException: " + sb, npe);
|
||||||
|
throw npe;
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
|
@ -627,10 +627,8 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StringBuilder toXML(XmlEnvironment enclosingXmlEnvironment) {
|
public CharSequence toXML(XmlEnvironment enclosingXmlEnvironment) {
|
||||||
// This is only the potential length, since the actual length depends on the given XmlEnvironment.
|
StringBuilder res = new StringBuilder();
|
||||||
int potentialLength = length();
|
|
||||||
StringBuilder res = new StringBuilder(potentialLength);
|
|
||||||
try {
|
try {
|
||||||
appendXmlTo(res, enclosingXmlEnvironment);
|
appendXmlTo(res, enclosingXmlEnvironment);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -648,7 +646,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
|
||||||
else if (csq instanceof XmlNsAttribute) {
|
else if (csq instanceof XmlNsAttribute) {
|
||||||
XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
|
XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
|
||||||
if (!xmlNsAttribute.value.equals(enclosingXmlEnvironment.getEffectiveNamespace())) {
|
if (!xmlNsAttribute.value.equals(enclosingXmlEnvironment.getEffectiveNamespace())) {
|
||||||
appendable.append(xmlNsAttribute);
|
sb.append(xmlNsAttribute);
|
||||||
enclosingXmlEnvironment = new XmlEnvironment(xmlNsAttribute.value);
|
enclosingXmlEnvironment = new XmlEnvironment(xmlNsAttribute.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Copyright © 2018 Paul Schaub
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.jivesoftware.smack.test.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
public class FileTestUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a {@link File} pointing to a temporary directory. On unix like systems this might be {@code /tmp}
|
||||||
|
* for example.
|
||||||
|
* If {@code suffix} is not null, the returned file points to {@code <temp>/suffix}.
|
||||||
|
*
|
||||||
|
* @param suffix optional path suffix
|
||||||
|
* @return temp directory
|
||||||
|
*/
|
||||||
|
public static File getTempDir(String suffix) {
|
||||||
|
String temp = System.getProperty("java.io.tmpdir");
|
||||||
|
if (temp == null) {
|
||||||
|
temp = "tmp";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (suffix == null) {
|
||||||
|
return new File(temp);
|
||||||
|
} else {
|
||||||
|
return new File(temp, suffix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively delete a directory and its contents.
|
||||||
|
*
|
||||||
|
* @param root root directory
|
||||||
|
*/
|
||||||
|
public static void deleteDirectory(File root) {
|
||||||
|
if (!root.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File[] currList;
|
||||||
|
Stack<File> stack = new Stack<>();
|
||||||
|
stack.push(root);
|
||||||
|
while (!stack.isEmpty()) {
|
||||||
|
if (stack.lastElement().isDirectory()) {
|
||||||
|
currList = stack.lastElement().listFiles();
|
||||||
|
if (currList != null && currList.length > 0) {
|
||||||
|
for (File curr : currList) {
|
||||||
|
stack.push(curr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stack.pop().delete();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stack.pop().delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ dependencies {
|
||||||
compile project(':smack-core')
|
compile project(':smack-core')
|
||||||
compile project(':smack-extensions')
|
compile project(':smack-extensions')
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
testCompile project(path: ":smack-extensions", configuration: "testRuntime")
|
testCompile project(path: ":smack-extensions", configuration: "testRuntime")
|
||||||
|
|
||||||
compile "org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion"
|
compile "org.bouncycastle:bcprov-jdk15on:$bouncyCastleVersion"
|
||||||
|
|
|
@ -51,8 +51,6 @@ public final class StableUniqueStanzaIdManager extends Manager {
|
||||||
|
|
||||||
private static final Map<XMPPConnection, StableUniqueStanzaIdManager> INSTANCES = new WeakHashMap<>();
|
private static final Map<XMPPConnection, StableUniqueStanzaIdManager> INSTANCES = new WeakHashMap<>();
|
||||||
|
|
||||||
private static boolean enabledByDefault = true;
|
|
||||||
|
|
||||||
// Filter for outgoing stanzas.
|
// Filter for outgoing stanzas.
|
||||||
private static final StanzaFilter OUTGOING_FILTER = new AndFilter(
|
private static final StanzaFilter OUTGOING_FILTER = new AndFilter(
|
||||||
MessageTypeFilter.NORMAL_OR_CHAT_OR_HEADLINE,
|
MessageTypeFilter.NORMAL_OR_CHAT_OR_HEADLINE,
|
||||||
|
@ -74,9 +72,7 @@ public final class StableUniqueStanzaIdManager extends Manager {
|
||||||
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
|
XMPPConnectionRegistry.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void connectionCreated(XMPPConnection connection) {
|
public void connectionCreated(XMPPConnection connection) {
|
||||||
if (enabledByDefault) {
|
getInstanceFor(connection);
|
||||||
getInstanceFor(connection).enable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -87,10 +83,7 @@ public final class StableUniqueStanzaIdManager extends Manager {
|
||||||
*/
|
*/
|
||||||
private StableUniqueStanzaIdManager(XMPPConnection connection) {
|
private StableUniqueStanzaIdManager(XMPPConnection connection) {
|
||||||
super(connection);
|
super(connection);
|
||||||
}
|
enable();
|
||||||
|
|
||||||
public static void setEnabledByDefault(boolean enabled) {
|
|
||||||
enabledByDefault = enabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,4 +11,5 @@ dependencies {
|
||||||
// e.g. message delivery receipts the roster
|
// e.g. message delivery receipts the roster
|
||||||
compile project(':smack-im')
|
compile project(':smack-im')
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
|
@ -557,7 +557,6 @@ public class ConfigureForm extends Form {
|
||||||
* @deprecated use {@link #isSubscribe()} instead
|
* @deprecated use {@link #isSubscribe()} instead
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
// TODO: Remove in Smack 4.5.
|
|
||||||
public boolean isSubscibe() {
|
public boolean isSubscibe() {
|
||||||
return isSubscribe();
|
return isSubscribe();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,5 @@ Roster, Chat and other functionality."""
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':smack-core')
|
compile project(':smack-core')
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,9 +14,9 @@ dependencies {
|
||||||
compile project(':smack-omemo')
|
compile project(':smack-omemo')
|
||||||
compile project(':smack-openpgp')
|
compile project(':smack-openpgp')
|
||||||
compile project(':smack-debug')
|
compile project(':smack-debug')
|
||||||
|
compile project(path: ":smack-omemo", configuration: "testRuntime")
|
||||||
compile 'org.reflections:reflections:0.9.11'
|
compile 'org.reflections:reflections:0.9.11'
|
||||||
compile 'eu.geekplace.javapinning:java-pinning-java7:1.1.0-alpha1'
|
compile 'eu.geekplace.javapinning:java-pinning-java7:1.1.0-alpha1'
|
||||||
compile group: 'commons-io', name: 'commons-io', version: "$commonsIoVersion"
|
|
||||||
// Note that the junit-vintage-engine runtime dependency is not
|
// Note that the junit-vintage-engine runtime dependency is not
|
||||||
// directly required, but it declares a dependency to
|
// directly required, but it declares a dependency to
|
||||||
// junit:junit:4.12, which we currently need in sinttest, since it
|
// junit:junit:4.12, which we currently need in sinttest, since it
|
||||||
|
@ -25,7 +25,6 @@ dependencies {
|
||||||
compile 'junit:junit:4.12'
|
compile 'junit:junit:4.12'
|
||||||
// Add Junit 5 API for e.g. assertThrows()
|
// Add Junit 5 API for e.g. assertThrows()
|
||||||
implementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
implementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
|
||||||
testCompile "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
testCompile "org.jxmpp:jxmpp-jid:$jxmppVersion:tests"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.jivesoftware.smackx.omemo.exceptions.CorruptedOmemoKeyException;
|
||||||
import org.jivesoftware.smackx.omemo.internal.OmemoCachedDeviceList;
|
import org.jivesoftware.smackx.omemo.internal.OmemoCachedDeviceList;
|
||||||
import org.jivesoftware.smackx.omemo.internal.OmemoDevice;
|
import org.jivesoftware.smackx.omemo.internal.OmemoDevice;
|
||||||
import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
|
import org.jivesoftware.smackx.omemo.trust.OmemoFingerprint;
|
||||||
|
import org.jivesoftware.smackx.omemo.util.EphemeralTrustCallback;
|
||||||
import org.jivesoftware.smackx.omemo.util.OmemoConstants;
|
import org.jivesoftware.smackx.omemo.util.OmemoConstants;
|
||||||
import org.jivesoftware.smackx.pubsub.PubSubException;
|
import org.jivesoftware.smackx.pubsub.PubSubException;
|
||||||
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
||||||
|
|
|
@ -32,6 +32,7 @@ import java.util.logging.Level;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackException;
|
import org.jivesoftware.smack.SmackException;
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.ox.callback.backup.AskForBackupCodeCallback;
|
import org.jivesoftware.smackx.ox.callback.backup.AskForBackupCodeCallback;
|
||||||
import org.jivesoftware.smackx.ox.callback.backup.DisplayBackupCodeCallback;
|
import org.jivesoftware.smackx.ox.callback.backup.DisplayBackupCodeCallback;
|
||||||
|
@ -62,9 +63,8 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegrationTest {
|
public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegrationTest {
|
||||||
|
|
||||||
private static final String sessionId = StringUtils.randomString(10);
|
private static final String sessionId = StringUtils.randomString(10);
|
||||||
private static final File tempDir = org.apache.commons.io.FileUtils.getTempDirectory();
|
private static final File beforePath = FileTestUtil.getTempDir("ox_backup_" + sessionId);
|
||||||
private static final File beforePath = new File(tempDir, "ox_backup_" + sessionId);
|
private static final File afterPath = FileTestUtil.getTempDir("ox_restore_" + sessionId);
|
||||||
private static final File afterPath = new File(tempDir, "ox_restore_" + sessionId);
|
|
||||||
|
|
||||||
private String backupCode = null;
|
private String backupCode = null;
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegration
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void cleanStore() throws IOException {
|
public static void cleanStore() {
|
||||||
LOGGER.log(Level.INFO, "Delete store directories...");
|
LOGGER.log(Level.INFO, "Delete store directories...");
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(afterPath);
|
FileTestUtil.deleteDirectory(afterPath);
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(beforePath);
|
FileTestUtil.deleteDirectory(beforePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
|
|
@ -20,12 +20,12 @@ import static junit.framework.TestCase.assertFalse;
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.jivesoftware.smack.SmackException;
|
import org.jivesoftware.smack.SmackException;
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
import org.jivesoftware.smack.packet.Message;
|
import org.jivesoftware.smack.packet.Message;
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smackx.ox.AbstractOpenPgpIntegrationTest;
|
import org.jivesoftware.smackx.ox.AbstractOpenPgpIntegrationTest;
|
||||||
import org.jivesoftware.smackx.ox.OpenPgpContact;
|
import org.jivesoftware.smackx.ox.OpenPgpContact;
|
||||||
|
@ -49,9 +49,8 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
public class OXInstantMessagingIntegrationTest extends AbstractOpenPgpIntegrationTest {
|
public class OXInstantMessagingIntegrationTest extends AbstractOpenPgpIntegrationTest {
|
||||||
|
|
||||||
private static final String sessionId = StringUtils.randomString(10);
|
private static final String sessionId = StringUtils.randomString(10);
|
||||||
private static final File tempDir = org.apache.commons.io.FileUtils.getTempDirectory();
|
private static final File aliceStorePath = FileTestUtil.getTempDir("basic_ox_messaging_test_alice_" + sessionId);
|
||||||
private static final File aliceStorePath = new File(tempDir, "basic_ox_messaging_test_alice_" + sessionId);
|
private static final File bobStorePath = FileTestUtil.getTempDir("basic_ox_messaging_test_bob_" + sessionId);
|
||||||
private static final File bobStorePath = new File(tempDir, "basic_ox_messaging_test_bob_" + sessionId);
|
|
||||||
|
|
||||||
private OpenPgpV4Fingerprint aliceFingerprint = null;
|
private OpenPgpV4Fingerprint aliceFingerprint = null;
|
||||||
private OpenPgpV4Fingerprint bobFingerprint = null;
|
private OpenPgpV4Fingerprint bobFingerprint = null;
|
||||||
|
@ -96,10 +95,10 @@ public class OXInstantMessagingIntegrationTest extends AbstractOpenPgpIntegratio
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void deleteStore() throws IOException {
|
public static void deleteStore() {
|
||||||
LOGGER.log(Level.INFO, "Deleting storage directories...");
|
LOGGER.log(Level.INFO, "Deleting storage directories...");
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(aliceStorePath);
|
FileTestUtil.deleteDirectory(aliceStorePath);
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(bobStorePath);
|
FileTestUtil.deleteDirectory(bobStorePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SmackIntegrationTest
|
@SmackIntegrationTest
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.jivesoftware.smackx.omemo;
|
package org.jivesoftware.smackx.omemo.util;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
|
@ -15,5 +15,5 @@ dependencies {
|
||||||
compile 'org.pgpainless:pgpainless-core:0.0.1-alpha7'
|
compile 'org.pgpainless:pgpainless-core:0.0.1-alpha7'
|
||||||
|
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
testCompile group: 'commons-io', name: 'commons-io', version: "$commonsIoVersion"
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.ox.callback.SecretKeyPassphraseCallback;
|
import org.jivesoftware.smackx.ox.callback.SecretKeyPassphraseCallback;
|
||||||
|
@ -77,7 +78,7 @@ public class OpenPgpStoreTest extends SmackTestSuite {
|
||||||
private final OpenPgpStore openPgpStoreInstance2;
|
private final OpenPgpStore openPgpStoreInstance2;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
storagePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "storeTest");
|
storagePath = FileTestUtil.getTempDir("storeTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Parameterized.Parameters
|
@Parameterized.Parameters
|
||||||
|
@ -98,8 +99,8 @@ public class OpenPgpStoreTest extends SmackTestSuite {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@After
|
@After
|
||||||
public void deletePath() throws IOException {
|
public void deletePath() {
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(storagePath);
|
FileTestUtil.deleteDirectory(storagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -32,6 +32,7 @@ import java.util.List;
|
||||||
import org.jivesoftware.smack.DummyConnection;
|
import org.jivesoftware.smack.DummyConnection;
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.packet.Message;
|
import org.jivesoftware.smack.packet.Message;
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
|
||||||
|
@ -62,13 +63,13 @@ public class PainlessOpenPgpProviderTest extends SmackTestSuite {
|
||||||
private static final BareJid bob = JidTestUtil.BARE_JID_2;
|
private static final BareJid bob = JidTestUtil.BARE_JID_2;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
storagePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "smack-painlessprovidertest");
|
storagePath = FileTestUtil.getTempDir("smack-painlessprovidertest");
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void deletePath() throws IOException {
|
public static void deletePath() {
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(storagePath);
|
FileTestUtil.deleteDirectory(storagePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
||||||
import org.jivesoftware.smack.DummyConnection;
|
import org.jivesoftware.smack.DummyConnection;
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||||
|
|
||||||
import org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider;
|
import org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider;
|
||||||
|
@ -54,7 +55,7 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite {
|
||||||
private static final File basePath;
|
private static final File basePath;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys");
|
basePath = FileTestUtil.getTempDir("ox_secret_keys");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -97,7 +98,7 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite {
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void deleteDirs() throws IOException {
|
public static void deleteDirs() {
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(basePath);
|
FileTestUtil.deleteDirectory(basePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.jivesoftware.smack.SmackException;
|
||||||
import org.jivesoftware.smack.XMPPException;
|
import org.jivesoftware.smack.XMPPException;
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.packet.Message;
|
import org.jivesoftware.smack.packet.Message;
|
||||||
|
import org.jivesoftware.smack.test.util.FileTestUtil;
|
||||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||||
import org.jivesoftware.smack.util.StringUtils;
|
import org.jivesoftware.smack.util.StringUtils;
|
||||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||||
|
@ -62,7 +63,7 @@ public class OXInstantMessagingManagerTest extends SmackTestSuite {
|
||||||
private static final File basePath;
|
private static final File basePath;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_im_test_" + StringUtils.randomString(10));
|
basePath = FileTestUtil.getTempDir("ox_im_test_" + StringUtils.randomString(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -168,7 +169,7 @@ public class OXInstantMessagingManagerTest extends SmackTestSuite {
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void deleteDirs() throws IOException {
|
public static void deleteDirs() {
|
||||||
org.apache.commons.io.FileUtils.deleteDirectory(basePath);
|
FileTestUtil.deleteDirectory(basePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ dependencies {
|
||||||
compile "org.scala-lang:scala-library:$scalaVersion"
|
compile "org.scala-lang:scala-library:$scalaVersion"
|
||||||
compile "com.lihaoyi:ammonite_$scalaVersion:1.3.2"
|
compile "com.lihaoyi:ammonite_$scalaVersion:1.3.2"
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
||||||
scalaStyle {
|
scalaStyle {
|
||||||
|
|
|
@ -5,4 +5,5 @@ Use javax.security.sasl for SASL."""
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':smack-core')
|
compile project(':smack-core')
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,5 @@ Use Smack provided code for SASL."""
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':smack-core')
|
compile project(':smack-core')
|
||||||
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
testCompile project(path: ":smack-core", configuration: "testRuntime")
|
||||||
|
testCompile project(path: ":smack-core", configuration: "archives")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue