diff --git a/build.gradle b/build.gradle index c006de3efb0c1094ac4d02302c3fc926a7d2b2e8..4bb935a5200b70b28446d848fff89d7abf868218 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.2.7' + classpath 'com.huawei.ohos:hap:2.4.4.2' classpath 'com.huawei.ohos:decctest:1.0.0.6' } } diff --git a/entry/src/main/config.json b/entry/src/main/config.json index b0141adf0af83e3b1a66bb220c2af960a95afa9d..1c5b1344046e83e6b868c0f04cf34376991932cd 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -3,7 +3,7 @@ "bundleName": "ua.naiksoftware.stompclientexample", "vendor": "naiksoftware", "version": { - "code": 1, + "code": 1000000, "name": "1.0" }, "apiVersion": { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 490fda8577df6c95960ba7077c43220e5bb2c0d9..0000000000000000000000000000000000000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index f59159e865d4b59feb1b8c44b001f62fc5d58df4..0000000000000000000000000000000000000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/lib/src/main/AndroidManifest.xml b/lib/src/main/AndroidManifest.xml deleted file mode 100644 index 58c8122038cfb49ab2aa283c8fe6104ca014fe9f..0000000000000000000000000000000000000000 --- a/lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/lib/src/main/config.json b/lib/src/main/config.json index 208ec5d75a0ba3afc9cce310fdf3d82690291124..ff6d779d340b68cf145e2830221428acaf8ac651 100644 --- a/lib/src/main/config.json +++ b/lib/src/main/config.json @@ -3,7 +3,7 @@ "bundleName": "ua.naiksoftware.stompclientexample", "vendor": "naiksoftware", "version": { - "code": 1, + "code": 1000000, "name": "1.0" }, "apiVersion": { diff --git a/lib/src/main/res/values/strings.xml b/lib/src/main/res/values/strings.xml deleted file mode 100644 index 2a3117c3ab758052eec496c2f90aefdce23cdde2..0000000000000000000000000000000000000000 --- a/lib/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - StompProtocolAndroid - diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy deleted file mode 100644 index da6b5eee4b4400f0ae67ceb652deff6e460d43ab..0000000000000000000000000000000000000000 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/Configuration.groovy +++ /dev/null @@ -1,38 +0,0 @@ -package ua.naiksoftware.stomp - -import com.andrewreitz.spock.android.AndroidSpecification -import groovy.util.logging.Slf4j -import org.testcontainers.containers.BindMode -import org.testcontainers.containers.GenericContainer -import org.testcontainers.containers.output.OutputFrame -import org.testcontainers.containers.startupcheck.StartupCheckStrategy -import org.testcontainers.containers.wait.strategy.Wait -import spock.lang.Shared -import spock.lang.Specification - -import java.util.function.Consumer - -class Configuration extends AndroidSpecification { - - @Shared - static GenericContainer testServer = setupServer() - - static GenericContainer setupServer() { - - def projectRoot = new File('../') - new ProcessBuilder(['./gradlew', 'test-server:bootJar']) - .directory(projectRoot) - .start().waitForProcessOutput(System.out as Appendable, System.err as Appendable) - - def testServerPath = new File(projectRoot.getAbsoluteFile().getParentFile().getParent(), - 'test-server/build/artifacts/test-server-1.0.jar').path - testServer = new GenericContainer('openjdk:8-jre-alpine') - .withFileSystemBind(testServerPath, '/app.jar', BindMode.READ_ONLY) - .withCommand('java -jar /app.jar') - .withLogConsumer({ frame -> println frame.utf8String }) -// .waitingFor(Wait.forHttp('/health')) - .withExposedPorts(8080) - testServer.start() - return testServer - } -} \ No newline at end of file diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy deleted file mode 100644 index 6dfbe8f967e4ee589ccbd193a976e8dc3bcf8ab0..0000000000000000000000000000000000000000 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/ConnectionTests.groovy +++ /dev/null @@ -1,32 +0,0 @@ -package ua.naiksoftware.stomp - - -import io.reactivex.functions.Predicate -import io.reactivex.subscribers.TestSubscriber -import ua.naiksoftware.stomp.dto.LifecycleEvent - -class ConnectionTests extends Configuration { - - def "connection must be opened"() { - given: - def client = Stomp.over(Stomp.ConnectionProvider.OKHTTP, - 'ws://' + Configuration.testServer.getContainerIpAddress() - + ':' + Configuration.testServer.getFirstMappedPort() + '/example-endpoint/websocket') - client.connect() - def testSubscriber = new TestSubscriber() - - when: - client.lifecycle().subscribe(testSubscriber) - - then: - testSubscriber.awaitCount(1).assertValue((Predicate) { event -> - if (event.exception) { - event.exception.printStackTrace() - } - return event.type == LifecycleEvent.Type.OPENED - }) - - cleanup: - client.disconnect() - } -} diff --git a/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy b/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy deleted file mode 100644 index f37fa40c95c34eab56f7188f80434bf72b36d342..0000000000000000000000000000000000000000 --- a/lib/src/test/groovy/ua/naiksoftware/stomp/PathMatcherTests.groovy +++ /dev/null @@ -1,28 +0,0 @@ -package ua.naiksoftware.stomp - -import ua.naiksoftware.stomp.dto.StompCommand -import ua.naiksoftware.stomp.dto.StompHeader -import ua.naiksoftware.stomp.dto.StompMessage -import ua.naiksoftware.stomp.pathmatcher.RabbitPathMatcher - -class PathMatcherTests extends Configuration { - - def "rmq-style matcher must return expected value"() { - given: - def matcher = new RabbitPathMatcher() - - expect: - matcher.matches(path, message(dest)) == value - - where: - path | dest | value - 'lorem/*/ipsum' | 'lorem/any/ipsum' | true - 'lorem/*/ipsum' | 'lorem/ipsum' | false - 'lorem/*/prefix*' | 'lorem/ipsum/prefix123'| true - 'lorem/*/pref*3' | 'lorem/ipsum/prefix123'| true - } - - def message(String dest) { - return new StompMessage(StompCommand.MESSAGE, [new StompHeader(StompHeader.DESTINATION, dest)], null) - } -}