camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zregv...@apache.org
Subject [1/6] camel git commit: CAMEL-10857 Make Salesforce integration tests w...
Date Tue, 07 Mar 2017 20:24:09 GMT
Repository: camel
Updated Branches:
  refs/heads/master b877b4584 -> ee55a3bc6


http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/it/resources/salesforce/profiles/Work%2Ecom
Only User.profile
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/it/resources/salesforce/profiles/Work%2Ecom Only
User.profile b/components/camel-salesforce/it/resources/salesforce/profiles/Work%2Ecom Only
User.profile
new file mode 100644
index 0000000..e2e2d2a
--- /dev/null
+++ b/components/camel-salesforce/it/resources/salesforce/profiles/Work%2Ecom Only User.profile

@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
+    <applicationVisibilities>
+        <application>Warehouse</application>
+        <default>false</default>
+        <visible>false</visible>
+    </applicationVisibilities>
+    <classAccesses>
+        <apexClass>MerchandiseRestResource</apexClass>
+        <enabled>false</enabled>
+    </classAccesses>
+    <classAccesses>
+        <apexClass>MerchandiseRestResourceTests</apexClass>
+        <enabled>false</enabled>
+    </classAccesses>
+    <classAccesses>
+        <apexClass>UpdateProfile</apexClass>
+        <enabled>false</enabled>
+    </classAccesses>
+    <custom>false</custom>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Account.Shipping_Location__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Invoice__c.Status__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Line_Item__c.Merchandise__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Line_Item__c.Unit_Price__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Line_Item__c.Units_Sold__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <fieldPermissions>
+        <editable>true</editable>
+        <field>Merchandise__c.Description__c</field>
+        <readable>true</readable>
+    </fieldPermissions>
+    <layoutAssignments>
+        <layout>Invoice__c-Invoice Layout</layout>
+    </layoutAssignments>
+    <layoutAssignments>
+        <layout>Line_Item__c-Line Item Layout</layout>
+    </layoutAssignments>
+    <layoutAssignments>
+        <layout>Merchandise__c-Merchandise Layout</layout>
+    </layoutAssignments>
+    <tabVisibilities>
+        <tab>Invoice__c</tab>
+        <visibility>Hidden</visibility>
+    </tabVisibilities>
+    <tabVisibilities>
+        <tab>Merchandise__c</tab>
+        <visibility>Hidden</visibility>
+    </tabVisibilities>
+    <userLicense>Work.com Only</userLicense>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ApiEnabled</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>AssignTopics</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ChatterEditOwnPost</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ChatterFileLink</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ChatterInternalUser</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ChatterInviteExternalUsers</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ChatterOwnGroups</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>CreateCustomizeDashboards</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>CreateCustomizeFilters</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>CreateCustomizeReports</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>CreateTopics</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditEvent</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditMyDashboards</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditMyReports</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditPublicDocuments</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditTask</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EditTopics</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EmailMass</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EmailSingle</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>EnableNotifications</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>RunReports</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>SelectFilesFromSalesforce</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ShowCompanyNameAsUserBadge</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ViewHelpLink</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ViewPublicDashboards</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>ViewPublicReports</name>
+    </userPermissions>
+    <userPermissions>
+        <enabled>true</enabled>
+        <name>WorkDotComUserPerm</name>
+    </userPermissions>
+</Profile>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports-meta.xml
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports-meta.xml
b/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports-meta.xml
new file mode 100644
index 0000000..12a57b6
--- /dev/null
+++ b/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports-meta.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<ReportFolder xmlns="http://soap.sforce.com/2006/04/metadata">
+    <name>Test Reports</name>
+</ReportFolder>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports/Test_Report.report
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports/Test_Report.report
b/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports/Test_Report.report
new file mode 100644
index 0000000..1016d98
--- /dev/null
+++ b/components/camel-salesforce/it/resources/salesforce/reports/Test_Reports/Test_Report.report
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<Report xmlns="http://soap.sforce.com/2006/04/metadata">
+    <columns>
+        <field>USERS.NAME</field>
+    </columns>
+    <columns>
+        <field>ACCOUNT.NAME</field>
+    </columns>
+    <columns>
+        <field>TYPE</field>
+    </columns>
+    <columns>
+        <field>RATING</field>
+    </columns>
+    <columns>
+        <field>DUE_DATE</field>
+    </columns>
+    <columns>
+        <field>LAST_UPDATE</field>
+    </columns>
+    <columns>
+        <field>ADDRESS1_STATE</field>
+    </columns>
+    <format>Tabular</format>
+    <name>Test Report</name>
+    <params>
+        <name>co</name>
+        <value>1</value>
+    </params>
+    <reportType>AccountList</reportType>
+    <scope>user</scope>
+    <showDetails>true</showDetails>
+    <timeFrameFilter>
+        <dateColumn>CREATED_DATE</dateColumn>
+        <interval>INTERVAL_CUSTOM</interval>
+        <startDate>2016-10-21</startDate>
+    </timeFrameFilter>
+</Report>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/it/resources/salesforce/tabs/Invoice__c.tab
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/it/resources/salesforce/tabs/Invoice__c.tab b/components/camel-salesforce/it/resources/salesforce/tabs/Invoice__c.tab
new file mode 100644
index 0000000..9989093
--- /dev/null
+++ b/components/camel-salesforce/it/resources/salesforce/tabs/Invoice__c.tab
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
+    <customObject>true</customObject>
+    <mobileReady>false</mobileReady>
+    <motif>Custom18: Form</motif>
+</CustomTab>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/it/resources/salesforce/tabs/Merchandise__c.tab
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/it/resources/salesforce/tabs/Merchandise__c.tab b/components/camel-salesforce/it/resources/salesforce/tabs/Merchandise__c.tab
new file mode 100644
index 0000000..14f3543
--- /dev/null
+++ b/components/camel-salesforce/it/resources/salesforce/tabs/Merchandise__c.tab
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
+    <customObject>true</customObject>
+    <mobileReady>false</mobileReady>
+    <motif>Custom21: Computer</motif>
+</CustomTab>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/pom.xml b/components/camel-salesforce/pom.xml
index 258710b..dea2bb3 100644
--- a/components/camel-salesforce/pom.xml
+++ b/components/camel-salesforce/pom.xml
@@ -35,6 +35,10 @@
         <module>camel-salesforce-maven-plugin</module>
     </modules>
 
