Skip to content

Instantly share code, notes, and snippets.

View ben-manes's full-sized avatar

Ben Manes ben-manes

View GitHub Profile
@ben-manes
ben-manes / salesforce-partner.scala
Created December 10, 2011 00:59
Salesforce WSDL
// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
package com.drdnc.service.salesforce.generated
case class SObject(typeValue: String,
fieldsToNull: Seq[Option[String]] = Nil,
Id: Option[String] = None,
any: Seq[scalaxb.DataRecord[Any]] = Nil)
case class QueryResult(done: Boolean,
@ben-manes
ben-manes / Maven pom
Created December 10, 2011 08:20
NDNC + Salesforce
<!-- Generates Scala bindings for XSD/WSDL schemas -->
<plugin>
<groupId>org.scalaxb</groupId>
<artifactId>scalaxb-maven-plugin</artifactId>
<version>0.6.6</version>
<configuration>
<packageNames>
<packageName>
<uri>https://telemarketing.donotcall.gov/DownloadSvc/</uri>
<package>com.drdnc.service.donotcall.generated</package>
@ben-manes
ben-manes / Maven compile
Created December 10, 2011 18:44
2 WSDL compilation failures
[INFO] Compiling 102 source files to C:\projects\drdnc\target\classes at 1323542479036
[ERROR] C:\projects\drdnc\target\generated-sources\scalaxb\generated\xmlprotocol.scala:481: error: type SoapClients is not a member of package scalaxb
[INFO] trait DownloadSvcSoap12Bindings { this: scalaxb.SoapClients =>
[INFO] ^
[ERROR] C:\projects\drdnc\target\generated-sources\scalaxb\generated\xmlprotocol.scala:488: error: not found: value soapClient
[INFO] soapClient.requestResponse(scalaxb.toXML(Login(strCoID, strCoPwd, userType, enumCertify), Some("https://telemarketing.donotcall.gov/DownloadSvc/"
), "Login", defaultScope),
[INFO] ^
[ERROR] C:\projects\drdnc\target\generated-sources\scalaxb\generated\xmlprotocol.scala:490: error: type mismatch;
[INFO] found : Any
@ben-manes
ben-manes / compilation
Created December 11, 2011 05:33
Salesforce Enterprise WSDL
$ mvn clean test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Dr. Dnc 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ drdnc ---
[INFO] Deleting C:\projects\drdnc\target
[INFO]
@ben-manes
ben-manes / scalaxb of 20k file
Created December 11, 2011 07:17
Scala compilation failure
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Dr. Dnc 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ drdnc ---
[INFO] Deleting C:\projects\drdnc\target
[INFO]
[INFO] --- scalaxb-maven-plugin:0.6.6:generate (scalaxb) @ drdnc ---
package com.googlecode.concurrentlinkedhashmap.benchmark;
import com.google.caliper.Runner;
import com.google.caliper.SimpleBenchmark;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
@ben-manes
ben-manes / gist:4248735
Created December 10, 2012 06:02
WebDriverTestingTemplate fatJar
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.2-rc1'
}
}
apply from: "${rootDir}/coverage.gradle"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.ajoberstar:gradle-jacoco:0.1.0"
}
}
apply from: "${rootDir}/gradle/java.gradle"
dependencies {
compile libraries.guava
compile libraries.guice
compile libraries.jooq
}
buildscript {
repositories {
/**
* A test for the connection life-cycle management within jOOQ managed operations.
*
* @author Ben Manes (ben@addepar.com)
*/
@Guice(modules = {JooqTestModule.class, TestModule.class})
public class ConnectionLifecycleTest {
final AtomicInteger counter = new AtomicInteger();
@Inject CountingExecuteListener countingExecuteListener;