// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/resource/TftpMemoryDataProvider.java
// public class TftpMemoryDataProvider extends AbstractTftpDataProvider {
// 
//     private final Map<String, byte[]> map = new HashMap<String, byte[]>();
// 
//     public void setData(@Nonnull String name, @CheckForNull byte[] data) {
//         if (data == null)
//             map.remove(name);
//         else
//             map.put(name, data);
//     }
// 
//     public void setData(@Nonnull String name, @Nonnull String data) {
//         setData(name, data.getBytes(Charsets.ISO_8859_1));
//     }
// 
//     @CheckForNull
//     public byte[] getData(String name) {
//         return map.get(name);
//     }
// 
//     @Override
//     public TftpData open(String filename) throws IOException {
//         byte[] data = getData(filename);
//         if (data == null)
//             return null;
//         return new TftpByteArrayData(data);
//     }
// }


import com.google.common.io.ByteStreams;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Random;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.anarres.tftp.protocol.resource.TftpMemoryDataProvider;
import org.apache.commons.net.tftp.TFTPClient;
import org.apache.commons.net.util.Base64;
import static org.junit.Assert.*;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anarres.tftp.protocol.engine;


/**
 *
 * @author shevek
 */
public class TftpServerTester {

    private static final Random RANDOM = new Random();
// Path: tftp-protocol/src/main/java/org/anarres/tftp/protocol/resource/TftpMemoryDataProvider.java
// public class TftpMemoryDataProvider extends AbstractTftpDataProvider {
// 
//     private final Map<String, byte[]> map = new HashMap<String, byte[]>();
// 
//     public void setData(@Nonnull String name, @CheckForNull byte[] data) {
//         if (data == null)
//             map.remove(name);
//         else
//             map.put(name, data);
//     }
// 
//     public void setData(@Nonnull String name, @Nonnull String data) {
//         setData(name, data.getBytes(Charsets.ISO_8859_1));
//     }
// 
//     @CheckForNull
//     public byte[] getData(String name) {
//         return map.get(name);
//     }
// 
//     @Override
//     public TftpData open(String filename) throws IOException {
//         byte[] data = getData(filename);
//         if (data == null)
//             return null;
//         return new TftpByteArrayData(data);
//     }
// }


// Path: tftp-protocol/src/test/java/org/anarres/tftp/protocol/engine/TftpServerTester.java
import com.google.common.io.ByteStreams;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.util.Random;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import org.anarres.tftp.protocol.resource.TftpMemoryDataProvider;
import org.apache.commons.net.tftp.TFTPClient;
import org.apache.commons.net.util.Base64;
import static org.junit.Assert.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.anarres.tftp.protocol.engine;


/**
 *
 * @author shevek
 */
public class TftpServerTester {

    private static final Random RANDOM = new Random();
    private final TftpMemoryDataProvider provider = new TftpMemoryDataProvider();