Giter VIP home page Giter VIP logo

tigase-tts-ng's Introduction

Tigase Monitor screenshot

Tigase Logo Build Status

Tigase TTS-NG

XMPP funcional test framework with sizeable suite of tests based on the jaxmpp2 and TestNG framework as a successor of tigase-testsuite

Current results for Tigase XMPP Server can be found on our pages: Stable and Snapshot releases

Features

  • Over 200 funcional XMPP tests:
    • Core XMPP
    • MultiUserChat
    • PubSub
    • MAM
  • Easy, automatic operation
  • Easy way to add more tests
  • (Optional) Downloading latest release of Tigase XMPP Server
  • (Optional) Automatic preparaion of the database, supports:
    • MySQL
    • PostgreSQL
    • Derby
    • MongoDB
    • MS SQL Server

How to Start

Running

The whole suite execution can be handled via $ ./scripts/tests-runner.sh shell script. Executing it without any parameters will yield help:

$ ./scripts/tests-runner.sh
Run selected or all tests for defined server
----
  --all-tests [(database)] :: Run all available tests
          (database) is an array, if database is missing tests will be run against all configured ones
                     possible values: derby, mysql, postgresql, sqlserver, mongodb
  --custom <package.Class[#method]]> [(database)] :: Run defined test, accepts wildcards, eg.:
          --custom tigase.tests.util.RetrieveVersion
  --help :: print this help
----
  Special parameters only at the beginning of the parameters list
  --debug|-d                   Turns on debug mode
  --skip-rebuild-tts|-srb      Turns off rebuilding TTS-NG and only runs already build tests
  --skip-summary-page-get|-sp  Turns off automatic generation of Summary Page
  --download-latest|-dl        Turns on downloading latest Tigase Server release
  --reload-db|-db              Turns on reloading database
  --start-server|-serv         Turns on starting Tigase server
-----------
  Other possible parameters are in following order:
  [server-dir] [server-ip]

You should copy scripts/tests-runner-settings.dist.sh to scripts/tests-runner-settings.sh and adjust settings before running.

Adding new tests

The easiest way to add new test is to extend tigase.tests.AbstractTest (AbstractTest.java), take a look at ExampleJaxmppTest.java to get general idea:

package tigase.tests;

import org.testng.annotations.Test;
import tigase.jaxmpp.j2se.Jaxmpp;
import tigase.tests.utils.Account;

import static org.testng.Assert.assertTrue;
import static tigase.TestLogger.log;

public class ExampleJaxmppTest
		extends AbstractTest {

	@Test(groups = {"examples"}, description = "Simple test verifying logging in by the user")
	public void SimpleLoginTest() {

		try {
			log("This is test case");

			Jaxmpp contact = getAdminAccount().createJaxmpp().setConnected(true).build();

			assertTrue(contact.isConnected(), "contact was not connected");

			if (contact.isConnected()) {
				contact.disconnect();
			}

			Account createUserAccount = createAccount().setLogPrefix("test_user").build();
			Jaxmpp createJaxmpp = createUserAccount.createJaxmpp().build();
			createJaxmpp.login(true);

			assertTrue(createJaxmpp.isConnected(), "contact was not connected");

		} catch (Exception e) {
			fail(e);
		}
	}
}

Support

When looking for support, please first search for answers to your question in the available online channels:

If you didn't find an answer in the resources above, feel free to submit your question to either our community portal or open a support ticket

Compilation

It's a Maven project therefore after cloning the repository you can easily build it with:

mvn -Pdist clean install

License

Tigase Tigase Logo Official Tigase repository is available at: https://github.com/tigase/tigase-tts-ng/.

Copyright (c) 2004 Tigase, Inc.

Licensed under AGPL License Version 3. Other licensing options available upon request.

tigase-tts-ng's People

Contributors

arthef avatar bmalkow avatar dependabot[bot] avatar hantu85 avatar qianqianluo avatar woj-tek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

qianqianluo

tigase-tts-ng's Issues

When running ExampleJaxmppTest.SimpleLoginTest, the test account cannot be removed with timeout

But this test results Success.
tigase server version is 8.1.0, directly running in idea IDE. works correctly.
tigase-tts-ng version is almost the last SNAPSHOT.

the last output lines :

2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.auth.SaslModule.processSuccess: Authenticated
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.StreamFeaturesModule.streamRestarted: Pipelining is disabled
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus << <features xmlns="http://etherx.jabber.org/streams"><sm xmlns="urn:xmpp:sm:3"/><register xmlns="http://jabber.org/features/iq-register"/><csi xmlns="urn:xmpp:csi:0"/><ver xmlns="urn:xmpp:features:rosterver"/><sub xmlns="urn:xmpp:features:pre-approval"/><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"><optional/></session><c node="https://tigase.net/tigase-xmpp-server" xmlns="http://jabber.org/protocol/caps" ver="xj+zgrXefWpDvz0ASruxm5WX7Tw=" hash="SHA-1"/></features>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.auth.AuthModule.isAuthAvailable: saslSupportedfalse, nonSaslSupported: false
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus >> <iq xmlns="jabber:client" id="PsRat6HulTUcTaDBwqWjP5f" type="set"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource/></bind></iq>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus << <iq xmlns="jabber:client" type="result" to="test_user_3gvitq0001@wangjx-asus/35274740-tigase-8" id="PsRat6HulTUcTaDBwqWjP5f"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>test_user_3gvitq0001@wangjx-asus/35274740-tigase-8</jid></bind></iq>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.ResponseManager$1.process: Request id=PsRat6HulTUcTaDBwqWjP5f; Result received.
2020-07-31 18:14:41 | tigase.jaxmpp.j2se.Jaxmpp.onResourceBindSuccess: Connected. Resource binded.
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 >> <iq xmlns="jabber:client" id="GzakMKNDteDsmRSfAxhGKZm" type="set"><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/></iq>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 << <iq xmlns="jabber:client" type="result" to="test_user_3gvitq0001@wangjx-asus/35274740-tigase-8" id="GzakMKNDteDsmRSfAxhGKZm"/>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.ResponseManager$1.process: Request id=GzakMKNDteDsmRSfAxhGKZm; Result received.
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.streammng.StreamManagementModule.enable: Enabling stream management
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 >> <iq to="wangjx-asus" id="fls7wdCGvaPKRVYk9GFFEGs" type="get"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 >> <enable xmlns="urn:xmpp:sm:3" resume="true"/>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 << <iq xmlns="jabber:client" type="result" to="test_user_3gvitq0001@wangjx-asus/35274740-tigase-8" id="fls7wdCGvaPKRVYk9GFFEGs" from="wangjx-asus"><query xmlns="http://jabber.org/protocol/disco#info"><identity name="Tigase ver. 0.0.0" type="router" category="component"/><identity name="Tigase ver. 0.0.0" type="im" category="server"/><feature var="http://jabber.org/protocol/commands"/><feature var="urn:xmpp:carbons:2"/><feature var="http://jabber.org/protocol/stats"/><feature var="jabber:iq:auth"/><feature var="vcard-temp"/><feature var="http://jabber.org/protocol/amp"/><feature var="msgoffline"/><feature var="http://jabber.org/protocol/disco#info"/><feature var="http://jabber.org/protocol/disco#items"/><feature var="urn:xmpp:blocking"/><feature var="urn:xmpp:ping"/><feature var="urn:ietf:params:xml:ns:xmpp-sasl"/><feature var="urn:xmpp:push:0"/><feature var="tigase:push:encrypt:0"/><feature var="tigase:push:encrypt:aes-128-gcm"/><feature var="tigase:push:filter:ignore-unknown:0"/><feature var="tigase:push:filter:groupchat:0"/><feature var="tigase:push:priority:0"/><feature var="tigase:push:filter:muted:0"/><feature var="jabber:iq:roster"/><feature var="jabber:iq:roster-dynamic"/><feature var="jabber:iq:version"/><feature var="urn:xmpp:time"/><feature var="jabber:iq:privacy"/><feature var="urn:ietf:params:xml:ns:xmpp-bind"/><feature var="http://jabber.org/protocol/commands"/><feature var="urn:ietf:params:xml:ns:vcard-4.0"/><feature var="urn:ietf:params:xml:ns:xmpp-session"/><feature var="jabber:iq:private"/></query></iq>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 << <enabled xmlns="urn:xmpp:sm:3" resume="true" location="wangjx-asus" id="053cf1bf-e602-45a3-bcc9-087879f10d14" max="60"/>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 >> <iq id="JvU7hLONM09spUbzgUj0jXe" type="get"><query xmlns="jabber:iq:roster"/></iq>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.ResponseManager$1.process: Request id=fls7wdCGvaPKRVYk9GFFEGs; Result received.
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 << <iq xmlns="jabber:client" type="result" to="test_user_3gvitq0001@wangjx-asus/35274740-tigase-8" id="JvU7hLONM09spUbzgUj0jXe"><query xmlns="jabber:iq:roster"/></iq>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.streammng.StreamManagementModule.processStreamManagementEnabled: Stream management is enabled. id=053cf1bf-e602-45a3-bcc9-087879f10d14; resume=true
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.ResponseManager$1.process: Request id=JvU7hLONM09spUbzgUj0jXe; Result received.
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 >> <presence><c xmlns="http://jabber.org/protocol/caps" node="http://tigase.org/jaxmpp" ver="mg5bXbOeu1848vxdgu3jELgbQF8=" hash="sha-1"/></presence>
2020-07-31 18:14:41 | test_user :: test_user_3gvitq0001@wangjx-asus/35274740-tigase-8 << <presence xmlns="jabber:client" to="test_user_3gvitq0001@wangjx-asus" from="test_user_3gvitq0001@wangjx-asus/35274740-tigase-8"><c node="http://tigase.org/jaxmpp" xmlns="http://jabber.org/protocol/caps" ver="mg5bXbOeu1848vxdgu3jELgbQF8=" hash="sha-1"/></presence>
2020-07-31 18:14:41 | tigase.jaxmpp.core.client.xmpp.modules.presence.PresenceModule.process: Presence online from test_user_3gvitq0001@wangjx-asus/35274740-tigase-8


tearing down method tigase.tests.ExampleJaxmppTest.SimpleLoginTest()
2020-07-31 18:14:41 | Remove account as admin: test_user_3gvitq0001@wangjx-asus
2020-07-31 18:14:41 | admin :: admin@wangjx-asus/35274740-tigase-6 >> <iq to="sess-man@wangjx-asus" id="eDgzlY7qiJCJyt9qeXiT7yu" type="set"><command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#delete-user" action="execute"><x xmlns="jabber:x:data" type="submit"><field type="hidden" var="FORM_TYPE"><value>http://jabber.org/protocol/admin</value></field><field type="jid-multi" var="accountjids"><value>test_user_3gvitq0001@wangjx-asus</value></field></x></command></iq>
2020-07-31 18:14:41 | [Mutex] waiting for: [account:removed]
2020-07-31 18:14:56 | [Mutex] timeout. Not received [account:removed]


tearing down class tigase.tests.ExampleJaxmppTest = tigase.tests.ExampleJaxmppTest@383bfa16

thanks for all of your works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.