-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
192 additions
and
13 deletions.
There are no files selected for viewing
103 changes: 103 additions & 0 deletions
103
api/src/test/java/net/adamcin/oakpal/api/EmbeddedPackageInstallableTest.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,103 @@ | ||
/* | ||
* Copyright 2020 Mark Adamcin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.adamcin.oakpal.api; | ||
|
||
import org.apache.jackrabbit.vault.packaging.PackageId; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertNotEquals; | ||
import static org.junit.Assert.assertSame; | ||
|
||
public class EmbeddedPackageInstallableTest { | ||
@Test | ||
public void testConstructorAndGetters() { | ||
final PackageId expectParentId = PackageId.fromString("test:test:1"); | ||
final String expectJcrPath = "/some/path"; | ||
final PackageId expectSubpackageId = PackageId.fromString("test:testtest:1"); | ||
final EmbeddedPackageInstallable installable = | ||
new EmbeddedPackageInstallable(expectParentId, expectJcrPath, expectSubpackageId); | ||
|
||
assertSame("expect parentId", expectParentId, installable.getParentId()); | ||
assertSame("expect jcrPath", expectJcrPath, installable.getJcrPath()); | ||
assertSame("expect subpackageId", expectSubpackageId, installable.getEmbeddedId()); | ||
} | ||
|
||
@Test | ||
public void testEquals() { | ||
EmbeddedPackageInstallable self = new EmbeddedPackageInstallable( | ||
PackageId.fromString("test:test:1"), | ||
"/some/path", | ||
PackageId.fromString("test:testtest:1")); | ||
|
||
assertEquals("expect self to equal self", self, self); | ||
assertFalse("expect self to not equal null", self.equals(null)); | ||
|
||
assertEquals("expect self to equal other same params", self, | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
self.getJcrPath(), | ||
self.getEmbeddedId())); | ||
assertNotEquals("expect self to equal other different path", self, | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
"/some/other/path", | ||
self.getEmbeddedId())); | ||
assertNotEquals("expect self to equal other different parent id", self, | ||
new EmbeddedPackageInstallable( | ||
self.getEmbeddedId(), | ||
self.getJcrPath(), | ||
self.getEmbeddedId())); | ||
assertNotEquals("expect self to equal other different embedded id", self, | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
self.getJcrPath(), | ||
self.getParentId())); | ||
} | ||
|
||
@Test | ||
public void testHashCode() { | ||
EmbeddedPackageInstallable self = new EmbeddedPackageInstallable( | ||
PackageId.fromString("test:test:1"), | ||
"/some/path", | ||
PackageId.fromString("test:testtest:1")); | ||
|
||
assertEquals("expect self to equal self", self.hashCode(), self.hashCode()); | ||
|
||
assertEquals("expect self to equal other same params", self.hashCode(), | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
self.getJcrPath(), | ||
self.getEmbeddedId()).hashCode()); | ||
assertNotEquals("expect self to equal other different path", self.hashCode(), | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
"/some/other/path", | ||
self.getEmbeddedId()).hashCode()); | ||
assertNotEquals("expect self to equal other different parent id", self.hashCode(), | ||
new EmbeddedPackageInstallable( | ||
self.getEmbeddedId(), | ||
self.getJcrPath(), | ||
self.getEmbeddedId()).hashCode()); | ||
assertNotEquals("expect self to equal other different embedded id", self.hashCode(), | ||
new EmbeddedPackageInstallable( | ||
self.getParentId(), | ||
self.getJcrPath(), | ||
self.getParentId()).hashCode()); | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
...pers/ui.content.suba2/src/main/content/jcr_root/content/oakpal-caliper/alpha/.content.xml
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2020 Mark Adamcin | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" | ||
jcr:mixinTypes="[rep:AccessControllable]" | ||
jcr:primaryType="nt:folder"/> |
20 changes: 20 additions & 0 deletions
20
...pers/ui.content.subb3/src/main/content/jcr_root/content/oakpal-caliper/bravo/.content.xml
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2020 Mark Adamcin | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" | ||
jcr:mixinTypes="[rep:AccessControllable]" | ||
jcr:primaryType="nt:folder"/> |
20 changes: 20 additions & 0 deletions
20
...rs/ui.content.subc1/src/main/content/jcr_root/content/oakpal-caliper/charlie/.content.xml
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,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2020 Mark Adamcin | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal" | ||
jcr:mixinTypes="[rep:AccessControllable]" | ||
jcr:primaryType="nt:folder"/> |
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