aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--juick-server/src/main/java/com/juick/server/XMPPConnection.java2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/Stream.java (renamed from juick-www/src/test/java/com/juick/server/Stream.java)2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/StreamComponentServer.java (renamed from juick-www/src/test/java/com/juick/server/StreamComponentServer.java)11
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/StreamError.java (renamed from juick-www/src/test/java/com/juick/server/StreamError.java)8
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/StreamHandler.java (renamed from juick-www/src/test/java/com/juick/server/StreamHandler.java)2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/StreamNamespaces.java (renamed from juick-www/src/test/java/com/juick/server/StreamNamespaces.java)2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/XMPPError.java (renamed from juick-www/src/test/java/com/juick/server/XMPPError.java)2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java (renamed from juick-www/src/test/java/com/juick/server/XMPPRouter.java)2
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/XmlUtils.java (renamed from juick-www/src/test/java/com/juick/server/XmlUtils.java)2
-rw-r--r--juick-www/src/test/java/com/juick/WebAppTests.java11
10 files changed, 16 insertions, 28 deletions
diff --git a/juick-server/src/main/java/com/juick/server/XMPPConnection.java b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
index 40cf347a..4be4a5ba 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPConnection.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPConnection.java
@@ -41,6 +41,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEventPublisher;
+import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;
import rocks.xmpp.addr.Jid;
import rocks.xmpp.core.XmppException;
@@ -85,6 +86,7 @@ import java.util.concurrent.ExecutorService;
* @author ugnich
*/
@Component
+@DependsOn("XMPPRouter")
public class XMPPConnection implements StanzaListener, NotificationListener {
private static final Logger logger = LoggerFactory.getLogger(XMPPConnection.class);
diff --git a/juick-www/src/test/java/com/juick/server/Stream.java b/juick-server/src/main/java/com/juick/server/xmpp/router/Stream.java
index 9dbea3b2..7532443c 100644
--- a/juick-www/src/test/java/com/juick/server/Stream.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/Stream.java
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package com.juick.server;
+package com.juick.server.xmpp.router;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
diff --git a/juick-www/src/test/java/com/juick/server/StreamComponentServer.java b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamComponentServer.java
index 8c66c2e8..5e2f6f82 100644
--- a/juick-www/src/test/java/com/juick/server/StreamComponentServer.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamComponentServer.java
@@ -1,4 +1,4 @@
-package com.juick.server;
+package com.juick.server.xmpp.router;
import com.juick.xmpp.extensions.Handshake;
import org.apache.commons.codec.digest.DigestUtils;
@@ -10,9 +10,6 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;
-import static com.juick.server.StreamNamespaces.NS_COMPONENT_ACCEPT;
-import static com.juick.server.StreamNamespaces.NS_STREAM;
-
/**
* Created by vitalyster on 30.01.2017.
*/
@@ -34,8 +31,8 @@ public class StreamComponentServer extends Stream {
public void handshake() throws XmlPullParserException, IOException {
parser.next();
if (!parser.getName().equals("stream")
- || !parser.getNamespace(null).equals(NS_COMPONENT_ACCEPT)
- || !parser.getNamespace("stream").equals(NS_STREAM)) {
+ || !parser.getNamespace(null).equals(StreamNamespaces.NS_COMPONENT_ACCEPT)
+ || !parser.getNamespace("stream").equals(StreamNamespaces.NS_STREAM)) {
throw new IOException("invalid stream");
}
Jid domain = Jid.of(parser.getAttributeValue(null, "to"));
@@ -46,7 +43,7 @@ public class StreamComponentServer extends Stream {
from = domain;
to = domain;
send(String.format("<stream:stream xmlns:stream='%s' " +
- "xmlns='%s' from='%s' id='%s'>", NS_STREAM, NS_COMPONENT_ACCEPT, from.asBareJid().toEscapedString(), streamId));
+ "xmlns='%s' from='%s' id='%s'>", StreamNamespaces.NS_STREAM, StreamNamespaces.NS_COMPONENT_ACCEPT, from.asBareJid().toEscapedString(), streamId));
Handshake handshake = Handshake.parse(parser);
boolean authenticated = handshake.getValue().equals(DigestUtils.sha1Hex(streamId + secret));
setLoggedIn(authenticated);
diff --git a/juick-www/src/test/java/com/juick/server/StreamError.java b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamError.java
index d552b590..7eacfc94 100644
--- a/juick-www/src/test/java/com/juick/server/StreamError.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamError.java
@@ -1,12 +1,10 @@
-package com.juick.server;
+package com.juick.server.xmpp.router;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
-import static com.juick.server.StreamNamespaces.NS_XMPP_STREAMS;
-
/**
* Created by vitalyster on 03.02.2017.
@@ -26,7 +24,7 @@ public class StreamError {
while (parser.next() == XmlPullParser.START_TAG) {
final String tag = parser.getName();
final String xmlns = parser.getNamespace();
- if (xmlns.equals(NS_XMPP_STREAMS)) {
+ if (xmlns.equals(StreamNamespaces.NS_XMPP_STREAMS)) {
streamError.condition = tag;
} else {
XmlUtils.skip(parser);
@@ -41,6 +39,6 @@ public class StreamError {
@Override
public String toString() {
- return String.format("<stream:error><%s xmlns='%s'/></stream:error>", condition, NS_XMPP_STREAMS);
+ return String.format("<stream:error><%s xmlns='%s'/></stream:error>", condition, StreamNamespaces.NS_XMPP_STREAMS);
}
}
diff --git a/juick-www/src/test/java/com/juick/server/StreamHandler.java b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamHandler.java
index d11fba1f..43836c2d 100644
--- a/juick-www/src/test/java/com/juick/server/StreamHandler.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamHandler.java
@@ -1,4 +1,4 @@
-package com.juick.server;
+package com.juick.server.xmpp.router;
import rocks.xmpp.addr.Jid;
diff --git a/juick-www/src/test/java/com/juick/server/StreamNamespaces.java b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamNamespaces.java
index fbedcae6..1b9b1965 100644
--- a/juick-www/src/test/java/com/juick/server/StreamNamespaces.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/StreamNamespaces.java
@@ -1,4 +1,4 @@
-package com.juick.server;
+package com.juick.server.xmpp.router;
public class StreamNamespaces {
public static final String NS_STREAM = "http://etherx.jabber.org/streams";
diff --git a/juick-www/src/test/java/com/juick/server/XMPPError.java b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPError.java
index 66e4ec44..0cf9a3bc 100644
--- a/juick-www/src/test/java/com/juick/server/XMPPError.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPError.java
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package com.juick.server;
+package com.juick.server.xmpp.router;
import org.apache.commons.text.StringEscapeUtils;
diff --git a/juick-www/src/test/java/com/juick/server/XMPPRouter.java b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java
index d03a0880..670962de 100644
--- a/juick-www/src/test/java/com/juick/server/XMPPRouter.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java
@@ -1,4 +1,4 @@
-package com.juick.server;
+package com.juick.server.xmpp.router;
import com.juick.server.xmpp.s2s.BasicXmppSession;
import org.slf4j.Logger;
diff --git a/juick-www/src/test/java/com/juick/server/XmlUtils.java b/juick-server/src/main/java/com/juick/server/xmpp/router/XmlUtils.java
index 85fd352c..7579489f 100644
--- a/juick-www/src/test/java/com/juick/server/XmlUtils.java
+++ b/juick-server/src/main/java/com/juick/server/xmpp/router/XmlUtils.java
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-package com.juick.server;
+package com.juick.server.xmpp.router;
import java.io.IOException;
diff --git a/juick-www/src/test/java/com/juick/WebAppTests.java b/juick-www/src/test/java/com/juick/WebAppTests.java
index 43198859..f644bef8 100644
--- a/juick-www/src/test/java/com/juick/WebAppTests.java
+++ b/juick-www/src/test/java/com/juick/WebAppTests.java
@@ -23,14 +23,10 @@ import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.css.StyleElement;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.juick.Message;
-import com.juick.Tag;
-import com.juick.User;
import com.juick.server.XMPPConnection;
-import com.juick.server.XMPPRouter;
+import com.juick.server.xmpp.router.XMPPRouter;
import com.juick.server.XMPPServer;
import com.juick.server.configuration.ApiAppConfiguration;
-import com.juick.server.configuration.BaseWebConfiguration;
import com.juick.service.*;
import com.juick.util.MessageUtils;
import com.juick.www.WebApp;
@@ -43,23 +39,18 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.mock.web.MockMultipartFile;
-import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.FileSystemUtils;
-import org.springframework.web.servlet.resource.ResourceUrlProvider;
import javax.inject.Inject;
import javax.servlet.http.Cookie;