?? testtaskproperties.java
字號:
/*
* *****************************************************
* Copyright (c) 2005 IIM Lab. All Rights Reserved.
* Created by xuehao at 2005-10-12
* Contact: zxuehao@mail.ustc.edu.cn
* *****************************************************
*/
package org.indigo.tests.util;
import org.indigo.util.TaskProperties;
import junit.framework.TestCase;
public class TestTaskProperties extends TestCase
{
public void testTaskProperties()
{
String VisitBeginUrl = null, CollectedBeginUrl = null, VisitKey = null, CollectedKey = null, StartPageNum = null, EndPageNum = null, incPageNum = null;
String idFront=null, idBack=null;
TaskProperties props = new TaskProperties();
props.open("taskconfig/農業網站/吉林省/供求信息.task");
VisitBeginUrl = props.getProperty("VisitBeginUrl");
VisitKey = props.getProperty("VisitKey");
StartPageNum = props.getProperty("StartPageNum");
EndPageNum = props.getProperty("EndPageNum");
incPageNum = props.getProperty("incPageNum");
CollectedBeginUrl = props.getProperty("CollectedBeginUrl");
CollectedKey = props.getProperty("CollectedKey");
idFront = props.getProperty( "IdFront" );
idBack = props.getProperty( "IdBack" );
String str = null;
int ruleCount = 0, i;
str = props.getProperty("RuleCount");
ruleCount = Integer.parseInt(str);
String front[] = new String[ruleCount];
String back[] = new String[ruleCount];
for (i = 0; i < ruleCount; i++)
{
str = props.getProperty( "Front" + (i+1) );
front[i] = str;
str = props.getProperty( "Back" + (i+1) );
back[i] = str;
}
}
public void testTaskProperties2()
{
TaskProperties props = new TaskProperties();
props.open("taskconfig/test/test.task");
props.setProperty( "LastItem", "value" );
props.deleteProperties( "key" );
props.changeProperty( "LastItem", "value2" );
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -