-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add standalone sequence reset in engine startup (#535)
* Add standalone sequence reset in engine startup * Add integration tests for standalone mode * Exclude test from non-HSQL workflows
- Loading branch information
Showing
4 changed files
with
94 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
.../jqm-integration-tests/src/test/java/com/enioka/jqm/integration/tests/StandaloneTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.enioka.jqm.integration.tests; | ||
|
||
import java.net.Inet4Address; | ||
import java.net.UnknownHostException; | ||
import java.util.Properties; | ||
|
||
import com.enioka.jqm.model.GlobalParameter; | ||
import com.enioka.jqm.model.Node; | ||
import com.enioka.jqm.test.helpers.CreationTools; | ||
import com.enioka.jqm.test.helpers.TestHelpers; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.ops4j.pax.exam.Option; | ||
|
||
import static com.enioka.jqm.shared.misc.StandaloneHelpers.ipFromId; | ||
|
||
public class StandaloneTest extends JqmBaseTest { | ||
private Node n; | ||
private Properties p; | ||
private String localIp; | ||
|
||
@Override | ||
protected Option[] moreOsgiconfig() | ||
{ | ||
return webConfig(); | ||
} | ||
|
||
@Before | ||
public void before() throws UnknownHostException { | ||
// ///// Disabled for non-HSQLDB runners | ||
|
||
AssumeHsqldb(); | ||
|
||
// ///// Standalone setup | ||
|
||
localIp = Inet4Address.getLocalHost().getHostAddress(); | ||
GlobalParameter.setParameter(cnx, "wsStandaloneMode", "true"); | ||
cnx.commit(); | ||
} | ||
|
||
@Test | ||
public void testStandaloneJobIdMatchesIp() { | ||
addAndStartEngine(); | ||
CreationTools.createJobDef(null, true, "App", null, "jqm-tests/jqm-test-datetimemaven/target/test.jar", TestHelpers.qVip, 42, | ||
"MarsuApplication", null, "Franquin", "ModuleMachin", "other", "other", false, cnx); | ||
long generatedId = jqmClient.newJobRequest("MarsuApplication", "TestUser").enqueue(); | ||
|
||
Assert.assertEquals("Generated ID was " + generatedId, localIp, ipFromId(generatedId)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.