Use WalletAppKit this class is Utility class that wraps the boilerplate needed to set up a new SPV bitcoinj app. Instantiate it with a directory and file prefix, optionally configure a few things, then use startAsync and optionally awaitRunning.
i created the wallet and send the coins using your the faucet you have mentioned and its works fine and receiving coin, here is my code...
public class Main {
static NetworkParameters params = NetworkParameters.testNet3();
static String path = System.getProperty("user.home") + "/Desktop";
private static File walletFile = new File(path);
private final static String APP_NAME = "MyWallet";
private static WalletAppKit kit;
public static void main(String...args)
{
kit = new WalletAppKit(params, walletFile, APP_NAME)
{
@Override
protected Wallet createWallet() {
Wallet wallet = new Wallet(params);
return wallet;
}
@Override
protected void onSetupCompleted() {
super.onSetupCompleted();
System.out.println(kit.wallet().currentReceiveAddress());
System.out.println(kit.wallet().getTotalReceived().toFriendlyString());
txHistory();
}
};
System.out.println("start syncing...");
kit.startAsync();
kit.awaitRunning();
}
private static void txHistory()
{
List<Transaction> txx = kit.wallet().getTransactionsByTime();
if (!txx.isEmpty())
{
int i = 1;
for (Transaction tx : txx)
{
System.out.println(i + " ________________________");
System.out.println("Date and Time: " + tx.getUpdateTime().toString());
System.out.println("From Address: " + tx.getOutput(1).getAddressFromP2PKHScript(params));
System.out.println("To Address: " + tx.getOutput(0).getAddressFromP2PKHScript(params));
System.out.println("Amount Sent to me: " + tx.getValueSentToMe(kit.wallet()).toFriendlyString());
System.out.println("Amount Sent from me: " + tx.getValueSentFromMe(kit.wallet()).toFriendlyString());
long fee = (tx.getInputSum().getValue() > 0 ? tx.getInputSum().getValue() - tx.getOutputSum().getValue() : 0);
System.out.println("Fee: " + Coin.valueOf(fee).toFriendlyString());
System.out.println("Transaction Depth: " + tx.getConfidence().getDepthInBlocks());
System.out.println("Transaction Blocks: " + tx.getConfidence().toString());
System.out.println("Tx Hex: " + tx.getHashAsString());
i++;
}
}
else
{
System.err.println("No Transaction Found");
}
}
}