Skip to content

Commit

Permalink
[SHRINKDESC-21] Synced with POC from Andrew
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfbattenfeld committed Jun 23, 2012
1 parent fc78188 commit c05b49a
Show file tree
Hide file tree
Showing 35 changed files with 1,040 additions and 490 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.api.connector10.ConnectorDescriptor;
import org.jboss.shrinkwrap.descriptor.api.connector10.MutableConnectorDescriptor;
import org.jboss.shrinkwrap.descriptor.test.util.XmlAssert;
import org.junit.Test;

Expand All @@ -43,7 +44,7 @@ public void testSetName() throws Exception
@Test
public void testHornetQExample() throws Exception
{
ConnectorDescriptor jca10Generated = create()
MutableConnectorDescriptor jca10Generated = create().getRoot()
.displayName("Sample Adapter")
.description("It is a sample resource adapter")
.vendorName("JBoss")
Expand All @@ -69,7 +70,7 @@ public void testHornetQExample() throws Exception
.authenticationMechanismType("BasicPassword")
.credentialInterface("javax.resource.security.PasswordCredential").up()
.reauthenticationSupport("false")
.up();
.up().up();

String generatedRaXml = jca10Generated.exportAsString();
String originalRaXml = this.getResourceContents("src/test/resources/test-orig-connector10.xml");
Expand Down Expand Up @@ -98,9 +99,9 @@ private String getResourceContents(String resource) throws Exception
return builder.toString();
}

private ConnectorDescriptor create()
private MutableConnectorDescriptor create()
{
return Descriptors.create(ConnectorDescriptor.class);
return Descriptors.create(MutableConnectorDescriptor.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.text.SimpleDateFormat;
import java.util.TimeZone;

import org.jboss.datasources.api.DatasourcesDescriptor;
import org.jboss.datasources.api.MutableDatasourcesDescriptor;
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.test.util.XmlAssert;
import org.junit.Before;
Expand All @@ -25,8 +25,8 @@ public void init()
@Test
public void testGeneratedDataSourcesXml() throws Exception
{
DatasourcesDescriptor dataSourcesGenerated = create()
.addDefaultNamespaces()
MutableDatasourcesDescriptor dataSourcesGenerated = create().getRoot()
// .addDefaultNamespaces()
.createDatasource()
.jta(true).jndiName("jndi-name1").poolName("pool-name1")
.enabled(true).useJavaContext(true).spy(false).useCcm(true)
Expand Down Expand Up @@ -164,7 +164,7 @@ public void testGeneratedDataSourcesXml() throws Exception
.datasourceClass("datasource-class3")
.xaDatasourceClass("xa-datasource-class1")
.up()
.up();
.up().up();


String dataSourcesGeneratedXmlGenerated = dataSourcesGenerated.exportAsString();
Expand Down Expand Up @@ -193,9 +193,9 @@ private String getResourceContents(String resource) throws Exception
return builder.toString();
}

private DatasourcesDescriptor create()
private MutableDatasourcesDescriptor create()
{
return Descriptors.create(DatasourcesDescriptor.class);
return Descriptors.create(MutableDatasourcesDescriptor.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.TimeZone;

import org.jboss.ironjacamar.api.IronjacamarDescriptor;
import org.jboss.ironjacamar.api.MutableIronjacamarDescriptor;
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.test.util.XmlAssert;
import org.junit.Before;
Expand All @@ -25,8 +26,8 @@ public void init()
@Test
public void testGeneratedIronJacamarXml() throws Exception
{
IronjacamarDescriptor ironJacamarGenerated = create()
.addDefaultNamespaces()
MutableIronjacamarDescriptor ironJacamarGenerated = create().getRoot()
// .addDefaultNamespaces()
.getOrCreateBeanValidationGroups()
.beanValidationGroup("bean-validation-group0")
.beanValidationGroup("bean-validation-group1").up()
Expand Down Expand Up @@ -115,7 +116,7 @@ public void testGeneratedIronJacamarXml() throws Exception
.useJavaContext(true).poolName("pool-name7")
.createConfigProperty().name("name21").text("config-property10").up()
.createConfigProperty().name("name23").text("config-property11").up().up()
.up()
.up().up()
;

String ironJacamarXmlGenerated = ironJacamarGenerated.exportAsString();
Expand Down Expand Up @@ -144,9 +145,9 @@ private String getResourceContents(String resource) throws Exception
return builder.toString();
}

private IronjacamarDescriptor create()
private MutableIronjacamarDescriptor create()
{
return Descriptors.create(IronjacamarDescriptor.class);
return Descriptors.create(MutableIronjacamarDescriptor.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.text.SimpleDateFormat;
import java.util.TimeZone;

import org.jboss.resourceadapters.api.ResourceadapterDescriptor;
import org.jboss.resourceadapters.api.MutableResourceadapterDescriptor;
import org.jboss.shrinkwrap.descriptor.api.Descriptors;
import org.jboss.shrinkwrap.descriptor.test.util.XmlAssert;
import org.junit.Before;
Expand All @@ -25,8 +25,8 @@ public void init()
@Test
public void testGeneratedDataSourcesXml() throws Exception
{
ResourceadapterDescriptor resourceAdaptersGenerated = create()
.addDefaultNamespaces()
MutableResourceadapterDescriptor resourceAdaptersGenerated = create().getRoot()
// .addDefaultNamespaces()
.createResourceAdapter()
.archive("archive0")
.getOrCreateBeanValidationGroups()
Expand Down Expand Up @@ -192,7 +192,7 @@ public void testGeneratedDataSourcesXml() throws Exception
.useJavaContext(true).poolName("pool-name15")
.createConfigProperty().name("name45").text("config-property22").up()
.createConfigProperty().name("name47").text("config-property23").up().up()
.up().up()
.up().up().up()
;


Expand Down Expand Up @@ -222,9 +222,9 @@ private String getResourceContents(String resource) throws Exception
return builder.toString();
}

private ResourceadapterDescriptor create()
private MutableResourceadapterDescriptor create()
{
return Descriptors.create(ResourceadapterDescriptor.class);
return Descriptors.create(MutableResourceadapterDescriptor.class);
}

}
Loading

0 comments on commit c05b49a

Please sign in to comment.