Commit 6f711639 by fukai

整合535

parent b8458038
......@@ -3,24 +3,38 @@ package com.brilliace.swifteditor;
import com.brilliace.swifteditor.tag.message.MessageFormat;
import com.brilliace.swifteditor.tag.message.SWFMessage;
import junit.framework.TestCase;
import org.apache.commons.io.IOUtils;
import java.io.*;
public class SwitfMessagePattern extends TestCase {
private void genPattern(String mty)
{
private void genPattern(String mty) throws IOException {
SWFMessage swfMessage = MessageFormat.getSWFMessage(mty);
String json = swfMessage.toFormatJSON();
System.out.println("--------------------------------");
json = "const Tags = "+json+"\r\n\r\n"+"const Title = \""+swfMessage.getName()+"\"\r\n\r\n";
json = json+ "export default { Tags,Title}";
System.out.println(json);
File targetJs = new File("d:/SwiftMT");
if(!targetJs.exists())
targetJs.mkdirs();
targetJs = new File(targetJs,"MT"+mty+".js");
if(!targetJs.exists())
targetJs.createNewFile();
FileWriter writer = new FileWriter(targetJs);
IOUtils.write(json,writer);
IOUtils.closeQuietly(writer);
}
public void testGen202()
{
public void testGen202() throws IOException {
genPattern("202");
}
public void testGen103()
{
public void testGen103() throws IOException {
genPattern("103");
}
public void testGen566() throws IOException {
genPattern("535");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment