This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PollingProvisioningServicePortType implements ProvisioningServicePortType { | |
private final ProvisioningServicePortType service; | |
public PollingProvisioningServicePortType(ProvisioningServicePortType service) { | |
this.service = service; | |
} | |
public String activateCustomer(final String cust_id) throws RemoteException { | |
return Polling.poll(new Poll<String>() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.appengine.api.taskqueue.Queue; | |
import com.google.appengine.api.taskqueue.QueueFactory; | |
import com.google.appengine.api.taskqueue.TaskQueuePb; | |
import com.google.appengine.api.taskqueue.dev.LocalTaskQueueCallback; | |
import com.google.appengine.api.urlfetch.URLFetchServicePb; | |
import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig; | |
import com.google.appengine.tools.development.testing.LocalServiceTestHelper; | |
import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig; | |
import com.google.apphosting.api.ApiProxy; | |
import org.junit.After; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample { | |
interface Source<T> { | |
T get(); | |
} | |
class WordsSource implements Source<List<Word>> { | |
private final Document document; | |
private final List<String> listOfWords; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PrintArrayTest { | |
interface Display { | |
void print(String message); | |
} | |
public void printArray(int[] array, Display display) { | |
int index = 0; | |
for (int item : array) { | |
display.print("array[" + index + "]=" + item + ","); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReceiptItemBuilder { | |
private DateTime from; | |
private DateTime to; | |
private String name; | |
private Double quantity; | |
private Double price; | |
private Double discount; | |
private String referenceId; | |
public ReceiptItemBuilder from(DateTime from) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum MyEnum { | |
TEST, ABC | |
} | |
public static class Bar { | |
@Id | |
Integer myKey; | |
Map<MyEnum, Integer> map = new HashMap<MyEnum, Integer>(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DateInput implements Validatable { | |
public interface Display { | |
HasValue<Date> getDate(); | |
void showError(boolean error); | |
void clear(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.appengine.tools.mapreduce.AppEngineMapper; | |
import com.google.appengine.tools.mapreduce.MapReduceServlet; | |
import com.google.appengine.tools.mapreduce.MapperFactory; | |
import com.google.inject.Inject; | |
import com.google.inject.Injector; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.mapreduce.Mapper; | |
import org.apache.hadoop.util.ReflectionUtils; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected CombinedConverter createTypeConverter() { | |
CombinedConverter converter = new CombinedConverter(); | |
converter.append(new PrimitiveConverter()); | |
converter.append(new CollectionConverter(converter)); | |
converter.append(new CityToString()); | |
converter.append(new StringToCity()); | |
converter.append(new StreetToString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MessyBehaviorTest { | |
interface Registry { | |
void register(Double amount); | |
} | |
class PaymentProcessingListener { | |
private final Registry registry; |