Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from WURFL/develop
WURFL cloud client Java 1.0.14
- Loading branch information
Showing
12 changed files
with
1,100 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
code/src/test/java/com/scientiamobile/wurflcloud/DetectionPerformanceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Copyright (c) 2015 ScientiaMobile Inc. | ||
* | ||
* The WURFL Cloud Client is intended to be used in both open-source and | ||
* commercial environments. To allow its use in as many situations as possible, | ||
* the WURFL Cloud Client is dual-licensed. You may choose to use the WURFL | ||
* Cloud Client under either the GNU GENERAL PUBLIC LICENSE, Version 2.0, or | ||
* the MIT License. | ||
* | ||
* Refer to the COPYING.txt file distributed with this package. | ||
*/ | ||
package com.scientiamobile.wurflcloud; | ||
|
||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.*; | ||
|
||
public class DetectionPerformanceTest { | ||
|
||
private ICloudClientManager cloudClient; | ||
|
||
@BeforeClass | ||
public void setup() throws Exception { | ||
CloudClientLoader loader = new CloudClientLoader(null, "/CloudClientManagerTest.properties"); | ||
cloudClient = loader.getClientManager(); | ||
} | ||
|
||
@Test | ||
public void performanceTest() throws IOException { | ||
long elapsed = 0; | ||
int c = 0; | ||
BufferedReader br = new BufferedReader(new FileReader("src/test/resources/1000_ua.txt")); | ||
String line = null; | ||
long st = System.nanoTime(); | ||
while ((line = br.readLine()) != null && c < 1000){ | ||
cloudClient.getDeviceFromUserAgent(line, null); | ||
c++; | ||
} | ||
elapsed = System.nanoTime() - st; | ||
System.out.println("-- Detection time: " + elapsed + " nanoseconds -- "); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.