Skip to content

Commit

Permalink
Merge pull request #21 from pixeltree/fix_conformance_level_selection
Browse files Browse the repository at this point in the history
fixed issue with selecting the conformance level
  • Loading branch information
serene authored Nov 18, 2016
2 parents be3c8cd + b583028 commit 748c67d
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 42 deletions.
8 changes: 0 additions & 8 deletions src/main/java/org/opengis/cite/cdb10/CommonFixture.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ public void initCommonFixture(ITestContext testContext) {
*/
@BeforeClass
public void obtainTestSubject(ITestContext testContext) {
Object obj = testContext.getSuite().getAttribute(
SuiteAttribute.LEVEL.getName());
if ((null != obj)) {
Integer level = Integer.class.cast(obj);
// Assert.assertTrue(level.intValue() > 0,
// "Conformance level 1 will not be checked since ics = " + level);
}

path = testContext.getSuite().getAttribute(
SuiteAttribute.TEST_SUBJECT.getName()).toString().trim();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-08.
*/
public class CDBAttributesXmlStructureTests extends CommonFixture {
public class CDBAttributesXmlStructureTests extends Capability2Tests {

@Test
public void verifyCDBAttributesXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.opengis.cite.cdb10.metadataAndVersioning;

import org.opengis.cite.cdb10.CommonFixture;
import org.opengis.cite.cdb10.SuiteAttribute;
import org.testng.Assert;
import org.testng.ITestContext;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

Expand All @@ -10,30 +13,21 @@
*/
public class Capability2Tests extends CommonFixture {

/**
* Run conformance level 2 tests only if the preconditions are satisfied.
*/
@BeforeTest
public void checkPreconditions() {
Assert.assertTrue(2 > 1,
"Preconditions for Conformance Level 2 were not satisfied.");
}

/**
* Checks the result of the length function.
*/
@Test(description = "Implements ATC 2-1")
public void checkLength() {
String str = "perihelion";
Assert.assertEquals(str.length(), 10);
}

/**
* Checks the Unicode code point value of the first character.
* Obtains the test subject from the ISuite context. The suite attribute
* {@link org.opengis.cite.cdb10.SuiteAttribute#TEST_SUBJECT} should
* evaluate to a DOM Document node.
*
* @param testContext The test (group) context.
*/
@Test(description = "Implements ATC 2-2")
public void codePoint() {
String str = "perihelion";
Assert.assertEquals(str.codePointAt(0), 100);
@BeforeClass
public void obtainTestSubject(ITestContext testContext) {
Object obj = testContext.getSuite().getAttribute(SuiteAttribute.LEVEL.getName());
if ((null != obj)) {
Integer level = Integer.class.cast(obj);
Assert.assertTrue(level > 1,
"Conformance level " + "2 will not be checked since ics = " + level);
}
super.obtainTestSubject(testContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-07.
*/
public class ConfigurationXmlStructureTests extends CommonFixture {
public class ConfigurationXmlStructureTests extends Capability2Tests {

@Test
public void verifyConfigurationXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-03.
*/
public class DefaultsXmlStructureTests extends CommonFixture {
public class DefaultsXmlStructureTests extends Capability2Tests {
@Test
public void verifyDefaultsXmlFileExists() {
new DefaultsXml(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-10.
*/
public class GeomaticsAttributesXmlStructureTests extends CommonFixture {
public class GeomaticsAttributesXmlStructureTests extends Capability2Tests {

@Test
public void verifyGeomaticsAttributesXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-01.
*/
public class LightsXmlStructureTests extends CommonFixture {
public class LightsXmlStructureTests extends Capability2Tests {

@Test
public void verifyLightsXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Created by martin on 2016-09-12.
*/
public class LightsXxxXmlStructureTests extends CommonFixture {
public class LightsXxxXmlStructureTests extends Capability2Tests {

private static final List<String> DIRECTIONALITY_VALUES = Arrays.asList("Omnidirectional", "Directional", "Bidirectional");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Created by martin on 2016-09-09.
*/
public class MaterialsXmlStructureTests extends CommonFixture {
public class MaterialsXmlStructureTests extends Capability2Tests {

@Test
public void verifyMaterialsXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-02.
*/
public class ModelComponentsXmlStructureTests extends CommonFixture {
public class ModelComponentsXmlStructureTests extends Capability2Tests {

@Test
public void verifyModelComponentsXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-09.
*/
public class VendorAttributesXmlStructureTests extends CommonFixture {
public class VendorAttributesXmlStructureTests extends Capability2Tests {

@Test
public void verifyVendorAttributesXmlFileExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Created by martin on 2016-09-06.
*/
public class VersionXmlStructureTests extends CommonFixture {
public class VersionXmlStructureTests extends Capability2Tests {

@Test
public void verifyVersionXmlFileExists() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scripts/ctl/cdb10-suite.ctl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</p>
<p>
<label for="level">Conformance class:</label>
<input id="level-1" type="radio" name="level" value="1"
<input id="level-1" type="radio" name="level" value="1" checked="checked"
onclick="getElementById('directories').style.display='block'"/>
<label class="form-label" for="level-1">CDB Structure</label>

Expand Down

0 comments on commit 748c67d

Please sign in to comment.