資源簡介
2019年全國大學生軟件測試大賽全國總決賽,開發者測試賽項中,“json”題目資源下載,可直接導入eclipse運行。本題使用的源碼來自eclipse的json模塊,在安裝mooctest插件的eclipse中可以查看自己的行覆蓋和分支覆蓋以及成績。

代碼片段和文件信息
/*******************************************************************************
?*?Copyright?(c)?2015?2016?EclipseSource.
?*
?*?Permission?is?hereby?granted?free?of?charge?to?any?person?obtaining?a?copy
?*?of?this?software?and?associated?documentation?files?(the?“Software“)?to?deal
?*?in?the?Software?without?restriction?including?without?limitation?the?rights
?*?to?use?copy?modify?merge?publish?distribute?sublicense?and/or?sell
?*?copies?of?the?Software?and?to?permit?persons?to?whom?the?Software?is
?*?furnished?to?do?so?subject?to?the?following?conditions:
?*
?*?The?above?copyright?notice?and?this?permission?notice?shall?be?included?in?all
?*?copies?or?substantial?portions?of?the?Software.
?*
?*?THE?SOFTWARE?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY?KIND?EXPRESS?OR
?*?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO?THE?WARRANTIES?OF?MERCHANTABILITY
?*?FITNESS?FOR?A?PARTICULAR?PURPOSE?AND?NONINFRINGEMENT.?IN?NO?EVENT?SHALL?THE
?*?AUTHORS?OR?COPYRIGHT?HOLDERS?BE?LIABLE?FOR?ANY?CLAIM?DAMAGES?OR?OTHER
?*?LIABILITY?WHETHER?IN?AN?ACTION?OF?CONTRACT?TORT?OR?OTHERWISE?ARISING?FROM
?*?OUT?OF?OR?IN?CONNECTION?WITH?THE?SOFTWARE?OR?THE?USE?OR?OTHER?DEALINGS?IN?THE
?*?SOFTWARE.
?******************************************************************************/
package?net.mooctest;
import?java.io.IOException;
import?java.io.Reader;
/**
?*?This?class?serves?as?the?entry?point?to?the?minimal-json?API.
?*?
?*?To?parse?a?given?JSON?input?use?the?parse()
?methods?like?in?this
?*?example:
?*?
?*?
?*?Jsonobject?object?=?Json.parse(string).asobject();
?*?
?*?
?*?To?create?a?JSON?data?structure?to?be?serialized?use?the?methods
?*?value()
?array()
?and?object()
.?For?example?the?following
?*?snippet?will?produce?the?JSON?string?{“foo“:?23?“bar“:?true}:
?*?
?*?
?*?String?string?=?Json.object().add(“foo“?23).add(“bar“?true).toString();
?*?
?*?
?*?To?create?a?JSON?array?from?a?given?Java?array?you?can?use?one?of?the?array()
?*?methods?with?varargs?parameters:
?*?
?*?
?*?String[]?names?=?...
?*?JsonArray?array?=?Json.array(names);
?*?
?*/
public?final?class?Json?{
??private?Json()?{
????//?not?meant?to?be?instantiated
??}
??/**
???*?Represents?the?JSON?literal?null
.
???*/
??public?static?final?JsonValue?NULL?=?new?JsonLiteral(“null“);
??/**
???*?Represents?the?JSON?literal?true
.
???*/
??public?static?final?JsonValue?TRUE?=?new?JsonLiteral(“true“);
??/**
???*?Represents?the?JSON?literal?false
.
???*/
??public?static?final?JsonValue?FALSE?=?new?JsonLiteral(“false“);
??/**
???*?Returns?a?JsonValue?instance?that?represents?the?given?int
?value.
???*
???*?@param?value
???*??????????the?value?to?get?a?JSON?representation?for
???*?@return?a?JSON?value?that?represents?the?given?value
???*/
??public?static?JsonValue?value(int?value)?{
????return?new
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????955??2019-11-28?10:14??.classpath
?????文件?????????556??2019-11-28?10:08??.project
?????目錄???????????0??2019-11-28?10:08??.settings\
?????文件??????????93??2019-11-28?10:09??.settings\org.eclipse.core.resources.prefs
?????文件?????????243??2019-11-28?10:09??.settings\org.eclipse.jdt.core.prefs
?????文件??????????90??2019-11-28?10:08??.settings\org.eclipse.m2e.core.prefs
?????文件????????1537??2019-11-28?10:49??pom.xm
?????目錄???????????0??2019-11-28?10:08??src\
?????目錄???????????0??2019-11-28?10:08??src\main\
?????目錄???????????0??2019-11-28?10:14??src\main\java\
?????目錄???????????0??2019-11-28?10:08??src\main\java\net\
?????目錄???????????0??2019-11-28?10:11??src\main\java\net\mooctest\
?????文件???????11557??2019-11-28?10:11??src\main\java\net\mooctest\Json.java
?????文件???????16348??2019-11-28?10:12??src\main\java\net\mooctest\JsonArray.java
?????文件????????9749??2019-11-28?10:12??src\main\java\net\mooctest\JsonHandler.java
?????文件????????2641??2019-11-28?10:12??src\main\java\net\mooctest\JsonLiteral.java
?????文件????????2553??2019-11-28?10:12??src\main\java\net\mooctest\JsonNumber.java
?????文件???????34827??2019-11-28?10:14??src\main\java\net\mooctest\Jsonob
?????文件???????13382??2019-11-28?10:12??src\main\java\net\mooctest\JsonParser.java
?????文件????????2224??2019-11-28?10:12??src\main\java\net\mooctest\JsonString.java
?????文件???????16878??2019-11-28?10:12??src\main\java\net\mooctest\JsonValue.java
?????文件????????4728??2019-11-28?10:12??src\main\java\net\mooctest\JsonWriter.java
?????文件????????2248??2019-11-28?10:12??src\main\java\net\mooctest\Location.java
?????文件????????2859??2019-11-28?10:12??src\main\java\net\mooctest\ParseException.java
?????文件????????4445??2019-11-28?10:12??src\main\java\net\mooctest\PrettyPrint.java
?????文件????????1974??2019-11-28?10:12??src\main\java\net\mooctest\WriterConfig.java
?????文件????????3074??2019-11-28?10:12??src\main\java\net\mooctest\WritingBuffer.java
?????目錄???????????0??2019-11-28?10:08??src\test\
?????目錄???????????0??2019-11-28?10:08??src\test\java\
?????目錄???????????0??2019-11-28?10:08??src\test\java\net\
?????目錄???????????0??2019-11-28?10:49??src\test\java\net\mooctest\
............此處省略4個文件信息
- 上一篇:千鋒ElasticSearch6教程的資料
- 下一篇:ECSHOP版權
評論
共有 條評論