This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CEP: Fix subscriptions not refreshed when Fiware-ServiceName/Path is …
- Loading branch information
1 parent
eaa08bb
commit e45f4c8
Showing
3 changed files
with
135 additions
and
1 deletion.
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
120 changes: 120 additions & 0 deletions
120
cepheus-cep/src/test/java/com/orange/cepheus/cep/model/ProviderTest.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,120 @@ | ||
package com.orange.cepheus.cep.model; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
|
||
public class ProviderTest { | ||
|
||
@Test | ||
public void testHasSameOriginSameProvider() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN"); | ||
pr.setServicePath("SP"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertTrue(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginDifferentUrl() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://diffUrl"); | ||
pr.setServiceName("SN"); | ||
pr.setServicePath("SP"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginDiffServiceName() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN1"); | ||
pr.setServicePath("SP"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginDiffServicePath() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN"); | ||
pr.setServicePath("SP1"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginUrlNull() { | ||
Provider provider = new Provider(); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN"); | ||
pr.setServicePath("SP1"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginServiceNameNull() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServicePath("SP"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginServicePathNull() { | ||
Provider provider = new Provider("http://sameUrl"); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasSameOriginUrlIsEmpty() { | ||
Provider provider = new Provider(""); | ||
provider.setServiceName("SN"); | ||
provider.setServicePath("SP"); | ||
|
||
Provider pr = new Provider("http://sameUrl"); | ||
pr.setServiceName("SN"); | ||
pr.setServicePath("SP1"); | ||
boolean checkTest = pr.hasSameOrigin(provider); | ||
assertFalse(checkTest); | ||
} | ||
|
||
@Test | ||
public void testHasObjectNull() { | ||
Provider provider = new Provider(); | ||
|
||
Provider pr = null; | ||
boolean checkTest = provider.hasSameOrigin(pr); | ||
assertFalse(checkTest); | ||
} | ||
} |