2014-02-17 18:57:38 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Copyright the original author or authors
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2014-02-15 13:01:57 +01:00
|
|
|
package org.jivesoftware.smack;
|
|
|
|
|
2014-09-05 12:17:50 +02:00
|
|
|
import static org.junit.Assert.assertFalse;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
2014-02-15 13:01:57 +01:00
|
|
|
|
2014-09-05 12:17:50 +02:00
|
|
|
import org.junit.Ignore;
|
2014-02-15 13:01:57 +01:00
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
public class SmackConfigurationTest {
|
|
|
|
|
2018-03-28 15:56:04 +02:00
|
|
|
/**
|
|
|
|
* Test is Smack is able to initialize itself without throwing a Throwable.
|
|
|
|
*/
|
2014-02-15 13:01:57 +01:00
|
|
|
@Test
|
|
|
|
public void testSmackConfiguration() {
|
2018-03-28 15:56:04 +02:00
|
|
|
SmackConfiguration.getDefaultReplyTimeout();
|
2014-02-15 13:01:57 +01:00
|
|
|
}
|
2014-09-05 12:17:50 +02:00
|
|
|
|
|
|
|
// As there is currently no annotation/way to run a testclass/single test in a separate VM,
|
|
|
|
// which is required for reliable results of this test, and we don't want to fork a VM for
|
|
|
|
// *every* test, those tests are currently disabled. Hopefully this will change in the future.
|
2015-03-18 21:01:49 +01:00
|
|
|
@Ignore
|
2014-09-05 12:17:50 +02:00
|
|
|
@Test
|
|
|
|
public void smackConfigurationShouldNotCauseInitializationTest() {
|
2017-01-12 20:57:19 +01:00
|
|
|
SmackConfiguration.getDefaultReplyTimeout();
|
2014-09-05 12:17:50 +02:00
|
|
|
|
|
|
|
// Only a call to SmackConfiguration.getVersion() should cause Smack to become initialized.
|
|
|
|
assertFalse(SmackConfiguration.isSmackInitialized());
|
|
|
|
}
|
|
|
|
|
|
|
|
// As there is currently no annotation/way to run a testclass/single test in a separate VM,
|
|
|
|
// which is required for reliable results of this test, and we don't want to fork a VM for
|
|
|
|
// *every* test, those tests are currently disabled. Hopefully this will change in the future.
|
2015-03-18 21:01:49 +01:00
|
|
|
@Ignore
|
2014-09-05 12:17:50 +02:00
|
|
|
@Test
|
2020-11-08 22:27:57 +01:00
|
|
|
public void smackEnsureInitializedShouldInitialzieSmacktTest() {
|
|
|
|
Smack.ensureInitialized();
|
2014-09-05 12:17:50 +02:00
|
|
|
|
|
|
|
// Only a call to SmackConfiguration.getVersion() should cause Smack to become initialized.
|
|
|
|
assertTrue(SmackConfiguration.isSmackInitialized());
|
|
|
|
}
|
2014-02-15 13:01:57 +01:00
|
|
|
}
|