+    <properties>
+      <salesforce.component.root>${project.basedir}</salesforce.component.root>
+    </properties>
+
  <build>
     <plugins>
       <plugin>
@@ -75,7 +79,7 @@
               <artifactId>maven-enforcer-plugin</artifactId>
               <executions>
                 <execution>
-                  <id>test-salesforce-login-properties-exists</id>
+                  <id>salesforce-integration-test-prerequisites</id>
                   <goals>
                     <goal>enforce</goal>
                   </goals>
@@ -83,8 +87,46 @@
                     <rules>
                       <requireFilesExist>
                         <files>
-                         <file>../test-salesforce-login.properties</file>
+                          <file>${salesforce.component.root}/it/resources/migration-tool/ant-salesforce.jar</file>
                         </files>
+                        <message><![CDATA[Salesforce Migration Tool required
+
+You need to download the Salesforce Migration Tool (ZIP file) and 
+extract the `ant-salesforce.jar` out of it to:
+
+${salesforce.component.root}/it/resources/migration-tool/ant-salesforce.jar
+
+It's needed by the integration tests to setup the Salesforce instance
+with custom sObjects/fields that are required by the tests.
+
+Have a look at:
+
+${salesforce.component.root}/it/resources/salesforce
+
+To see what will be done.
+
+For information and download of the Salesforce Migration Tool consult:
+
+https://developer.salesforce.com/page/Force.com_Migration_Tool]]></message>
+                      </requireFilesExist>
+                      <requireFilesExist>
+                        <files>
+                          <file>${salesforce.component.root}/test-salesforce-login.properties</file>
+                        </files>
+                        <message><![CDATA[Salesforce Authentication information
needed
+
+You need to create a Java properties file at:
+
+${salesforce.component.root}/test-salesforce-login.properties
+
+With authentication information to access a Salesforce instance.
+You can use:
+
+${salesforce.component.root}/test-salesforce-login.properties.sample
+
+as reference. A free Salesforce developer account can be obtained at:
+
+https://developer.salesforce.com]]></message>
                       </requireFilesExist>
                     </rules>
                     <fail>true</fail>
@@ -92,23 +134,6 @@
                 </execution>
               </executions>
             </plugin>
-            <plugin>
-              <artifactId>maven-surefire-plugin</artifactId>
-              <configuration>
-                <childDelegation>false</childDelegation>
-                <useFile>true</useFile>
-                <forkCount>1</forkCount>
-                <reuseForks>true</reuseForks>
-                <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
-                <excludes>
-                  <exclude>**/*XXXTest.java</exclude>
-                </excludes>
-                <includes>
-                  <include>**/*Test.java</include>
-                </includes>
-                <trimStackTrace>false</trimStackTrace>
-              </configuration>
-            </plugin>
           </plugins>
         </build>
       </profile>

http://git-wip-us.apache.org/repos/asf/camel/blob/ee55a3bc/components/camel-salesforce/test-salesforce-login.properties.sample
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/test-salesforce-login.properties.sample b/components/camel-salesforce/test-salesforce-login.properties.sample
new file mode 100644
index 0000000..dc268f6
--- /dev/null
+++ b/components/camel-salesforce/test-salesforce-login.properties.sample
@@ -0,0 +1,70 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You 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.
+## ---------------------------------------------------------------------------
+
+# In order to run the integration tests you need a Salesforce Developer
+# account. You can get a Salesforce Developer account by visiting 
+# https://developer.salesforce.com and sign up for one.
+#
+# The connected application can be created for you by running the
+# migrations from Maven, run:
+#
+#     $ mvn -Pintegration antrun:run@setup-salesforce-instance
+#
+# from camel-salesforce-component directory, or you can setup your own
+# connected application by going to your Salesforce Developer account 
+# and under Apps in Build and Create sections click New in Connected
+# Apps section. Fill in the required fields and in the API (Enable OAuth
+# Settings) section thick Enable OAuth Settings and move all scopes from
+# Available OAuth Scopes to Selected OAuth Scopes.
+#
+# For Callback URL you can use:
+# https://login.salesforce.com/services/oauth2/success
+# it's not needed by the REST API used by the Camel Salesforce 
+# component but it makes it easier to obtain the refresh token.
+# From there make note of the parameters and fill in below:
+
+# This is the Consumer Key of the connected application
+# This `clientId` is setup by the migration run at the start of 
+# integration tests (when run from Maven):
+# clientId = 3MVG9HxRZv05HarQ5D2to.ylPaUg7uaFqGqE2wN6_RRaHM9PTa3SWT8UwKJzXAyCujHrfObkUy7oZqiBUyfGl
+#
+clientId = <Your Consumer Key>
+
+# This is Consumer Secret of the connected application
+# If you use the above clientId (3MV...Gl) get the Consumer Secret from
+# your Salesforce instance after migration run, access your Salesforce
+# instance and get the Consumer Secret from there for 
+# CamelSalesforceIntegrationTests connected application
+clientSecret = <Your Consumer Secret>
+
+# This is the username for the Salesforce account, you can use your own
+# developer account, or add another user to your Salesforce instance,
+# but make sure that it has administrative rights
+userName = <Your Salesforce username>
+
+# You can use refresh token instead of userName and password parameters
+refreshToken = <Your Refresh token>
+
+# Password of the user above, if you're using security tokens, generate
+# one and append it to the end of the password
+password = <Your Salesforce password>[Your security token, if used]
+
+# This should be https://login.salesforce.com/, change if appropriate
+loginUrl = https://login.salesforce.com/
+
+# Remains, TODO remove this
+report.0 = Test_Report


Mime
View raw message