Move EntityCaps and Bookmarks API in correct package

Also move ProviderConfigTest into core, since it tests core
functionality, nothing provided by extensions. Found the reason the test
was failing since the gradle migration (provider entry test.providers),
and activated it again. \o/

New API design as of SMACK-545
This commit is contained in:
Florian Schmaus 2014-02-18 10:24:59 +01:00
parent 1f63ac31a5
commit 312f2f7508
17 changed files with 32 additions and 35 deletions

View File

@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.provider;
package org.jivesoftware.smack.provider;
import java.util.ArrayList;
import java.util.Collection;
import junit.framework.Assert;
import org.junit.Assert;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.ExtensionProviderInfo;
@ -29,13 +29,11 @@ import org.jivesoftware.smack.provider.ProviderFileLoader;
import org.jivesoftware.smack.provider.ProviderLoader;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.util.FileUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.xmlpull.v1.XmlPullParser;
@SuppressWarnings("deprecation")
public class ProviderConfigTest {
@Test
public void addGenericLoaderProvider() {
ProviderManager.getInstance().addLoader(new ProviderLoader() {
@ -46,20 +44,19 @@ public class ProviderConfigTest {
l.add(new IQProviderInfo("provider", "test:provider", new TestIQProvider()));
return l;
}
@Override
public Collection<ExtensionProviderInfo> getExtensionProviderInfo() {
return null;
}
});
Assert.assertNotNull(ProviderManager.getInstance().getIQProvider("provider", "test:provider"));
}
@Ignore // gradle migration
@Test
public void addClasspathFileLoaderProvider() throws Exception{
ProviderManager.getInstance().addLoader(new ProviderFileLoader(FileUtils.getStreamForUrl("classpath:org/jivesoftware/smackx/provider/test.providers", null)));
ProviderManager.getInstance().addLoader(new ProviderFileLoader(FileUtils.getStreamForUrl("classpath:test.providers", null)));
Assert.assertNotNull(ProviderManager.getInstance().getIQProvider("provider", "test:file_provider"));
}
@ -69,6 +66,6 @@ public class ProviderConfigTest {
public IQ parseIQ(XmlPullParser parser) throws Exception {
return null;
}
}
}

View File

@ -5,7 +5,7 @@
<iqProvider>
<elementName>provider</elementName>
<namespace>test:file_provider</namespace>
<className>org.jivesoftware.smackx.provider.ProviderConfigTest$TestIQProvider</className>
<className>org.jivesoftware.smack.provider.ProviderConfigTest$TestIQProvider</className>
</iqProvider>
</smackProviders>

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.jivesoftware.smackx.bookmark;
package org.jivesoftware.smackx.bookmarks;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.XMPPException;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.jivesoftware.smackx.bookmark;
package org.jivesoftware.smackx.bookmarks;
/**
* Respresents a Conference Room bookmarked on the server using JEP-0048 Bookmark Storage JEP.

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.jivesoftware.smackx.bookmark;
package org.jivesoftware.smackx.bookmarks;
/**
* Respresents one instance of a URL defined using JEP-0048 Bookmark Storage JEP.

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.bookmark;
package org.jivesoftware.smackx.bookmarks;
import org.jivesoftware.smackx.iqprivate.packet.PrivateData;
import org.jivesoftware.smackx.iqprivate.provider.PrivateDataProvider;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.jivesoftware.smackx.bookmark;
package org.jivesoftware.smackx.bookmarks;
/**
* Interface to indicate if a bookmark is shared across the server.

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps;
package org.jivesoftware.smackx.caps;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionCreationListener;
@ -34,14 +34,14 @@ import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.filter.PacketExtensionFilter;
import org.jivesoftware.smack.util.Base64;
import org.jivesoftware.smack.util.Cache;
import org.jivesoftware.smackx.caps.cache.EntityCapsPersistentCache;
import org.jivesoftware.smackx.caps.packet.CapsExtension;
import org.jivesoftware.smackx.disco.NodeInformationProvider;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo.Feature;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity;
import org.jivesoftware.smackx.disco.packet.DiscoverItems.Item;
import org.jivesoftware.smackx.entitycaps.cache.EntityCapsPersistentCache;
import org.jivesoftware.smackx.entitycaps.packet.CapsExtension;
import org.jivesoftware.smackx.xdata.Form;
import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps.cache;
package org.jivesoftware.smackx.caps.cache;
import java.io.IOException;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps.cache;
package org.jivesoftware.smackx.caps.cache;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@ -31,9 +31,9 @@ import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.util.Base32Encoder;
import org.jivesoftware.smack.util.StringEncoder;
import org.jivesoftware.smackx.caps.EntityCapsManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.provider.DiscoverInfoProvider;
import org.jivesoftware.smackx.entitycaps.EntityCapsManager;
import org.xmlpull.mxp1.MXParser;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

View File

@ -15,10 +15,10 @@
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps.packet;
package org.jivesoftware.smackx.caps.packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.entitycaps.EntityCapsManager;
import org.jivesoftware.smackx.caps.EntityCapsManager;
public class CapsExtension implements PacketExtension {

View File

@ -14,16 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps.provider;
package org.jivesoftware.smackx.caps.provider;
import java.io.IOException;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smackx.entitycaps.EntityCapsManager;
import org.jivesoftware.smackx.entitycaps.packet.CapsExtension;
import org.jivesoftware.smackx.caps.EntityCapsManager;
import org.jivesoftware.smackx.caps.packet.CapsExtension;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

View File

@ -25,10 +25,10 @@ import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smackx.caps.EntityCapsManager;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity;
import org.jivesoftware.smackx.entitycaps.EntityCapsManager;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import java.lang.ref.WeakReference;

View File

@ -432,7 +432,7 @@
<extensionProvider>
<elementName>c</elementName>
<namespace>http://jabber.org/protocol/caps</namespace>
<className>org.jivesoftware.smackx.entitycaps.provider.CapsExtensionProvider</className>
<className>org.jivesoftware.smackx.caps.provider.CapsExtensionProvider</className>
</extensionProvider>
<!-- XEP-0297 Stanza Forwarding -->

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.entitycaps;
package org.jivesoftware.smackx.caps;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@ -29,9 +29,10 @@ import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.util.Base32Encoder;
import org.jivesoftware.smack.util.Base64FileUrlEncoder;
import org.jivesoftware.smack.util.StringEncoder;
import org.jivesoftware.smackx.caps.EntityCapsManager;
import org.jivesoftware.smackx.caps.cache.EntityCapsPersistentCache;
import org.jivesoftware.smackx.caps.cache.SimpleDirectoryPersistentCache;
import org.jivesoftware.smackx.disco.packet.DiscoverInfo;
import org.jivesoftware.smackx.entitycaps.cache.EntityCapsPersistentCache;
import org.jivesoftware.smackx.entitycaps.cache.SimpleDirectoryPersistentCache;
import org.jivesoftware.smackx.xdata.FormField;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.junit.Ignore;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.provider;
package org.jivesoftware.smackx.delay.provider;
import static org.junit.Assert.*;