-
Notifications
You must be signed in to change notification settings - Fork 637
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 #5390 from ant-media/fix-issue-5246
Keep https for onvif protocol
- Loading branch information
Showing
4 changed files
with
83 additions
and
9 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
44 changes: 44 additions & 0 deletions
44
src/test/java/io/antmedia/test/ipcamera/OnvifCameraTest.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 @@ | ||
package io.antmedia.test.ipcamera; | ||
|
||
import io.antmedia.ipcamera.OnvifCamera; | ||
import io.antmedia.ipcamera.onvif.soap.OnvifDevice; | ||
import junit.framework.TestCase; | ||
import org.junit.Assert; | ||
|
||
public class OnvifCameraTest extends TestCase { | ||
|
||
public void testGetIPAddress() { | ||
|
||
OnvifCamera onvifCamera = new OnvifCamera(); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("http://192.168.1.1:8080")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("192.168.1.1:8080/test")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("192.168.1.1:8080/test/test2")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("rtmp://192.168.1.1:8080/test")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("rtmps://192.168.1.1:8080/test")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("http://192.168.1.1:8080/test")); | ||
|
||
Assert.assertEquals("192.168.1.1:8080", onvifCamera.getIPAddress("https://192.168.1.1:8080/test")); | ||
} | ||
|
||
|
||
public void testGetPortAddress() { | ||
|
||
OnvifCamera onvifCamera = new OnvifCamera(); | ||
|
||
Assert.assertEquals("http", onvifCamera.getProtocol("http://192.168.1.1:8080")); | ||
|
||
Assert.assertEquals("https", onvifCamera.getProtocol("https://192.168.1.1:8080/test")); | ||
|
||
Assert.assertNull(onvifCamera.getProtocol("192.168.1.1:8080/test/test2")); | ||
|
||
} | ||
|
||
|
||
|
||
} |