Skip to content

Commit

Permalink
AS7-6374 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Rastseluev authored and bstansberry committed Jan 22, 2013
1 parent 261609a commit dbec1f5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
Expand Up @@ -38,6 +38,7 @@
import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.assertTrue;
import static junit.framework.Assert.fail;


/** /**
* Resource adapters configuration and metrics unit test. * Resource adapters configuration and metrics unit test.
Expand Down Expand Up @@ -191,7 +192,16 @@ public void testBoolPresProperties() throws Exception {
assertTrue(readAttribute(address1, "security-application").asBoolean()); assertTrue(readAttribute(address1, "security-application").asBoolean());
assertTrue(readAttribute(address1, "wrap-xa-resource").asBoolean()); assertTrue(readAttribute(address1, "wrap-xa-resource").asBoolean());
assertFalse(readAttribute(address1, "pad-xid").asBoolean()); assertFalse(readAttribute(address1, "pad-xid").asBoolean());
removeRa(); assertFalse(readAttribute(address1, "same-rm-override").isDefined());
try{
readAttribute(address1, "same-rm-override").asBoolean();
fail("Got boolean value of undefined parameter");
}catch(Exception e){
//Expected
}
finally{
removeRa();
}
} }


@Test @Test
Expand Down
Expand Up @@ -23,17 +23,14 @@
package org.jboss.as.test.integration.jca.metrics; package org.jboss.as.test.integration.jca.metrics;




import junit.framework.Assert;
import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.test.integration.management.jca.DsMgmtTestBase; import org.jboss.as.test.integration.management.jca.DsMgmtTestBase;
import org.jboss.dmr.ModelNode;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;


import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.*;
import static junit.framework.Assert.assertTrue;


/** /**
* XA datasource configuration and metrics unit test. * XA datasource configuration and metrics unit test.
Expand Down Expand Up @@ -67,7 +64,17 @@ public void testNoXaDsProperties() throws Exception {
public void testDefaultXaDsProperties() throws Exception { public void testDefaultXaDsProperties() throws Exception {
setModel("xa-default-properties.xml"); setModel("xa-default-properties.xml");
assertTrue(readAttribute(baseAddress, "wrap-xa-resource").asBoolean()); assertTrue(readAttribute(baseAddress, "wrap-xa-resource").asBoolean());
removeDs(); assertFalse(readAttribute(baseAddress, "same-rm-override").isDefined());
try{
readAttribute(baseAddress, "same-rm-override").asBoolean();
fail("Got boolean value of undefined parameter");
}catch(Exception e){
//Expected
}
finally{
removeDs();
}

} }


@Test @Test
Expand Down Expand Up @@ -120,7 +127,7 @@ public void testStatistics() throws Exception {
public void testRollbackCleanup() throws Exception { public void testRollbackCleanup() throws Exception {
try { try {
setBadModel("wrong-xa-bogus-driver.xml"); setBadModel("wrong-xa-bogus-driver.xml");
Assert.fail("bad model did not produce an exception"); fail("bad model did not produce an exception");
} catch (Exception e) { } catch (Exception e) {
// Confirm a correct model adding the same resources can be added // Confirm a correct model adding the same resources can be added
testDefaultXaDsAttributes(); testDefaultXaDsAttributes();
Expand Down

0 comments on commit dbec1f5

Please sign in to comment.