Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
N notebook
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mark Stevens
  • notebook
  • Wiki
  • unit testing

unit testing · Changes

Page history
mstevens created page: unit testing authored Nov 01, 2017 by Mark Stevens's avatar Mark Stevens
Hide whitespace changes
Inline Side-by-side
Showing with 83 additions and 0 deletions
+83 -0
  • unit-testing.md unit-testing.md +83 -0
  • No files found.
unit-testing.md
View page @ 73421672
......@@ -231,3 +231,86 @@ Volley supports getting a Future<> object which can be used to inline a network
```
### Separate Request testing from Response testing
```java
public void testSoapRequest() throws Exception {
GetTabletConfigurationRequest gtcr = new GetTabletConfigurationRequest(
"{340A98F5-F71E-4625-81BC-0A38371213A7}",
"0000211600069",//serialNumber
"5ab6b64123925dc", //deviceSerialNumber
"5ab6b64123925dc", //deviceIdentifier
"1.0.1.1036 release-keys", //fw disp
"Buzztime", // fw manu
"BZT-T101", // fw model
"5.1.1", // fw os
22, //fw sdk
"1.40.00", // sw version
3560206336l, // data free
6199967744l // data total
);
assertEquals("http://services.buzztime.com/2011/01/ISiteService/GetTabletConfiguration", gtcr.getAction());
assertEquals("urn:uuid:a6058e8e-279a-4313-a210-58f8deb3d015", gtcr.getMessageId());
Uri uri = Uri.parse("https://services.dev.buzztime.com/Operations/Constituent/Site/SiteService/SiteService.svc");
SoapRequest soapRequest = new SoapRequest<>(
uri.toString(),
gtcr, GetTabletConfigurationResponse.class, null, null );
InputStream expectedXmlIn = new BufferedInputStream( mTestContext.getAssets()
.open("soap_GetTabletConfigurationRequest.xml") );
String expectedXmlOutline = getXmlTransformed( expectedXmlIn, "xslt_outline.xml");
String actualXml = new String(soapRequest.getBody());//.replaceAll("\'","\"");
String actualXmlOutline = getXmlTransformed(actualXml, "xslt_outline.xml");
System.out.println("ExpectedXML:");
System.out.println(expectedXmlOutline);
System.out.println("SerializedXML:");
System.out.println(actualXmlOutline);
assertEquals(expectedXmlOutline, actualXmlOutline);
}
```
```java
public void testSoapResponse() throws Exception {
GetTabletConfigurationResponse response = new GetTabletConfigurationResponse();
InputStream expectedXmlIn = new BufferedInputStream( mTestContext.getAssets()
.open("soap_GetTabletConfigurationResponse.xml") );
XmlPullParser xpp = Xml.newPullParser();
xpp.setInput(new InputStreamReader( expectedXmlIn ));
response.deserialize(xpp, response.getClass(), new SoapEnvelopeFilter() );
assertNotNull(response.mTabletConfiguration);
TabletConfiguration tc = response.mTabletConfiguration;
System.out.println("TabletConfiguration:"+tc);
assertEquals("GMTOffset", "-0800", tc.mGMTOffset);
assertEquals("RouterSSID", "Buzztime161594909190", tc.mRouterSSID);
assertEquals("SiteChain", "NONE", tc.mSiteChain);
assertEquals("SiteLocation.City", "CARLSBAD", tc.mSiteLocation.mAddress.getLocality());
assertEquals("SiteLocation.Country", "US", tc.mSiteLocation.mAddress.getCountryName());
assertEquals("SiteLocation.State", "CA", tc.mSiteLocation.mAddress.getAdminArea());
assertEquals("SiteLocation.Address1", "5966 La Place Court, Suite 100", tc.mSiteLocation.mAddress.getAddressLine(0));
assertEquals("SiteLocation.Address2", "", tc.mSiteLocation.mAddress.getAddressLine(1));
assertEquals("SiteLocation.ZipCode", "92008", tc.mSiteLocation.mAddress.getPostalCode());
assertEquals("SiteLocation.Id", "1097", tc.mSiteLocation.mSiteId);
assertEquals("SiteLocation.Name", "NTN BUZZTIME 1097", tc.mSiteLocation.mSiteName);
assertEquals("SitePhone", "(123) 438-7400", tc.mSitePhone);
assertTrue(tc.mProperties.size() > 0);
assertEquals("SitePCIPAddress", "172.23.59.193", tc.mSitePCIPAddress);
assertEquals("SpreadPort", "4803", tc.mSpreadPort);
assertEquals("StoreNumber", "-1", tc.mStoreNumber);
assertEquals("NcrAlohaOnlineSiteId", "-1", tc.mNcrAlohaOnlineSiteId);
assertEquals("NcrCloudConnectCompanyCode", "", tc.mNcrCloudConnectCompanyCode);
assertEquals("PointOfSaleProvider", "EmptyString", tc.mPointOfSaleProvider);
}
```
Clone repository
  • branch code plan
  • build and test configuration
  • build artifact versioning
  • build server instrumented testing
  • build server move
  • bzt16wifi02 releases
  • bzt18uxa02 releases
  • configuration settings and permissions
  • create a repo from cli in gitlab
  • engineering status
  • feature deployment
  • gitlab installation instructions
  • Home
  • ota update and deployment
  • qbert implementation
View All Pages