-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added unit tests to help provider classes * minor fix * updated tocs and buttons * updated unit test * made suggested changes
- Loading branch information
1 parent
966636a
commit 98de46e
Showing
49 changed files
with
3,064 additions
and
27 deletions.
There are no files selected for viewing
98 changes: 98 additions & 0 deletions
98
...c/au/gov/asd/tac/constellation/plugins/algorithms/AlgorithmPluginsHelpProviderNGTest.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,98 @@ | ||
/* | ||
* Copyright 2010-2025 Australian Signals Directorate | ||
* | ||
* 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 au.gov.asd.tac.constellation.plugins.algorithms; | ||
|
||
import java.util.Map; | ||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
import org.testng.annotations.AfterClass; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* | ||
* @author antares | ||
*/ | ||
public class AlgorithmPluginsHelpProviderNGTest { | ||
|
||
@BeforeClass | ||
public static void setUpClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@BeforeMethod | ||
public void setUpMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterMethod | ||
public void tearDownMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
/** | ||
* Test of getHelpMap method, of class AlgorithmPluginsHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpMap() { | ||
System.out.println("getHelpMap"); | ||
|
||
final AlgorithmPluginsHelpProvider instance = new AlgorithmPluginsHelpProvider(); | ||
final Map<String, String> helpMap = instance.getHelpMap(); | ||
|
||
assertEquals(helpMap.size(), 5); | ||
//not going to go through and assert the existence of each specific item in the map | ||
//but will assert they're all correctly located within the algorithms package | ||
final String packageStart = "au.gov.asd.tac.constellation.plugins.algorithms."; | ||
for (final String path : helpMap.keySet()) { | ||
assertTrue(path.startsWith(packageStart)); | ||
} | ||
} | ||
|
||
/** | ||
* Test of getHelpTOC method, of class AlgorithmPluginsHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpTOC() { | ||
System.out.println("getHelpTOC"); | ||
|
||
final AlgorithmPluginsHelpProvider instance = new AlgorithmPluginsHelpProvider(); | ||
final String tocLocation = instance.getHelpTOC(); | ||
|
||
//the file separator used will vary from OS to OS so rather than copying the | ||
//exact string from the actual class and asserting what we got is the same, | ||
//we'll assert that some of the keyparts of the expected filepath are present | ||
assertTrue(tocLocation.contains("docs")); | ||
assertTrue(tocLocation.contains("CoreAlgorithmPlugins")); | ||
assertTrue(tocLocation.contains("src")); | ||
assertTrue(tocLocation.contains("plugins")); | ||
assertTrue(tocLocation.contains("algorithms")); | ||
assertTrue(tocLocation.contains("algorithms-toc.xml")); | ||
|
||
assertTrue(tocLocation.indexOf("docs") < tocLocation.indexOf("CoreAlgorithmPlugins")); | ||
assertTrue(tocLocation.indexOf("CoreAlgorithmPlugins") < tocLocation.indexOf("src")); | ||
assertTrue(tocLocation.indexOf("src") < tocLocation.indexOf("plugins")); | ||
assertTrue(tocLocation.indexOf("plugins") < tocLocation.indexOf("algorithms")); | ||
assertTrue(tocLocation.indexOf("algorithms") < tocLocation.indexOf("algorithms-toc.xml")); | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
...t/src/au/gov/asd/tac/constellation/views/analyticview/AnalyticViewHelpProviderNGTest.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,98 @@ | ||
/* | ||
* Copyright 2010-2025 Australian Signals Directorate | ||
* | ||
* 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 au.gov.asd.tac.constellation.views.analyticview; | ||
|
||
import java.util.Map; | ||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
import org.testng.annotations.AfterClass; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* | ||
* @author antares | ||
*/ | ||
public class AnalyticViewHelpProviderNGTest { | ||
|
||
@BeforeClass | ||
public static void setUpClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@BeforeMethod | ||
public void setUpMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterMethod | ||
public void tearDownMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
/** | ||
* Test of getHelpMap method, of class AnalyticViewHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpMap() { | ||
System.out.println("getHelpMap"); | ||
|
||
final AnalyticViewHelpProvider instance = new AnalyticViewHelpProvider(); | ||
final Map<String, String> helpMap = instance.getHelpMap(); | ||
|
||
assertEquals(helpMap.size(), 35); | ||
//not going to go through and assert the existence of each specific item in the map | ||
//but will assert they're all correctly located within the analytic view package | ||
final String packageStart = "au.gov.asd.tac.constellation.views.analyticview."; | ||
for (final String path : helpMap.keySet()) { | ||
assertTrue(path.startsWith(packageStart)); | ||
} | ||
} | ||
|
||
/** | ||
* Test of getHelpTOC method, of class AnalyticViewHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpTOC() { | ||
System.out.println("getHelpTOC"); | ||
|
||
final AnalyticViewHelpProvider instance = new AnalyticViewHelpProvider(); | ||
final String tocLocation = instance.getHelpTOC(); | ||
|
||
//the file separator used will vary from OS to OS so rather than copying the | ||
//exact string from the actual class and asserting what we got is the same, | ||
//we'll assert that some of the keyparts of the expected filepath are present | ||
assertTrue(tocLocation.contains("docs")); | ||
assertTrue(tocLocation.contains("CoreAnalyticView")); | ||
assertTrue(tocLocation.contains("src")); | ||
assertTrue(tocLocation.contains("views")); | ||
assertTrue(tocLocation.contains("analyticview")); | ||
assertTrue(tocLocation.contains("analyticview-toc.xml")); | ||
|
||
assertTrue(tocLocation.indexOf("docs") < tocLocation.indexOf("CoreAnalyticView")); | ||
assertTrue(tocLocation.indexOf("CoreAnalyticView") < tocLocation.indexOf("src")); | ||
assertTrue(tocLocation.indexOf("src") < tocLocation.indexOf("views")); | ||
assertTrue(tocLocation.indexOf("views") < tocLocation.indexOf("analyticview")); | ||
assertTrue(tocLocation.indexOf("analyticview") < tocLocation.indexOf("analyticview-toc.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
98 changes: 98 additions & 0 deletions
98
...au/gov/asd/tac/constellation/views/attributeeditor/AttributeEditorHelpProviderNGTest.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,98 @@ | ||
/* | ||
* Copyright 2010-2025 Australian Signals Directorate | ||
* | ||
* 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 au.gov.asd.tac.constellation.views.attributeeditor; | ||
|
||
import java.util.Map; | ||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
import org.testng.annotations.AfterClass; | ||
import org.testng.annotations.AfterMethod; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* | ||
* @author antares | ||
*/ | ||
public class AttributeEditorHelpProviderNGTest { | ||
|
||
@BeforeClass | ||
public static void setUpClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownClass() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@BeforeMethod | ||
public void setUpMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
@AfterMethod | ||
public void tearDownMethod() throws Exception { | ||
// Not currently required | ||
} | ||
|
||
/** | ||
* Test of getHelpMap method, of class AttributeEditorHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpMap() { | ||
System.out.println("getHelpMap"); | ||
|
||
final AttributeEditorHelpProvider instance = new AttributeEditorHelpProvider(); | ||
final Map<String, String> helpMap = instance.getHelpMap(); | ||
|
||
assertEquals(helpMap.size(), 1); | ||
//not going to go through and assert the existence of each specific item in the map | ||
//but will assert they're all correctly located within the attribute editor package | ||
final String packageStart = "au.gov.asd.tac.constellation.views.attributeeditor."; | ||
for (final String path : helpMap.keySet()) { | ||
assertTrue(path.startsWith(packageStart)); | ||
} | ||
} | ||
|
||
/** | ||
* Test of getHelpTOC method, of class AttributeEditorHelpProvider. | ||
*/ | ||
@Test | ||
public void testGetHelpTOC() { | ||
System.out.println("getHelpTOC"); | ||
|
||
final AttributeEditorHelpProvider instance = new AttributeEditorHelpProvider(); | ||
final String tocLocation = instance.getHelpTOC(); | ||
|
||
//the file separator used will vary from OS to OS so rather than copying the | ||
//exact string from the actual class and asserting what we got is the same, | ||
//we'll assert that some of the keyparts of the expected filepath are present | ||
assertTrue(tocLocation.contains("docs")); | ||
assertTrue(tocLocation.contains("CoreAttributeEditorView")); | ||
assertTrue(tocLocation.contains("src")); | ||
assertTrue(tocLocation.contains("views")); | ||
assertTrue(tocLocation.contains("attributeeditor")); | ||
assertTrue(tocLocation.contains("attributeeditor-toc.xml")); | ||
|
||
assertTrue(tocLocation.indexOf("docs") < tocLocation.indexOf("CoreAttributeEditorView")); | ||
assertTrue(tocLocation.indexOf("CoreAttributeEditorView") < tocLocation.indexOf("src")); | ||
assertTrue(tocLocation.indexOf("src") < tocLocation.indexOf("views")); | ||
assertTrue(tocLocation.indexOf("views") < tocLocation.indexOf("attributeeditor")); | ||
assertTrue(tocLocation.indexOf("attributeeditor") < tocLocation.indexOf("attributeeditor-toc.xml")); | ||
} | ||
} |
Oops, something went wrong.