-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* started tree view page * tree formatting, feature display * tree view * first tree iteration * tree view * design changes
- Loading branch information
1 parent
0249a1d
commit fa54afe
Showing
39 changed files
with
319 additions
and
68 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
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
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
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
45 changes: 45 additions & 0 deletions
45
...ivago/cluecumber/engine/rendering/pages/pojos/pagecollections/TreeViewPageCollection.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,45 @@ | ||
/* | ||
* Copyright 2019 trivago N.V. | ||
* | ||
* 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 com.trivago.cluecumber.engine.rendering.pages.pojos.pagecollections; | ||
|
||
import com.trivago.cluecumber.engine.json.pojo.Element; | ||
import com.trivago.cluecumber.engine.rendering.pages.pojos.Feature; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class TreeViewPageCollection extends PageCollection { | ||
private final Map<Feature, List<Element>> elements; | ||
|
||
public TreeViewPageCollection(final Map<Feature, List<Element>> elements, final String pageTitle) { | ||
super(pageTitle); | ||
this.elements = elements; | ||
} | ||
|
||
public Map<Feature, List<Element>> getElements() { | ||
return elements; | ||
} | ||
|
||
public int getNumberOfFeatures() { | ||
return elements.size(); | ||
} | ||
|
||
public int getNumberOfScenarios() { | ||
return elements.values().stream().mapToInt(List::size).sum(); | ||
} | ||
} | ||
|
71 changes: 71 additions & 0 deletions
71
.../java/com/trivago/cluecumber/engine/rendering/pages/renderering/TreeViewPageRenderer.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,71 @@ | ||
/* | ||
* Copyright 2019 trivago N.V. | ||
* | ||
* 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 com.trivago.cluecumber.engine.rendering.pages.renderering; | ||
|
||
import com.trivago.cluecumber.engine.exceptions.CluecumberException; | ||
import com.trivago.cluecumber.engine.json.pojo.Element; | ||
import com.trivago.cluecumber.engine.properties.PropertyManager; | ||
import com.trivago.cluecumber.engine.rendering.pages.pojos.Feature; | ||
import com.trivago.cluecumber.engine.rendering.pages.pojos.pagecollections.AllFeaturesPageCollection; | ||
import com.trivago.cluecumber.engine.rendering.pages.pojos.pagecollections.AllScenariosPageCollection; | ||
import com.trivago.cluecumber.engine.rendering.pages.pojos.pagecollections.TreeViewPageCollection; | ||
import freemarker.template.Template; | ||
|
||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import java.util.Comparator; | ||
import java.util.LinkedHashMap; | ||
import java.util.LinkedHashSet; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
@Singleton | ||
public class TreeViewPageRenderer extends PageRenderer { | ||
|
||
private final PropertyManager propertyManager; | ||
|
||
@Inject | ||
public TreeViewPageRenderer( | ||
final PropertyManager propertyManager | ||
) { | ||
this.propertyManager = propertyManager; | ||
} | ||
|
||
public String getRenderedContent( | ||
final AllFeaturesPageCollection allFeaturesPageCollection, | ||
final AllScenariosPageCollection allScenariosPageCollection, | ||
final Template template) | ||
throws CluecumberException { | ||
|
||
Map<Feature, List<Element>> scenariosPerFeatures = new LinkedHashMap<>(); | ||
Set<Feature> features = allFeaturesPageCollection.getFeatures() | ||
.stream().sorted(Comparator.comparing(Feature::getName)) | ||
.collect(Collectors.toCollection(LinkedHashSet::new)); | ||
for (Feature feature : features) { | ||
scenariosPerFeatures.put(feature, allScenariosPageCollection.getElementsByFeatureIndex(feature.getIndex())); | ||
} | ||
|
||
return processedContent( | ||
template, | ||
new TreeViewPageCollection(scenariosPerFeatures, allFeaturesPageCollection.getPageTitle()), | ||
propertyManager.getNavigationLinks() | ||
); | ||
} | ||
|
||
} |
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
Oops, something went wrong.