package Ġcom . sil icon labs . ble demo . import _ export Ċ Ċ import Ġandroidx . test . internal . runner . junit 4 . Android JUnit 4 Class Runner Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . models . Property Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . models . Value Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . import _ export . Import Exception Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . import _ export . Import Exception . ErrorType .* Ċ import Ġcom . sil icon labs . ble demo . g att _ configur ator . import _ export . utils . Xml Const Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 Class Runner :: class ) Ċ class ĠImport Characteristic Test Ġ: ĠImport Base Test () Ġ{ ĊĠĠĠĠĊĠĠĠ Ġprivate Ġval Ġexample Uuid Ġ= Ġ" 4 5 BE " ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġuuid Missing _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( M AND AT ORY _ ATTRIBUTE _ MISSING , Ġ" uuid ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġconst Attribute _ wrong Value _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid , Ġ" const " Ġto Ġ" not Boolean ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ ATTRIBUTE _ VALUE , Ġ" not Boolean ", ĠXml Const . boolean Values ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġname Attribute _ defaultValue _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Xml Const . default Characteristic Name , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. name ) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsig Uuid Found _ rename Characteristic _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġ" 2 a 1 9 ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" Battery ĠLevel ", Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġall Capabilities Inherited _ wrong Capability List ed _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" def initely Ġnot Ġcap _ 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ CAP ABILITY _ LIST ED , Ġ" def initely Ġnot Ġcap _ 1 ", Ġset Of (" cap _ 1 ", Ġ" cap _ 2 "))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġall Capabilities Inherited _ correct Capability List ed _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( retrie ved Server . services [ 0 ]. character istics [ 0 ] ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. imported Data . capabilities . contains (" cap _ 1 ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsubset Of Capabilities Inherited _ wrong Capability List ed _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ with Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 2 ") Ġ/* ĠDecl ared Ġbut Ġnot Ġby Ġa Ġservice Ġ*/ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ CAP ABILITY _ LIST ED , Ġ" cap _ 2 ", Ġset Of (" cap _ 1 "))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsubset Of Capabilities Inherited _ correct Capability List ed _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ with Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . capabilities . contains ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" cap _ 1 ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsimple Element Second Occurrence _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . description , Ġtag Value Ġ= Ġ" description One ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . description ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . description , Ġtag Value Ġ= Ġ" description Two ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . description ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( TAG _ MAXIMUM _ OCC UR REN CE _ EX CE EDED , ĠXml Const . description )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Second Occurrence _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( TAG _ MAXIMUM _ OCC UR REN CE _ EX CE EDED , ĠXml Const . properties )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcapabilities Second Occurrence _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( TAG _ MAXIMUM _ OCC UR REN CE _ EX CE EDED , ĠXml Const . capabilities )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Tag _ property Second Occurrence _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . read ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . read ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . read ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . read ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( TAG _ MAXIMUM _ OCC UR REN CE _ EX CE EDED , ĠXml Const . read ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġno Properties Declared _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( NO _ PROPERTIES _ DECLARE D )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Tag _ no Property Declared _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( NO _ PROPERTIES _ DECLARE D )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Declared Through Attributes _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . properties , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of (" authenticated _ read " Ġto Ġ" true ", Ġ" bon ded _ read " Ġto Ġ" true ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" encrypted _ read " Ġto Ġ" false ", Ġ" write " Ġto Ġ" true ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. properties . size ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( retrie ved Server . services [ 0 ]. character istics [ 0 ]. properties . containsKey ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProperty . READ )) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( retrie ved Server . services [ 0 ]. character istics [ 0 ]. properties . containsKey ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProperty . WRITE )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( set Of ( Property . Type . AUTHENT IC ATED , ĠProperty . Type . B ON DED ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. properties [ Property . READ ]) ĊĠĠĠĠĠĠĠ ĠassertEquals ( empty Set < Property . Type >(), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. properties [ Property . WRITE ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Tag _ property Attributes _ wrong AttributeValue _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . properties , Ġmap Of (" authenticated _ read " Ġto Ġ" not Boolean ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ ATTRIBUTE _ VALUE , Ġ" not Boolean ", ĠXml Const . boolean Values ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġproperties Tag _ requirement Attributes _ wrong AttributeValue _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . properties , Ġmap Of (" read _ requirement " Ġto Ġ" true ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . properties ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ ATTRIBUTE _ VALUE , Ġ" true ", ĠXml Const . properties Requirement Values ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ type Attribute _ wrong Value _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value , Ġmap Of (" type " Ġto Ġ" we ird Type ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ ATTRIBUTE _ VALUE , Ġ" we ird Type ", ĠXml Const . valueType Values ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ variable Length Attribute _ wrong Value _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value , Ġmap Of (" variable _ length " Ġto Ġ" not Boolean ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ ATTRIBUTE _ VALUE , Ġ" not Boolean ", ĠXml Const . boolean Values ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ default Attribute Values _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value , Ġtag Value Ġ= Ġ" some Value ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( Value . Type . UTF _ 8 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value !!. type ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 0 , Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value !!. length ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( false , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value !!. variable Length ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" some Value ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value !!. value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ empty Value _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ("", Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value !!. value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ type Hex _ wrong Value _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value , Ġmap Of (" type " Ġto Ġ" hex "), Ġtag Value Ġ= Ġ" DER ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( WRONG _ TAG _ VALUE , Ġ" DER ", Ġset Of ( Xml Const . hex Value Regex . toString ()))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġvalue Tag _ type Hex _ correct Value _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . value , Ġmap Of (" type " Ġto Ġ" hex "), Ġtag Value Ġ= Ġ" a 9 2 FE 0 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . value ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals (" a 9 2 FE 0 ", Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. value ?. value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġaggregate Tag _ without Attribute _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . aggregate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . aggregate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate . size ) ĊĠĠĠĠĠĠĠ ĠAssert . assertNull ( retrie ved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate [ 0 ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġaggregate Tag _ attribute Attribute Missing _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . aggregate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . attribute ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . attribute ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . aggregate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠM AND AT ORY _ ATTRIBUTE _ MISSING , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" id " ĊĠĠĠĠĠĠĠ Ġ)) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġaggregate Tag _ parse Attribute Tags _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . aggregate , Ġmap Of (" id " Ġto Ġ" agg Att ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . attribute , Ġmap Of (" id " Ġto Ġ" att 1 ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . attribute ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . attribute , Ġmap Of (" id " Ġto Ġ" att 2 ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . attribute ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . aggregate ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 3 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" agg Att ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate [ 0 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" att 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate [ 1 ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" att 2 ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġretrieved Server . services [ 0 ]. character istics [ 0 ]. imported Data . aggregate [ 2 ]) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġone Time Characteristic Elements _ not Reset _ after Complex Tag With One Time Elements _ second Occurrence _ error () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . inform ative Text , Ġtag Value Ġ= Ġ" text 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . inform ative Text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . descriptor , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . descriptor ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . inform ative Text , Ġtag Value Ġ= Ġ" text 2 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . inform ative Text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġread For Error ( Import Exception ( TAG _ MAXIMUM _ OCC UR REN CE _ EX CE EDED , ĠXml Const . inform ative Text )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġone Time Characteristic Elements _ reset _ for Next Characteristic _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Characteristic _ without Service Capabilities Declared Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġexample Uuid )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . inform ative Text , Ġtag Value Ġ= Ġ" text 1 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . inform ative Text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . character istic , Ġmap Of (" uuid " Ġto Ġ" 2 A 9 1 ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . inform ative Text , Ġtag Value Ġ= Ġ" text 2 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . inform ative Text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprint Default Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . character istic ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġval Ġretrieved Server Ġ= Ġread For Success () ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġretrieved Server . services [ 0 ]. character istics . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" text 1 ", Ġretrieved Server . services [ 0 ]. character istics [ 0 ] ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. imported Data . simple Elements [" inform ative Text "]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" text 2 ", Ġretrieved Server . services [ 0 ]. character istics [ 1 ] ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. imported Data . simple Elements [" inform ative Text "]) ĊĠĠĠ Ġ} ĊĊĊĊĠĠĠ Ġprivate Ġfun Ġtest Characteristic _ with Service Capabilities Declared ( test : Ġ() Ġ-> ĠUnit ) Ġ{ ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . g att ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities _ declare ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 2 ") ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities _ declare ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . service , Ġmap Of (" uuid " Ġto Ġ" 1 7 2 1 ")) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") Ġ/* ĠSub set Ġchosen Ġ*/ ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities ) ĊĠĠĠĠĠĠĠ Ġtest () ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . service ) ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . g att ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġtest Characteristic _ without Service Capabilities Declared ( test : Ġ() Ġ-> ĠUnit ) Ġ{ ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . g att ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capabilities _ declare ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 1 ") ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . capability , Ġtag Value Ġ= Ġ" cap _ 2 ") ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capability ) ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . capabilities _ declare ) ĊĠĠĠĠĠĠĠ Ġprinter . open Tag ( Xml Const . service , Ġmap Of (" uuid " Ġto Ġ" 1 7 2 1 ")) ĊĠĠĠĠĠĠĠ Ġtest () ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . service ) ĊĠĠĠĠĠĠĠ Ġprinter . close Tag ( Xml Const . g att ) ĊĠĠĠ Ġ} ĊĊ Ċ }