Author: tfennelly
Date: 2010-04-06 10:12:21 -0400 (Tue, 06 Apr 2010)
New Revision: 21288
Removed:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DBExtractTransformConfigFileTestCase.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DatasourcesConfigFileTestCase.java
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/core/test/SmooksCoreAllTests.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/AbstractSmooks11ModelTestCase.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/BaseTestCase.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6150
import org.jboss.tools.smooks.model.calc.provider cannot be resolved
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/core/test/SmooksCoreAllTests.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/core/test/SmooksCoreAllTests.java 2010-04-06
12:34:42 UTC (rev 21287)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/core/test/SmooksCoreAllTests.java 2010-04-06
14:12:21 UTC (rev 21288)
@@ -9,8 +9,6 @@
import org.jboss.tools.smooks.test.jsonparse.JsonParserTest;
import org.jboss.tools.smooks.test.model11.BindingConfigFileTestCase;
import org.jboss.tools.smooks.test.model11.Csv2XMLConfigFileTestCase;
-import org.jboss.tools.smooks.test.model11.DBExtractTransformConfigFileTestCase;
-import org.jboss.tools.smooks.test.model11.DatasourcesConfigFileTestCase;
import org.jboss.tools.smooks.test.model11.EDI2JavaConfigFileTestCase;
import org.jboss.tools.smooks.test.model11.EdiOrderparserConfigFileTestCase;
import org.jboss.tools.smooks.test.model11.ParseConfigFileTestCase;
@@ -24,10 +22,7 @@
suite.addTestSuite(EDIParserTest.class);
suite.addTestSuite(JsonParserTest.class);
suite.addTestSuite(BindingConfigFileTestCase.class);
- suite.addTestSuite(DatasourcesConfigFileTestCase.class);
suite.addTestSuite(Csv2XMLConfigFileTestCase.class);
- suite.addTestSuite(DatasourcesConfigFileTestCase.class);
- suite.addTestSuite(DBExtractTransformConfigFileTestCase.class);
suite.addTestSuite(EDI2JavaConfigFileTestCase.class);
suite.addTestSuite(EdiOrderparserConfigFileTestCase.class);
suite.addTestSuite(ParseConfigFileTestCase.class);
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/AbstractSmooks11ModelTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/AbstractSmooks11ModelTestCase.java 2010-04-06
12:34:42 UTC (rev 21287)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/AbstractSmooks11ModelTestCase.java 2010-04-06
14:12:21 UTC (rev 21288)
@@ -22,22 +22,14 @@
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.jboss.tools.smooks.model.calc.provider.CalcItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.common.provider.CommonItemProviderAdapterFactory;
-import
org.jboss.tools.smooks.model.datasource.provider.DatasourceItemProviderAdapterFactory;
-import
org.jboss.tools.smooks.model.dbrouting.provider.DbroutingItemProviderAdapterFactory;
-import
org.jboss.tools.smooks.model.fileRouting.provider.FileRoutingItemProviderAdapterFactory;
import
org.jboss.tools.smooks.model.freemarker.provider.FreemarkerItemProviderAdapterFactory;
-import org.jboss.tools.smooks.model.groovy.provider.GroovyItemProviderAdapterFactory;
-import
org.jboss.tools.smooks.model.iorouting.provider.IoroutingItemProviderAdapterFactory;
-import
org.jboss.tools.smooks.model.jmsrouting.provider.JmsroutingItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.medi.DocumentRoot;
import org.jboss.tools.smooks.model.medi.MappingNode;
import org.jboss.tools.smooks.model.medi.provider.MEdiItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.util.SmooksResourceFactoryImpl;
-import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
/**
*
@@ -61,20 +53,12 @@
adapterFactory = new
ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new XslItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new FreemarkerItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new CommonItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new SmooksItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new MEdiItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new IoroutingItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new JmsroutingItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new DbroutingItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new DatasourceItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new CalcItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new GroovyItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new FileRoutingItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
BasicCommandStack commandStack = new BasicCommandStack();
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/BaseTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/BaseTestCase.java 2010-04-06
12:34:42 UTC (rev 21287)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/BaseTestCase.java 2010-04-06
14:12:21 UTC (rev 21288)
@@ -6,27 +6,14 @@
import junit.framework.TestCase;
import org.eclipse.emf.ecore.EPackage.Registry;
-import org.jboss.tools.smooks.model.calc.CalcPackage;
import org.jboss.tools.smooks.model.common.CommonPackage;
import org.jboss.tools.smooks.model.csv12.Csv12Package;
-import org.jboss.tools.smooks.model.datasource.DatasourcePackage;
-import org.jboss.tools.smooks.model.dbrouting.DbroutingPackage;
import org.jboss.tools.smooks.model.edi12.Edi12Package;
-import org.jboss.tools.smooks.model.esbrouting.EsbroutingPackage;
-import org.jboss.tools.smooks.model.fileRouting.FileRoutingPackage;
import org.jboss.tools.smooks.model.freemarker.FreemarkerPackage;
-import org.jboss.tools.smooks.model.groovy.GroovyPackage;
-import org.jboss.tools.smooks.model.iorouting.IoroutingPackage;
import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
-import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
-import org.jboss.tools.smooks.model.jmsrouting12.Jmsrouting12Package;
import org.jboss.tools.smooks.model.json12.Json12Package;
import org.jboss.tools.smooks.model.medi.MEdiPackage;
-import org.jboss.tools.smooks.model.persistence12.Persistence12Package;
-import org.jboss.tools.smooks.model.rules10.Rules10Package;
import org.jboss.tools.smooks.model.smooks.SmooksPackage;
-import org.jboss.tools.smooks.model.validation10.Validation10Package;
-import org.jboss.tools.smooks.model.xsl.XslPackage;
/**
* @author Dart
@@ -39,27 +26,14 @@
// smooks 1.2
Registry.INSTANCE.put(Javabean12Package.eNS_URI, Javabean12Package.eINSTANCE);
Registry.INSTANCE.put(Json12Package.eNS_URI, Json12Package.eINSTANCE);
- Registry.INSTANCE.put(Jmsrouting12Package.eNS_URI, Jmsrouting12Package.eINSTANCE);
- Registry.INSTANCE.put(Validation10Package.eNS_URI, Validation10Package.eINSTANCE);
- Registry.INSTANCE.put(Rules10Package.eNS_URI, Rules10Package.eINSTANCE);
- Registry.INSTANCE.put(Persistence12Package.eNS_URI, Persistence12Package.eINSTANCE);
Registry.INSTANCE.put(Csv12Package.eNS_URI, Csv12Package.eINSTANCE);
Registry.INSTANCE.put(Edi12Package.eNS_URI, Edi12Package.eINSTANCE);
// smooks 1.1.2 and smooks 1.0
Registry.INSTANCE.put(SmooksPackage.eNS_URI, SmooksPackage.eINSTANCE);
- Registry.INSTANCE.put(CalcPackage.eNS_URI, CalcPackage.eINSTANCE);
Registry.INSTANCE.put(CommonPackage.eNS_URI, CommonPackage.eINSTANCE);
- Registry.INSTANCE.put(DatasourcePackage.eNS_URI, DatasourcePackage.eINSTANCE);
- Registry.INSTANCE.put(DbroutingPackage.eNS_URI, DbroutingPackage.eINSTANCE);
- Registry.INSTANCE.put(FileRoutingPackage.eNS_URI, FileRoutingPackage.eINSTANCE);
Registry.INSTANCE.put(FreemarkerPackage.eNS_URI, FreemarkerPackage.eINSTANCE);
- Registry.INSTANCE.put(GroovyPackage.eNS_URI, GroovyPackage.eINSTANCE);
- Registry.INSTANCE.put(IoroutingPackage.eNS_URI, IoroutingPackage.eINSTANCE);
- Registry.INSTANCE.put(JmsroutingPackage.eNS_URI, JmsroutingPackage.eINSTANCE);
Registry.INSTANCE.put(MEdiPackage.eNS_URI, MEdiPackage.eINSTANCE);
- Registry.INSTANCE.put(XslPackage.eNS_URI, XslPackage.eINSTANCE);
- Registry.INSTANCE.put(EsbroutingPackage.eNS_URI, EsbroutingPackage.eINSTANCE);
}
public void testNull(){//ignore
}
Deleted:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DBExtractTransformConfigFileTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DBExtractTransformConfigFileTestCase.java 2010-04-06
12:34:42 UTC (rev 21287)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DBExtractTransformConfigFileTestCase.java 2010-04-06
14:12:21 UTC (rev 21288)
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.test.model11;
-
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.jboss.tools.smooks.model.dbrouting.Executor;
-import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
-import org.jboss.tools.smooks.model.smooks.ImportType;
-import org.jboss.tools.smooks.model.smooks.ParamType;
-import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
-
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- *
- */
-public class DBExtractTransformConfigFileTestCase extends AbstractSmooks11ModelTestCase
{
-
- @Override
- protected String getFilePath() {
- return
"org/jboss/tools/smooks/test/model/configfiles/smooks112/db-extract-transform-load.xml";
- }
-
- @Override
- public void testModel() {
- SmooksResourceListType resourceConfig = getSmooksResourceList11();
-
- Assert.assertNotNull(resourceConfig);
-
- Assert.assertEquals("stream.filter.type",
resourceConfig.getParams().getParam().get(0).getName());
- Assert.assertEquals("SAX", ((ParamType)
resourceConfig.getParams().getParam().get(0)).getStringValue());
-
- List<AbstractResourceConfig> imports =
resourceConfig.getAbstractResourceConfig();
- int importCount = 0;
- int executorCount = 0;
- for (Iterator<?> iterator = imports.iterator(); iterator.hasNext();) {
- AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig)
iterator.next();
- if(abstractResourceConfig instanceof ImportType){
- if(importCount <=2){
- ImportType import1 = (ImportType)abstractResourceConfig;
- if(importCount == 0){
- Assert.assertEquals("edi-orders-parser.xml", import1.getFile());
- }
- if(importCount == 1){
- Assert.assertEquals("datasources.xml", import1.getFile());
- }
- if(importCount == 2){
- Assert.assertEquals("bindings.xml", import1.getFile());
- }
- importCount++;
- }
- }
-
- if(abstractResourceConfig instanceof Executor){
- if(executorCount <= 2){
- Executor executor = (Executor)abstractResourceConfig;
- if(executorCount == 0){
- Assert.assertEquals("customer-details", executor.getExecuteOnElement());
- Assert.assertEquals("DBExtractTransformLoadDS",
executor.getDatasource());
- Assert.assertEquals(true, executor.isExecuteBefore());
- Assert.assertEquals("select ORDERNUMBER from ORDERS where ORDERNUMBER =
${order.orderNum}", executor.getStatement().trim());
- Assert.assertEquals("orderExistsRS", executor.getResultSet().getName());
- }
- if(executorCount == 1){
- Assert.assertEquals("customer-details", executor.getExecuteOnElement());
- Assert.assertEquals("DBExtractTransformLoadDS",
executor.getDatasource());
- Assert.assertEquals(false, executor.isExecuteBefore());
- Assert.assertEquals("INSERT INTO ORDERS VALUES(${order.orderNum},
${order.customerUname}, ${order.status}, ${order.net}, ${order.total},
${message.date})", executor.getStatement().trim());
- Assert.assertEquals("orderExistsRS.isEmpty()",
executor.getCondition().getStringValue());
- }
- if(executorCount == 2){
- Assert.assertEquals("order-item", executor.getExecuteOnElement());
- Assert.assertEquals("DBExtractTransformLoadDS",
executor.getDatasource());
- Assert.assertEquals(false, executor.isExecuteBefore());
- Assert.assertEquals("INSERT INTO ORDERITEMS VALUES (${order.orderNum},
${orderItem.quantity}, ${orderItem.productId}, ${orderItem.title},
${orderItem.price})", executor.getStatement().trim());
- Assert.assertEquals("orderExistsRS.isEmpty()",
executor.getCondition().getStringValue());
- }
- executorCount ++;
- }
- }
- }
-
- Assert.assertEquals(3, executorCount);
- Assert.assertEquals(3, importCount);
- }
-
-}
Deleted:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DatasourcesConfigFileTestCase.java
===================================================================
---
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DatasourcesConfigFileTestCase.java 2010-04-06
12:34:42 UTC (rev 21287)
+++
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/model11/DatasourcesConfigFileTestCase.java 2010-04-06
14:12:21 UTC (rev 21288)
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.test.model11;
-
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.jboss.tools.smooks.model.datasource.Direct;
-import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
-import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
-
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- *
- */
-public class DatasourcesConfigFileTestCase extends AbstractSmooks11ModelTestCase {
-
- @Override
- protected String getFilePath() {
- return
"org/jboss/tools/smooks/test/model/configfiles/smooks112/datasources.xml";
- }
-
- @Override
- public void testModel() {
- SmooksResourceListType resourceConfig = getSmooksResourceList11();
-
- Assert.assertNotNull(resourceConfig);
- List<AbstractResourceConfig> readerList =
resourceConfig.getAbstractResourceConfig();
- Assert.assertEquals(readerList.size(), 1);
-
- Direct direct = (Direct) readerList.get(0);
-
- Assert.assertEquals("$document", direct.getBindOnElement());
- Assert.assertEquals("DBExtractTransformLoadDS", direct.getDatasource());
- Assert.assertEquals("org.hsqldb.jdbcDriver", direct.getDriver());
- Assert.assertEquals("jdbc:hsqldb:hsql://localhost:9201/milyn-hsql-9201",
direct.getUrl());
- Assert.assertEquals("sa", direct.getUsername());
- Assert.assertEquals("$document", direct.getBindOnElement());
- Assert.assertEquals(false, direct.isAutoCommit());
- }
-
-}