// Path: src/cn/com/jautoitx/DriveMap.java
// public static enum DriveMapAddError {
// 	/* Undefined / Other error */
// 	UNDEFINED(1, "Undefined / Other error"),
// 
// 	/* Access to the remote share was denied */
// 	ACCESS_REMOTE_SHARE_DENIED(2, "Access to the remote share was denied"),
// 
// 	/* The device is already assigned */
// 	DEVICE_ALREADY_ASSIGNED(3, "The device is already assigned"),
// 
// 	/* Invalid device name */
// 	INVALID_DEVICE_NAME(4, "Invalid device name"),
// 
// 	/* Invalid remote share */
// 	INVALID_REMOVE_SHARE(5, "Invalid remote share"),
// 
// 	/* Invalid password */
// 	INVALID_PASSWORD(6, "Invalid password");
// 
// 	private final int code;
// 
// 	private final String description;
// 
// 	private DriveMapAddError(final int code, final String description) {
// 		this.code = code;
// 		this.description = description;
// 	}
// 
// 	public int getCode() {
// 		return code;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return code + ": " + description;
// 	}
// }
// 
// Path: src/cn/com/jautoitx/DriveMap.java
// public static enum DriveMapAddFlag {
// 	DEFAULT(0),
// 
// 	/* Persistant mapping */
// 	PERSISTANT_MAPPING(1),
// 
// 	/* Show authentication dialog if required */
// 	SHOW_AUTHENTICATION_DIALOG_IF_REQUIRED(8);
// 
// 	private int flag;
// 
// 	private DriveMapAddFlag(final int flag) {
// 		this.flag = flag;
// 	}
// 
// 	public int getMode() {
// 		return flag;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return String.valueOf(flag);
// 	}
// }


import java.io.File;
import org.apache.commons.lang3.StringUtils;
import org.junit.Assert;
import org.junit.Test;
import cn.com.jautoitx.DriveMap.DriveMapAddError;
import cn.com.jautoitx.DriveMap.DriveMapAddFlag;

					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT);
			Assert.assertTrue(StringUtils.isNotBlank(drive2));
			Assert.assertTrue(drive2.endsWith(":"));
			Assert.assertNotEquals(drive, drive2);

			// delete drive map
			Assert.assertTrue(DriveMap.del(drive));
			Assert.assertTrue(DriveMap.del(drive2));

			// add drive map
			String drive3 = DriveMap.add(drive,
					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT);
			Assert.assertEquals(drive3, drive);

			// The device is already assigned
			Assert.assertNull(DriveMap.add(drive,
					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT));
			Assert.assertEquals(DriveMapAddError.DEVICE_ALREADY_ASSIGNED,
					DriveMap.getAddError());

			// delete drive map
			Assert.assertTrue(DriveMap.del(drive3));

			// Undefined / Other error
			Assert.assertNull(DriveMap.add(
					String.format("\\\\xxxx.com\\%s", netname),
					DriveMapAddFlag.DEFAULT));

// Path: src/cn/com/jautoitx/DriveMap.java
// public static enum DriveMapAddError {
// 	/* Undefined / Other error */
// 	UNDEFINED(1, "Undefined / Other error"),
// 
// 	/* Access to the remote share was denied */
// 	ACCESS_REMOTE_SHARE_DENIED(2, "Access to the remote share was denied"),
// 
// 	/* The device is already assigned */
// 	DEVICE_ALREADY_ASSIGNED(3, "The device is already assigned"),
// 
// 	/* Invalid device name */
// 	INVALID_DEVICE_NAME(4, "Invalid device name"),
// 
// 	/* Invalid remote share */
// 	INVALID_REMOVE_SHARE(5, "Invalid remote share"),
// 
// 	/* Invalid password */
// 	INVALID_PASSWORD(6, "Invalid password");
// 
// 	private final int code;
// 
// 	private final String description;
// 
// 	private DriveMapAddError(final int code, final String description) {
// 		this.code = code;
// 		this.description = description;
// 	}
// 
// 	public int getCode() {
// 		return code;
// 	}
// 
// 	public String getDescription() {
// 		return description;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return code + ": " + description;
// 	}
// }
// 
// Path: src/cn/com/jautoitx/DriveMap.java
// public static enum DriveMapAddFlag {
// 	DEFAULT(0),
// 
// 	/* Persistant mapping */
// 	PERSISTANT_MAPPING(1),
// 
// 	/* Show authentication dialog if required */
// 	SHOW_AUTHENTICATION_DIALOG_IF_REQUIRED(8);
// 
// 	private int flag;
// 
// 	private DriveMapAddFlag(final int flag) {
// 		this.flag = flag;
// 	}
// 
// 	public int getMode() {
// 		return flag;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return String.valueOf(flag);
// 	}
// }


// Path: test/cn/com/jautoitx/DriveMapTest.java
import java.io.File;
import org.apache.commons.lang3.StringUtils;
import org.junit.Assert;
import org.junit.Test;
import cn.com.jautoitx.DriveMap.DriveMapAddError;
import cn.com.jautoitx.DriveMap.DriveMapAddFlag;

					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT);
			Assert.assertTrue(StringUtils.isNotBlank(drive2));
			Assert.assertTrue(drive2.endsWith(":"));
			Assert.assertNotEquals(drive, drive2);

			// delete drive map
			Assert.assertTrue(DriveMap.del(drive));
			Assert.assertTrue(DriveMap.del(drive2));

			// add drive map
			String drive3 = DriveMap.add(drive,
					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT);
			Assert.assertEquals(drive3, drive);

			// The device is already assigned
			Assert.assertNull(DriveMap.add(drive,
					String.format("\\\\%s\\%s", getHostAddress(), netname),
					DriveMapAddFlag.DEFAULT));
			Assert.assertEquals(DriveMapAddError.DEVICE_ALREADY_ASSIGNED,
					DriveMap.getAddError());

			// delete drive map
			Assert.assertTrue(DriveMap.del(drive3));

			// Undefined / Other error
			Assert.assertNull(DriveMap.add(
					String.format("\\\\xxxx.com\\%s", netname),
					DriveMapAddFlag.DEFAULT));

			Assert.assertEquals(DriveMapAddError.UNDEFINED,
