package jp.co.flect.formvalidation.salesforce;

import org.junit.Test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.io.File;
import jp.co.flect.salesforce.SalesforceClient;

public class SalesforceTest {
	
	@Test 
	public void test() throws Exception {
		String username = System.getProperty("SALESFORCE_USERNAME");
		String password = System.getProperty("SALESFORCE_PASSWORD");
		String secret = System.getProperty("SALESFORCE_SECURITY_TOKEN");
		
		SalesforceClient client = new SalesforceClient(new File("../enq/conf/salesforce/partner.wsdl"));
		client.login(username, password, secret);
	}
}

@@ -64,16 +64,46 @@
 t.Test;%0A
+import org.junit.BeforeClass;%0A
 import s
@@ -346,65 +346,610 @@
 nt;%0A
-%0Apublic class SalesforceTest %7B%0A%09%0A%09@Test %0A%09public void tes
+import jp.co.flect.salesforce.metadata.MetadataClient;%0Aimport jp.co.flect.salesforce.metadata.CustomObject;%0Aimport jp.co.flect.io.FileUtils;%0Aimport jp.co.flect.log.Level;%0A%0Apublic class SalesforceTest %7B%0A%0A%09private static SalesforceClient CLIENT;%0A%09private static MetadataClient META_CLIENT;%0A%09private static final File PARTNER_WSDL = new File(%22../enq/conf/salesforce/partner.wsdl%22);%0A%09private static final File METADATA_WSDL = new File(%22../enq/conf/salesforce/metadata.wsdl%22);%0A%09private static final File JSON_FILE = new File(%22../enq/app/data/sampleForm.json%22);%0A%0A%09@BeforeClass%0A%09public static void deleteObjec
 t() 
@@ -964,17 +964,16 @@
 xception
- 
 %7B%0A%09%09Stri
@@ -992,32 +992,33 @@
 = System.get
-Property
+env().get
 (%22SALESFORCE
@@ -1056,32 +1056,33 @@
 = System.get
-Property
+env().get
 (%22SALESFORCE
@@ -1126,16 +1126,17 @@
 .get
-Property
+env().get
 (%22SA
@@ -1166,11 +1166,8 @@
 %22);%0A
-%09%09%0A
 %09%09Sa
@@ -1215,99 +1215,564 @@
 ent(
-new File(%22../enq/conf/salesforce/partner.wsdl%22));%0A%09%09client.login(username, password, secret
+PARTNER_WSDL);%0A%09%09client.getLogger().setLevel(Level.TRACE);%0A%09%09client.login(username, password, secret);%0A%0A%09%09CLIENT = client;%0A%09%09META_CLIENT = client.createMetadataClient(METADATA_WSDL);%0A%0A%09%09CustomObject obj = new CustomObject();%0A%09%09obj.setFullName(%22ccc__c%22);%0A%09%09META_CLIENT.delete(obj);%0A%09%7D%09%0A%0A%09@Test %0A%09public void test() throws Exception %7B%0A%09%09SalesforceObjectBuilder builder = new SalesforceObjectBuilder(CLIENT, METADATA_WSDL);%0A%09%09SalesforceInfo info = new SalesforceInfo(%22ccc%22);%0A%09%09String json = FileUtils.readFileAsString(JSON_FILE);%0A%09%09builder.generate(info, json
 );%0A%09

Add test