repo_name
stringlengths 7
104
| file_path
stringlengths 13
198
| context
stringlengths 67
7.15k
| import_statement
stringlengths 16
4.43k
| code
stringlengths 40
6.98k
| prompt
stringlengths 227
8.27k
| next_line
stringlengths 8
795
|
---|---|---|---|---|---|---|
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/custom.properties.
*/
public interface CustomProperties {
static final String FILE_PATH = "etc/config.properties";
/**
* Possible values here are felix or equinox
*/ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/custom.properties.
*/
public interface CustomProperties {
static final String FILE_PATH = "etc/config.properties";
/**
* Possible values here are felix or equinox
*/ | static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework"); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/FeaturesScannerProvisionTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FeaturesScannerProvisionTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/FeaturesScannerProvisionTest.java
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FeaturesScannerProvisionTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", "2.2.5"), |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration() |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
.useDeployFolder(false).karafVersion("2.2.4").name("servicemix"), | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
.useDeployFolder(false).karafVersion("2.2.4").name("servicemix"), | editConfigurationFilePut( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
.useDeployFolder(false).karafVersion("2.2.4").name("servicemix"),
editConfigurationFilePut( | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/MixFeatureAndDeployFolderFalseTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class MixFeatureAndDeployFolderFalseTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
.useDeployFolder(false).karafVersion("2.2.4").name("servicemix"),
editConfigurationFilePut( | FeaturesCfg.BOOT, |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseOpenEngSBTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseOpenEngSBTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseOpenEngSBTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseOpenEngSBTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectKarafTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectKarafTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectKarafTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectKarafTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration().frameworkUrl( |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/SystemProperties.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/system.properties..
*/
public interface SystemProperties {
static final String FILE_PATH = "etc/system.properties";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/SystemProperties.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/system.properties..
*/
public interface SystemProperties {
static final String FILE_PATH = "etc/system.properties";
| static final ConfigurationPointer KARAF_NAME = new CustomPropertiesPointer("karaf.name"); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox") }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/CustomProperties.java
// public interface CustomProperties {
//
// static final String FILE_PATH = "etc/config.properties";
//
// /**
// * Possible values here are felix or equinox
// */
// static final ConfigurationPointer KARAF_FRAMEWORK = new CustomPropertiesPointer("karaf.framework");
//
// static final ConfigurationPointer SYSTEM_PACKAGES_EXTRA = new CustomPropertiesPointer(
// "org.osgi.framework.system.packages.extra");
//
// static final ConfigurationPointer BOOTDELEGATION = new CustomPropertiesPointer("org.osgi.framework.bootdelegation");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafEquinoxFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.CustomProperties;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafEquinoxFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), editConfigurationFilePut(CustomProperties.KARAF_FRAMEWORK, "equinox") }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepRuntimeFolderTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepRuntimeFolderTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepRuntimeFolderTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepRuntimeFolderTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseSmxTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This one is deactivated till there is an SMX available with a newer karaf version
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseSmxTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseSmxTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This one is deactivated till there is an SMX available with a newer karaf version
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseSmxTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.servicemix/apache-servicemix/4.4.1/zip", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration() |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
/**.useDeployFolder(false)*/.karafVersion("2.2.4").name("servicemix"), | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
/**.useDeployFolder(false)*/.karafVersion("2.2.4").name("servicemix"), | editConfigurationFilePut( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
/**.useDeployFolder(false)*/.karafVersion("2.2.4").name("servicemix"),
editConfigurationFilePut( | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFilePut(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFilePutOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
// public interface FeaturesCfg {
// static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
//
// static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories");
// static final ConfigurationPointer BOOT = new CustomPropertiesPointer("featuresBoot");
//
// static class CustomPropertiesPointer extends ConfigurationPointer {
//
// public CustomPropertiesPointer(String key) {
// super(FILE_PATH, key);
// }
//
// }
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/ServicemixFeatureManipulationTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
import javax.inject.Inject;
import org.apache.karaf.features.FeaturesService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.configs.FeaturesCfg;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class ServicemixFeatureManipulationTest {
@Inject
private FeaturesService featuresService;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration()
.frameworkUrl(
maven().groupId("org.apache.servicemix").artifactId("apache-servicemix").type("zip")
.versionAsInProject())
/**.useDeployFolder(false)*/.karafVersion("2.2.4").name("servicemix"),
editConfigurationFilePut( | FeaturesCfg.BOOT, |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/OpenEngSBBundleContextNotNullTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import static org.junit.Assert.assertNotNull;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import javax.inject.Inject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class OpenEngSBBundleContextNotNullTest {
@Inject
private BundleContext bundleContext;
// TODO: PAXEXAM-288
// @BeforeClass
// public void beforeClass() {
// System.out.println("=================================");
// System.out.println("CLASS Before bundleContext validation CLASS");
// System.out.println("=================================");
// }
@Before
public void setUp() {
System.out.println("=================================");
System.out.println("Before bundleContext validation");
System.out.println("=================================");
}
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/OpenEngSBBundleContextNotNullTest.java
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import static org.junit.Assert.assertNotNull;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import javax.inject.Inject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class OpenEngSBBundleContextNotNullTest {
@Inject
private BundleContext bundleContext;
// TODO: PAXEXAM-288
// @BeforeClass
// public void beforeClass() {
// System.out.println("=================================");
// System.out.println("CLASS Before bundleContext validation CLASS");
// System.out.println("=================================");
// }
@Before
public void setUp() {
System.out.println("=================================");
System.out.println("Before bundleContext validation");
System.out.println("=================================");
}
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration( |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/ManagementCfg.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.apache.karaf.management.cfg.
*/
public interface ManagementCfg {
static final String FILE_PATH = "etc/org.apache.karaf.management.cfg";
/**
* Port of the registry for the exported RMI service
*/ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/ManagementCfg.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.apache.karaf.management.cfg.
*/
public interface ManagementCfg {
static final String FILE_PATH = "etc/org.apache.karaf.management.cfg";
/**
* Port of the registry for the exported RMI service
*/ | static final ConfigurationPointer RMI_REGISTRY_PORT = new CustomPropertiesPointer("rmiRegistryPort"); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTurnOffLogModificationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option doNotModifyLogConfiguration() {
// return new DoNotModifyLogOption();
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.doNotModifyLogConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTurnOffLogModificationTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option doNotModifyLogConfiguration() {
// return new DoNotModifyLogOption();
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTurnOffLogModificationTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.doNotModifyLogConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTurnOffLogModificationTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTurnOffLogModificationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option doNotModifyLogConfiguration() {
// return new DoNotModifyLogOption();
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.doNotModifyLogConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTurnOffLogModificationTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option doNotModifyLogConfiguration() {
// return new DoNotModifyLogOption();
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTurnOffLogModificationTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.doNotModifyLogConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTurnOffLogModificationTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), doNotModifyLogConfiguration() }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithConfiguredFoldersTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithConfiguredFoldersTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithConfiguredFoldersTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithConfiguredFoldersTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithConfiguredFoldersTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithConfiguredFoldersTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithConfiguredFoldersTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithConfiguredFoldersTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5").unpackDirectory(new File("target/paxexam/unpack/")), keepRuntimeFolder() }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectServicemixTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectServicemixTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectServicemixTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectServicemixTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration().frameworkUrl( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/NativeKarafFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public class KarafDistributionKitConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public enum Platform {
// WINDOWS, NIX
// }
//
// private Platform platform;
// private List<String> makeExec = new ArrayList<String>();
// private String exec;
//
// public KarafDistributionKitConfigurationOption(KarafDistributionBaseConfigurationOption base,
// Platform platform) {
// super(base);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion, Platform platform) {
// super(frameworkURLReference, name, karafVersion);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(String frameworkURL, String name, String karafVersion,
// Platform platform) {
// super(frameworkURL, name, karafVersion);
// setPlatform(platform);
// }
//
// private void setPlatform(Platform platform) {
// this.platform = platform;
// if (platform.equals(Platform.WINDOWS)) {
// exec = "bin\\karaf.bat";
// } else {
// exec = "bin/karaf";
// }
// }
//
// public KarafDistributionKitConfigurationOption filesToMakeExecutable(String... platformRelativeFilePath) {
// for (String platformRelativePath : platformRelativeFilePath) {
// makeExec.add(platformRelativePath);
// }
// return this;
// }
//
// public KarafDistributionKitConfigurationOption executable(String platformRelativeFilePath) {
// exec = platformRelativeFilePath;
// return this;
// }
//
// public Platform getPlatform() {
// return platform;
// }
//
// public List<String> getMakeExec() {
// return makeExec;
// }
//
// public String getExec() {
// return exec;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public enum Platform {
// WINDOWS, NIX
// }
| import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption.Platform;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class NativeKarafFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public class KarafDistributionKitConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public enum Platform {
// WINDOWS, NIX
// }
//
// private Platform platform;
// private List<String> makeExec = new ArrayList<String>();
// private String exec;
//
// public KarafDistributionKitConfigurationOption(KarafDistributionBaseConfigurationOption base,
// Platform platform) {
// super(base);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion, Platform platform) {
// super(frameworkURLReference, name, karafVersion);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(String frameworkURL, String name, String karafVersion,
// Platform platform) {
// super(frameworkURL, name, karafVersion);
// setPlatform(platform);
// }
//
// private void setPlatform(Platform platform) {
// this.platform = platform;
// if (platform.equals(Platform.WINDOWS)) {
// exec = "bin\\karaf.bat";
// } else {
// exec = "bin/karaf";
// }
// }
//
// public KarafDistributionKitConfigurationOption filesToMakeExecutable(String... platformRelativeFilePath) {
// for (String platformRelativePath : platformRelativeFilePath) {
// makeExec.add(platformRelativePath);
// }
// return this;
// }
//
// public KarafDistributionKitConfigurationOption executable(String platformRelativeFilePath) {
// exec = platformRelativeFilePath;
// return this;
// }
//
// public Platform getPlatform() {
// return platform;
// }
//
// public List<String> getMakeExec() {
// return makeExec;
// }
//
// public String getExec() {
// return exec;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public enum Platform {
// WINDOWS, NIX
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/NativeKarafFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption.Platform;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class NativeKarafFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{ | new KarafDistributionKitConfigurationOption("mvn:org.apache.karaf/apache-karaf/2.2.4/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/NativeKarafFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public class KarafDistributionKitConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public enum Platform {
// WINDOWS, NIX
// }
//
// private Platform platform;
// private List<String> makeExec = new ArrayList<String>();
// private String exec;
//
// public KarafDistributionKitConfigurationOption(KarafDistributionBaseConfigurationOption base,
// Platform platform) {
// super(base);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion, Platform platform) {
// super(frameworkURLReference, name, karafVersion);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(String frameworkURL, String name, String karafVersion,
// Platform platform) {
// super(frameworkURL, name, karafVersion);
// setPlatform(platform);
// }
//
// private void setPlatform(Platform platform) {
// this.platform = platform;
// if (platform.equals(Platform.WINDOWS)) {
// exec = "bin\\karaf.bat";
// } else {
// exec = "bin/karaf";
// }
// }
//
// public KarafDistributionKitConfigurationOption filesToMakeExecutable(String... platformRelativeFilePath) {
// for (String platformRelativePath : platformRelativeFilePath) {
// makeExec.add(platformRelativePath);
// }
// return this;
// }
//
// public KarafDistributionKitConfigurationOption executable(String platformRelativeFilePath) {
// exec = platformRelativeFilePath;
// return this;
// }
//
// public Platform getPlatform() {
// return platform;
// }
//
// public List<String> getMakeExec() {
// return makeExec;
// }
//
// public String getExec() {
// return exec;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public enum Platform {
// WINDOWS, NIX
// }
| import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption.Platform;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class NativeKarafFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{
new KarafDistributionKitConfigurationOption("mvn:org.apache.karaf/apache-karaf/2.2.4/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public class KarafDistributionKitConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public enum Platform {
// WINDOWS, NIX
// }
//
// private Platform platform;
// private List<String> makeExec = new ArrayList<String>();
// private String exec;
//
// public KarafDistributionKitConfigurationOption(KarafDistributionBaseConfigurationOption base,
// Platform platform) {
// super(base);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion, Platform platform) {
// super(frameworkURLReference, name, karafVersion);
// setPlatform(platform);
// }
//
// public KarafDistributionKitConfigurationOption(String frameworkURL, String name, String karafVersion,
// Platform platform) {
// super(frameworkURL, name, karafVersion);
// setPlatform(platform);
// }
//
// private void setPlatform(Platform platform) {
// this.platform = platform;
// if (platform.equals(Platform.WINDOWS)) {
// exec = "bin\\karaf.bat";
// } else {
// exec = "bin/karaf";
// }
// }
//
// public KarafDistributionKitConfigurationOption filesToMakeExecutable(String... platformRelativeFilePath) {
// for (String platformRelativePath : platformRelativeFilePath) {
// makeExec.add(platformRelativePath);
// }
// return this;
// }
//
// public KarafDistributionKitConfigurationOption executable(String platformRelativeFilePath) {
// exec = platformRelativeFilePath;
// return this;
// }
//
// public Platform getPlatform() {
// return platform;
// }
//
// public List<String> getMakeExec() {
// return makeExec;
// }
//
// public String getExec() {
// return exec;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionKitConfigurationOption.java
// public enum Platform {
// WINDOWS, NIX
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/NativeKarafFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionKitConfigurationOption.Platform;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class NativeKarafFrameworkTest {
@Configuration
public Option[] config() {
return new Option[]{
new KarafDistributionKitConfigurationOption("mvn:org.apache.karaf/apache-karaf/2.2.4/zip", "karaf", | "2.2.4", Platform.WINDOWS).executable("bin\\karaf.bat").filesToMakeExecutable("bin\\admin.bat"), |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/KarafBundleContextNotNullTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import static org.junit.Assert.assertNotNull;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import javax.inject.Inject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class KarafBundleContextNotNullTest {
@Inject
private BundleContext bundleContext;
// TODO: PAXEXAM-288
// @BeforeClass
// public void beforeClass() {
// System.out.println("=================================");
// System.out.println("CLASS Before bundleContext validation CLASS");
// System.out.println("=================================");
// }
@Before
public void setUp() {
System.out.println("=================================");
System.out.println("Before bundleContext validation");
System.out.println("=================================");
}
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/KarafBundleContextNotNullTest.java
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import static org.junit.Assert.assertNotNull;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import javax.inject.Inject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class KarafBundleContextNotNullTest {
@Inject
private BundleContext bundleContext;
// TODO: PAXEXAM-288
// @BeforeClass
// public void beforeClass() {
// System.out.println("=================================");
// System.out.println("CLASS Before bundleContext validation CLASS");
// System.out.println("=================================");
// }
@Before
public void setUp() {
System.out.println("=================================");
System.out.println("Before bundleContext validation");
System.out.println("=================================");
}
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithShellOffTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionConfigurationConsoleOption configureConsole() {
// return new KarafDistributionConfigurationConsoleOption(null, null);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.configureConsole;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithShellOffTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionConfigurationConsoleOption configureConsole() {
// return new KarafDistributionConfigurationConsoleOption(null, null);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithShellOffTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.configureConsole;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithShellOffTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithShellOffTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionConfigurationConsoleOption configureConsole() {
// return new KarafDistributionConfigurationConsoleOption(null, null);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.configureConsole;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithShellOffTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionConfigurationConsoleOption configureConsole() {
// return new KarafDistributionConfigurationConsoleOption(null, null);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkWithShellOffTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.configureConsole;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkWithShellOffTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), configureConsole().ignoreLocalConsole().ignoreRemoteShell() }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/SystemPackageOptionTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
import java.io.FileInputStream;
import java.util.Properties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class SystemPackageOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/SystemPackageOptionTest.java
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.systemPackage;
import java.io.FileInputStream;
import java.util.Properties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class SystemPackageOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", "2.2.5"), |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/WebCfg.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.ops4j.pax.web.cfg.
*/
public interface WebCfg {
static final String FILE_PATH = "etc/org.ops4j.pax.web.cfg";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/WebCfg.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.ops4j.pax.web.cfg.
*/
public interface WebCfg {
static final String FILE_PATH = "etc/org.ops4j.pax.web.cfg";
| static final ConfigurationPointer HTTP_PORT = new CustomPropertiesPointer("org.osgi.service.http.port"); |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/AbstractExamFeaturesFile.java | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/KarafPropertiesFile.java
// public class KarafPropertiesFile {
//
// private final Properties properties;
// private final File propertyFile;
//
// public KarafPropertiesFile(File karafHome, String location) {
// if (location.startsWith("/")) {
// propertyFile = new File(karafHome + location);
// } else {
// propertyFile = new File(karafHome + "/" + location);
// }
// properties = new Properties();
// }
//
// public void load() throws IOException {
// if (!propertyFile.exists()) {
// return;
// }
// properties.load(new FileInputStream(propertyFile));
// }
//
// public void put(String key, String value) {
// properties.put(key, value);
// }
//
// public void extend(String key, String value) {
// if (properties.get(key) == null) {
// properties.put(key, value);
// return;
// }
// properties.put(key, properties.get(key) + value);
// }
//
// public String get(String key) {
// return properties.getProperty(key);
// }
//
// public void store() throws IOException {
// properties.store(new FileOutputStream(propertyFile), "Modified by paxexam");
// }
//
// public void replace(File source) {
// try {
// FileUtils.copyFile(source, propertyFile);
// } catch (IOException e) {
// throw new IllegalStateException("It is required to replace propertyFile");
// }
// }
//
// }
| import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.KarafPropertiesFile; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
public abstract class AbstractExamFeaturesFile implements ExamFeaturesFile {
protected String featuresXml;
@Override
public void writeToFile(File featuresXmlFile) throws IOException {
FileUtils.writeStringToFile(featuresXmlFile, featuresXml);
}
@Override
public void adaptDistributionToStartExam(File karafHome, File featuresXmlFile) throws IOException { | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/KarafPropertiesFile.java
// public class KarafPropertiesFile {
//
// private final Properties properties;
// private final File propertyFile;
//
// public KarafPropertiesFile(File karafHome, String location) {
// if (location.startsWith("/")) {
// propertyFile = new File(karafHome + location);
// } else {
// propertyFile = new File(karafHome + "/" + location);
// }
// properties = new Properties();
// }
//
// public void load() throws IOException {
// if (!propertyFile.exists()) {
// return;
// }
// properties.load(new FileInputStream(propertyFile));
// }
//
// public void put(String key, String value) {
// properties.put(key, value);
// }
//
// public void extend(String key, String value) {
// if (properties.get(key) == null) {
// properties.put(key, value);
// return;
// }
// properties.put(key, properties.get(key) + value);
// }
//
// public String get(String key) {
// return properties.getProperty(key);
// }
//
// public void store() throws IOException {
// properties.store(new FileOutputStream(propertyFile), "Modified by paxexam");
// }
//
// public void replace(File source) {
// try {
// FileUtils.copyFile(source, propertyFile);
// } catch (IOException e) {
// throw new IllegalStateException("It is required to replace propertyFile");
// }
// }
//
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/AbstractExamFeaturesFile.java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.KarafPropertiesFile;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
public abstract class AbstractExamFeaturesFile implements ExamFeaturesFile {
protected String featuresXml;
@Override
public void writeToFile(File featuresXmlFile) throws IOException {
FileUtils.writeStringToFile(featuresXmlFile, featuresXml);
}
@Override
public void adaptDistributionToStartExam(File karafHome, File featuresXmlFile) throws IOException { | KarafPropertiesFile karafPropertiesFile = new KarafPropertiesFile(karafHome, Constants.FEATURES_CFG_LOCATION); |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/AbstractExamFeaturesFile.java | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/KarafPropertiesFile.java
// public class KarafPropertiesFile {
//
// private final Properties properties;
// private final File propertyFile;
//
// public KarafPropertiesFile(File karafHome, String location) {
// if (location.startsWith("/")) {
// propertyFile = new File(karafHome + location);
// } else {
// propertyFile = new File(karafHome + "/" + location);
// }
// properties = new Properties();
// }
//
// public void load() throws IOException {
// if (!propertyFile.exists()) {
// return;
// }
// properties.load(new FileInputStream(propertyFile));
// }
//
// public void put(String key, String value) {
// properties.put(key, value);
// }
//
// public void extend(String key, String value) {
// if (properties.get(key) == null) {
// properties.put(key, value);
// return;
// }
// properties.put(key, properties.get(key) + value);
// }
//
// public String get(String key) {
// return properties.getProperty(key);
// }
//
// public void store() throws IOException {
// properties.store(new FileOutputStream(propertyFile), "Modified by paxexam");
// }
//
// public void replace(File source) {
// try {
// FileUtils.copyFile(source, propertyFile);
// } catch (IOException e) {
// throw new IllegalStateException("It is required to replace propertyFile");
// }
// }
//
// }
| import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.KarafPropertiesFile; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
public abstract class AbstractExamFeaturesFile implements ExamFeaturesFile {
protected String featuresXml;
@Override
public void writeToFile(File featuresXmlFile) throws IOException {
FileUtils.writeStringToFile(featuresXmlFile, featuresXml);
}
@Override
public void adaptDistributionToStartExam(File karafHome, File featuresXmlFile) throws IOException { | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/KarafPropertiesFile.java
// public class KarafPropertiesFile {
//
// private final Properties properties;
// private final File propertyFile;
//
// public KarafPropertiesFile(File karafHome, String location) {
// if (location.startsWith("/")) {
// propertyFile = new File(karafHome + location);
// } else {
// propertyFile = new File(karafHome + "/" + location);
// }
// properties = new Properties();
// }
//
// public void load() throws IOException {
// if (!propertyFile.exists()) {
// return;
// }
// properties.load(new FileInputStream(propertyFile));
// }
//
// public void put(String key, String value) {
// properties.put(key, value);
// }
//
// public void extend(String key, String value) {
// if (properties.get(key) == null) {
// properties.put(key, value);
// return;
// }
// properties.put(key, properties.get(key) + value);
// }
//
// public String get(String key) {
// return properties.getProperty(key);
// }
//
// public void store() throws IOException {
// properties.store(new FileOutputStream(propertyFile), "Modified by paxexam");
// }
//
// public void replace(File source) {
// try {
// FileUtils.copyFile(source, propertyFile);
// } catch (IOException e) {
// throw new IllegalStateException("It is required to replace propertyFile");
// }
// }
//
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/AbstractExamFeaturesFile.java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.KarafPropertiesFile;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
public abstract class AbstractExamFeaturesFile implements ExamFeaturesFile {
protected String featuresXml;
@Override
public void writeToFile(File featuresXmlFile) throws IOException {
FileUtils.writeStringToFile(featuresXmlFile, featuresXml);
}
@Override
public void adaptDistributionToStartExam(File karafHome, File featuresXmlFile) throws IOException { | KarafPropertiesFile karafPropertiesFile = new KarafPropertiesFile(karafHome, Constants.FEATURES_CFG_LOCATION); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkUseFeatureInsteadOfDeployFolderTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.provision;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkUseFeatureInsteadOfDeployFolderTest {
@Inject
BundleContext bc;
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkUseFeatureInsteadOfDeployFolderTest.java
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.provision;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkUseFeatureInsteadOfDeployFolderTest {
@Inject
BundleContext bc;
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BundleStartLvlTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnExamBundlesStartLevel(int startLevel) {
// return new ExamBundlesStartLevel(startLevel);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnExamBundlesStartLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* We cant really evaluate if the test acutally does what it should do; though the usage of the BundleStartLvlOption is
* shown and we see if this option breaks generally.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BundleStartLvlTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnExamBundlesStartLevel(int startLevel) {
// return new ExamBundlesStartLevel(startLevel);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BundleStartLvlTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnExamBundlesStartLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* We cant really evaluate if the test acutally does what it should do; though the usage of the BundleStartLvlOption is
* shown and we see if this option breaks generally.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BundleStartLvlTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BundleStartLvlTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnExamBundlesStartLevel(int startLevel) {
// return new ExamBundlesStartLevel(startLevel);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnExamBundlesStartLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* We cant really evaluate if the test acutally does what it should do; though the usage of the BundleStartLvlOption is
* shown and we see if this option breaks generally.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BundleStartLvlTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnExamBundlesStartLevel(int startLevel) {
// return new ExamBundlesStartLevel(startLevel);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BundleStartLvlTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnExamBundlesStartLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* We cant really evaluate if the test acutally does what it should do; though the usage of the BundleStartLvlOption is
* shown and we see if this option breaks generally.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BundleStartLvlTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), useOwnExamBundlesStartLevel(4) }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/InvokerConfigurationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnKarafExamSystemConfiguration(String invoker) {
// return new KarafExamSystemConfigurationOption(invoker);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnKarafExamSystemConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* Here's the same problem as for various other tests. We can't really evaluate if we use the correct injector. All we
* can do is simply doing it and check if the test runs correctly. In addition it's a nice usage example for the
* injector part.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class InvokerConfigurationTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnKarafExamSystemConfiguration(String invoker) {
// return new KarafExamSystemConfigurationOption(invoker);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/InvokerConfigurationTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnKarafExamSystemConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* Here's the same problem as for various other tests. We can't really evaluate if we use the correct injector. All we
* can do is simply doing it and check if the test runs correctly. In addition it's a nice usage example for the
* injector part.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class InvokerConfigurationTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/InvokerConfigurationTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnKarafExamSystemConfiguration(String invoker) {
// return new KarafExamSystemConfigurationOption(invoker);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnKarafExamSystemConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* Here's the same problem as for various other tests. We can't really evaluate if we use the correct injector. All we
* can do is simply doing it and check if the test runs correctly. In addition it's a nice usage example for the
* injector part.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class InvokerConfigurationTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option useOwnKarafExamSystemConfiguration(String invoker) {
// return new KarafExamSystemConfigurationOption(invoker);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/InvokerConfigurationTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.useOwnKarafExamSystemConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* Here's the same problem as for various other tests. We can't really evaluate if we use the correct injector. All we
* can do is simply doing it and check if the test runs correctly. In addition it's a nice usage example for the
* injector part.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class InvokerConfigurationTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), useOwnKarafExamSystemConfiguration("junit") }; |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/LoggingCfg.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.ops4j.pax.logging.cfg.
*/
public interface LoggingCfg {
static final String FILE_PATH = "etc/org.ops4j.pax.logging.cfg";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/LoggingCfg.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.ops4j.pax.logging.cfg.
*/
public interface LoggingCfg {
static final String FILE_PATH = "etc/org.ops4j.pax.logging.cfg";
| static final ConfigurationPointer ROOT_LOGGER = new CustomPropertiesPointer("log4j.rootLogger"); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BootDelegationOptionTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage;
import java.io.FileInputStream;
import java.util.Properties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BootDelegationOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BootDelegationOptionTest.java
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.bootDelegationPackage;
import java.io.FileInputStream;
import java.util.Properties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BootDelegationOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", "2.2.5"), |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), logLevel(LogLevel.TRACE), new VMOption("-Xmx1024m"), new VMOption("-XX:MaxPermSize=56m") }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VmSettingsTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VmSettingsTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), logLevel(LogLevel.TRACE), new VMOption("-Xmx1024m"), new VMOption("-XX:MaxPermSize=56m") }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest.java
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration().frameworkUrl( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.2.5").name("Apache Karaf"), | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest.java
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
return new Option[]{
karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.2.5").name("Apache Karaf"), | editConfigurationFileExtend("etc/tests.cfg", "mykey", "myvalue1"), |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.apache.karaf.features.cfg.
*/
public interface FeaturesCfg {
static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/FeaturesCfg.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/org.apache.karaf.features.cfg.
*/
public interface FeaturesCfg {
static final String FILE_PATH = "etc/org.apache.karaf.features.cfg";
| static final ConfigurationPointer REPOSITORIES = new CustomPropertiesPointer("featuresRepositories"); |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/UsersProperties.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/users.properties.
*/
public interface UsersProperties {
static final String FILE_PATH = "etc/users.properties";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/UsersProperties.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/users.properties.
*/
public interface UsersProperties {
static final String FILE_PATH = "etc/users.properties";
| static final ConfigurationPointer KARAF_USER = new CustomPropertiesPointer("karaf"); |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/JreProperties.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
| import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/jre.properties.
*/
public interface JreProperties {
static final String FILE_PATH = "etc/jre.properties";
| // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/ConfigurationPointer.java
// public class ConfigurationPointer {
//
// private String configurationFilePath;
// private String key;
//
// public ConfigurationPointer(String configurationFilePath, String key) {
// this.configurationFilePath = configurationFilePath;
// this.key = key;
// }
//
// public String getConfigurationFilePath() {
// return configurationFilePath;
// }
//
// public String getKey() {
// return key;
// }
//
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/configs/JreProperties.java
import org.openengsb.labs.paxexam.karaf.options.ConfigurationPointer;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.options.configs;
/**
* Pre configured property file pointers to the most commonly used properties in /etc/config.properties and
* /etc/jre.properties.
*/
public interface JreProperties {
static final String FILE_PATH = "etc/jre.properties";
| static final ConfigurationPointer JRE15 = new CustomPropertiesPointer("jre-1.5"); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BootClasspathLibraryOptionTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BootClasspathLibraryOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BootClasspathLibraryOptionTest.java
import static junit.framework.Assert.assertEquals;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.bootClasspathLibrary;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BootClasspathLibraryOptionTest {
@Configuration
public Option[] config() {
return new Option[]{ | karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", "2.2.5"), |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/FileSourceTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Test; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FileSourceTest {
@Configuration
public Option[] config() {
File createTempFile;
try {
createTempFile = File.createTempFile("karaf", ".zip");
} catch (IOException e) {
throw new RuntimeException(e);
}
createTempFile.delete();
try {
System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
copyInputStreamToFile(new URL("mvn:org.apache.karaf/apache-karaf/2.2.4/zip").openStream(),
createTempFile);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/FileSourceTest.java
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Test;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class FileSourceTest {
@Configuration
public Option[] config() {
File createTempFile;
try {
createTempFile = File.createTempFile("karaf", ".zip");
} catch (IOException e) {
throw new RuntimeException(e);
}
createTempFile.delete();
try {
System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
copyInputStreamToFile(new URL("mvn:org.apache.karaf/apache-karaf/2.2.4/zip").openStream(),
createTempFile);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} | return new Option[]{ karafDistributionConfiguration("file://" + createTempFile.toString(), "karaf", |
openengsb-attic/labs-paxexam-karaf | options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import org.ops4j.pax.exam.options.extra.VMOption;
import static java.lang.String.format;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option; | public static Option[] editConfigurationFileExtend(final String configurationFilePath, File source,
String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, String value) {
return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
}
}, keysToUseFromSource);
}
/**
* This option allows to simply replace an entire configuration file with your own one. Simply point to the
* configuration file you would like to have replaced and add the source file which should replace it.
*/
public static Option replaceConfigurationFile(String configurationFilePath, File source) {
return new KarafDistributionConfigurationFileReplacementOption(configurationFilePath, source);
}
/**
* Activates debugging on the embedded Karaf container using the standard 5005 port and holds the vm till you've
* attached the debugger.
*/
public static Option debugConfiguration() {
return debugConfiguration("5005", true);
}
/**
* A very simple and convinient method to set a specific log level without the need of configure the specific option
* itself.
*/ | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
import org.ops4j.pax.exam.options.extra.VMOption;
import static java.lang.String.format;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
public static Option[] editConfigurationFileExtend(final String configurationFilePath, File source,
String... keysToUseFromSource) {
return createOptionListFromFile(source, new FileOptionFactory() {
@Override
public Option createOption(String key, String value) {
return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
}
}, keysToUseFromSource);
}
/**
* This option allows to simply replace an entire configuration file with your own one. Simply point to the
* configuration file you would like to have replaced and add the source file which should replace it.
*/
public static Option replaceConfigurationFile(String configurationFilePath, File source) {
return new KarafDistributionConfigurationFileReplacementOption(configurationFilePath, source);
}
/**
* Activates debugging on the embedded Karaf container using the standard 5005 port and holds the vm till you've
* attached the debugger.
*/
public static Option debugConfiguration() {
return debugConfiguration("5005", true);
}
/**
* A very simple and convinient method to set a specific log level without the need of configure the specific option
* itself.
*/ | public static Option logLevel(LogLevel logLevel) { |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/karafAdaptions/KarafManipulatorFactory.java | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
| import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.osgi.framework.Version; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.karafAdaptions;
/**
* Factory returning the correct version of the manipulator depending on the added Karaf version.
*/
public final class KarafManipulatorFactory {
private KarafManipulatorFactory() {
// Not required for a final class
}
public static KarafManipulator createManipulator(String karafVersion) { | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/karafAdaptions/KarafManipulatorFactory.java
import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.osgi.framework.Version;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.container.internal.karafAdaptions;
/**
* Factory returning the correct version of the manipulator depending on the added Karaf version.
*/
public final class KarafManipulatorFactory {
private KarafManipulatorFactory() {
// Not required for a final class
}
public static KarafManipulator createManipulator(String karafVersion) { | Version version = new NormalisedMavenVersionAdapter(karafVersion); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), logLevel(LogLevel.TRACE) }; |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option logLevel(LogLevel logLevel) {
// return new LogLevelOption(logLevel);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/LogLevelOption.java
// public static enum LogLevel {
// TRACE, DEBUG, INFO, WARN, ERROR
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/LogLevelTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.logLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openengsb.labs.paxexam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class LogLevelTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5"), logLevel(LogLevel.TRACE) }; |
openengsb-attic/labs-paxexam-karaf | regression23/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression23/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepFolderTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepFolderTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepFolderTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepFolderTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepFolderTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepFolderTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option keepRuntimeFolder() {
// return new KeepRuntimeFolderOption();
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkKeepFolderTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import java.io.File;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkKeepFolderTest {
@Configuration
public Option[] config() {
return new Option[]{ karafDistributionConfiguration("mvn:org.apache.karaf/apache-karaf/2.2.5/zip", "karaf", | "2.2.5").unpackDirectory(new File("target/paxexam/unpack/")), keepRuntimeFolder() }; |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/InternalKarafDistributionConfigurationOption.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionBaseConfigurationOption.java
// public class KarafDistributionBaseConfigurationOption implements Option {
//
// protected String frameworkURL;
// protected MavenUrlReference frameworkURLReference;
// protected String name;
// protected String karafVersion;
// protected File unpackDirectory;
// protected boolean useDeployFolder = true;
//
// public KarafDistributionBaseConfigurationOption() {
// frameworkURL = null;
// frameworkURLReference = null;
// name = null;
// karafVersion = null;
// }
//
// public KarafDistributionBaseConfigurationOption(String frameworkURL, String name, String karafVersion) {
// this.frameworkURL = frameworkURL;
// frameworkURLReference = null;
// this.name = name;
// this.karafVersion = karafVersion;
// }
//
// public KarafDistributionBaseConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion) {
// frameworkURL = null;
// this.frameworkURLReference = frameworkURLReference;
// this.name = name;
// this.karafVersion = karafVersion;
// }
//
// /**
// * Simply clones the insterted {@link KarafDistributionConfigurationOption}
// */
// public KarafDistributionBaseConfigurationOption(KarafDistributionBaseConfigurationOption base) {
// frameworkURL = base.frameworkURL;
// frameworkURLReference = base.frameworkURLReference;
// name = base.name;
// karafVersion = base.karafVersion;
// unpackDirectory = base.unpackDirectory;
// useDeployFolder = base.useDeployFolder;
// }
//
// /**
// * Sets the URL of the framework as a String (for example a file).
// */
// public KarafDistributionBaseConfigurationOption frameworkUrl(String frameworkURL) {
// this.frameworkURL = frameworkURL;
// return this;
// }
//
// /**
// * Sets the URL of the frameworks as a maven reference.
// */
// public KarafDistributionBaseConfigurationOption frameworkUrl(MavenUrlReference frameworkURL) {
// frameworkURLReference = frameworkURL;
// return this;
// }
//
// /**
// * Set's the name of the framework. This is only used for logging.
// */
// public KarafDistributionBaseConfigurationOption name(String name) {
// this.name = name;
// return this;
// }
//
// /**
// * The version of karaf used by the framework. That one is required since there is the high possibility that
// * configuration is different between various karaf versions.
// */
// public KarafDistributionBaseConfigurationOption karafVersion(String karafVersion) {
// this.karafVersion = karafVersion;
// return this;
// }
//
// /**
// * Define the unpack directory for the karaf distribution. In this directory a UUID named directory will be created
// * for each environment.
// */
// public KarafDistributionBaseConfigurationOption unpackDirectory(File unpackDirectory) {
// this.unpackDirectory = unpackDirectory;
// return this;
// }
//
// /**
// * Per default the framework simply copies all referenced artifacts (via Pax Exam DistributionOption) to the deploy
// * folder of the karaf (based) distribution. If you don't have such a folder (for any reason) you can set this
// * option to false. PaxExam Karaf will then try to add those deployment urls directly to a features xml instead of
// * copying those files to the deploy folder.
// */
// public KarafDistributionBaseConfigurationOption useDeployFolder(boolean useDeployFolder) {
// this.useDeployFolder = useDeployFolder;
// return this;
// }
//
// public String getFrameworkURL() {
// if (frameworkURL == null && frameworkURLReference == null) {
// throw new IllegalStateException("Either frameworkurl or frameworkUrlReference need to be set.");
// }
// return frameworkURL != null ? frameworkURL : frameworkURLReference.getURL();
// }
//
// public String getName() {
// return name;
// }
//
// public String getKarafVersion() {
// return karafVersion;
// }
//
// public File getUnpackDirectory() {
// return unpackDirectory;
// }
//
// public boolean isUseDeployFolder() {
// return useDeployFolder;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionConfigurationOption.java
// public class KarafDistributionConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public KarafDistributionConfigurationOption() {
// super();
// }
//
// public KarafDistributionConfigurationOption(KarafDistributionBaseConfigurationOption base) {
// super(base);
// }
//
// public KarafDistributionConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion) {
// super(frameworkURLReference, name, karafVersion);
// }
//
// public KarafDistributionConfigurationOption(String frameworkURL, String name, String karafVersion) {
// super(frameworkURL, name, karafVersion);
// }
//
// }
| import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionBaseConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionConfigurationOption; | package org.openengsb.labs.paxexam.karaf.container.internal;
/**
* Extends the {@link KarafDistributionConfigurationOption} to add functionality to store those values also in a
* distribution.info file in the distirbution.
*/
public class InternalKarafDistributionConfigurationOption extends KarafDistributionConfigurationOption {
private static final String NAME = "name";
private static final String KARAF_VERSION = "karafVersion";
private File distributionInfo;
public InternalKarafDistributionConfigurationOption( | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionBaseConfigurationOption.java
// public class KarafDistributionBaseConfigurationOption implements Option {
//
// protected String frameworkURL;
// protected MavenUrlReference frameworkURLReference;
// protected String name;
// protected String karafVersion;
// protected File unpackDirectory;
// protected boolean useDeployFolder = true;
//
// public KarafDistributionBaseConfigurationOption() {
// frameworkURL = null;
// frameworkURLReference = null;
// name = null;
// karafVersion = null;
// }
//
// public KarafDistributionBaseConfigurationOption(String frameworkURL, String name, String karafVersion) {
// this.frameworkURL = frameworkURL;
// frameworkURLReference = null;
// this.name = name;
// this.karafVersion = karafVersion;
// }
//
// public KarafDistributionBaseConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion) {
// frameworkURL = null;
// this.frameworkURLReference = frameworkURLReference;
// this.name = name;
// this.karafVersion = karafVersion;
// }
//
// /**
// * Simply clones the insterted {@link KarafDistributionConfigurationOption}
// */
// public KarafDistributionBaseConfigurationOption(KarafDistributionBaseConfigurationOption base) {
// frameworkURL = base.frameworkURL;
// frameworkURLReference = base.frameworkURLReference;
// name = base.name;
// karafVersion = base.karafVersion;
// unpackDirectory = base.unpackDirectory;
// useDeployFolder = base.useDeployFolder;
// }
//
// /**
// * Sets the URL of the framework as a String (for example a file).
// */
// public KarafDistributionBaseConfigurationOption frameworkUrl(String frameworkURL) {
// this.frameworkURL = frameworkURL;
// return this;
// }
//
// /**
// * Sets the URL of the frameworks as a maven reference.
// */
// public KarafDistributionBaseConfigurationOption frameworkUrl(MavenUrlReference frameworkURL) {
// frameworkURLReference = frameworkURL;
// return this;
// }
//
// /**
// * Set's the name of the framework. This is only used for logging.
// */
// public KarafDistributionBaseConfigurationOption name(String name) {
// this.name = name;
// return this;
// }
//
// /**
// * The version of karaf used by the framework. That one is required since there is the high possibility that
// * configuration is different between various karaf versions.
// */
// public KarafDistributionBaseConfigurationOption karafVersion(String karafVersion) {
// this.karafVersion = karafVersion;
// return this;
// }
//
// /**
// * Define the unpack directory for the karaf distribution. In this directory a UUID named directory will be created
// * for each environment.
// */
// public KarafDistributionBaseConfigurationOption unpackDirectory(File unpackDirectory) {
// this.unpackDirectory = unpackDirectory;
// return this;
// }
//
// /**
// * Per default the framework simply copies all referenced artifacts (via Pax Exam DistributionOption) to the deploy
// * folder of the karaf (based) distribution. If you don't have such a folder (for any reason) you can set this
// * option to false. PaxExam Karaf will then try to add those deployment urls directly to a features xml instead of
// * copying those files to the deploy folder.
// */
// public KarafDistributionBaseConfigurationOption useDeployFolder(boolean useDeployFolder) {
// this.useDeployFolder = useDeployFolder;
// return this;
// }
//
// public String getFrameworkURL() {
// if (frameworkURL == null && frameworkURLReference == null) {
// throw new IllegalStateException("Either frameworkurl or frameworkUrlReference need to be set.");
// }
// return frameworkURL != null ? frameworkURL : frameworkURLReference.getURL();
// }
//
// public String getName() {
// return name;
// }
//
// public String getKarafVersion() {
// return karafVersion;
// }
//
// public File getUnpackDirectory() {
// return unpackDirectory;
// }
//
// public boolean isUseDeployFolder() {
// return useDeployFolder;
// }
//
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionConfigurationOption.java
// public class KarafDistributionConfigurationOption extends KarafDistributionBaseConfigurationOption {
//
// public KarafDistributionConfigurationOption() {
// super();
// }
//
// public KarafDistributionConfigurationOption(KarafDistributionBaseConfigurationOption base) {
// super(base);
// }
//
// public KarafDistributionConfigurationOption(MavenUrlReference frameworkURLReference, String name,
// String karafVersion) {
// super(frameworkURLReference, name, karafVersion);
// }
//
// public KarafDistributionConfigurationOption(String frameworkURL, String name, String karafVersion) {
// super(frameworkURL, name, karafVersion);
// }
//
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/InternalKarafDistributionConfigurationOption.java
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionBaseConfigurationOption;
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionConfigurationOption;
package org.openengsb.labs.paxexam.karaf.container.internal;
/**
* Extends the {@link KarafDistributionConfigurationOption} to add functionality to store those values also in a
* distribution.info file in the distirbution.
*/
public class InternalKarafDistributionConfigurationOption extends KarafDistributionConfigurationOption {
private static final String NAME = "name";
private static final String KARAF_VERSION = "karafVersion";
private File distributionInfo;
public InternalKarafDistributionConfigurationOption( | KarafDistributionBaseConfigurationOption distributionConfigurationOption, File distributionInfo) { |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.OptionUtils.combine;
import java.io.File;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
Option[] base = | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.OptionUtils.combine;
import java.io.File;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
Option[] base = | new Option[]{ karafDistributionConfiguration().frameworkUrl( |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.OptionUtils.combine;
import java.io.File;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
Option[] base =
new Option[]{ karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.2.5").name("Apache Karaf") };
base =
combine(
base, | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static Option editConfigurationFileExtend(String configurationFilePath, String key, String value) {
// return new KarafDistributionConfigurationFileExtendOption(configurationFilePath, key, value);
// }
//
// Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest.java
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.ConfigurationAdmin;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.fail;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.OptionUtils.combine;
import java.io.File;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class BaseKarafDefaultFrameworkDuplicatedPropertyEntryFromFileTest {
@Inject
private BundleContext ctx;
@Configuration
public Option[] config() {
Option[] base =
new Option[]{ karafDistributionConfiguration().frameworkUrl(
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject())
.karafVersion("2.2.5").name("Apache Karaf") };
base =
combine(
base, | editConfigurationFileExtend("etc/tests.cfg", new File( |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/ExamFeaturesFileFactory.java | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
| import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.ops4j.pax.exam.Info;
import org.osgi.framework.Version; | package org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
/**
* Factory to create a features.xml file meeting the currently used pax-exam version.
*/
public final class ExamFeaturesFileFactory {
private ExamFeaturesFileFactory() {
// Not required for a final class
}
public static ExamFeaturesFile createExamFeaturesFile() { | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/ExamFeaturesFileFactory.java
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.ops4j.pax.exam.Info;
import org.osgi.framework.Version;
package org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
/**
* Factory to create a features.xml file meeting the currently used pax-exam version.
*/
public final class ExamFeaturesFileFactory {
private ExamFeaturesFileFactory() {
// Not required for a final class
}
public static ExamFeaturesFile createExamFeaturesFile() { | return createExamFeaturesFile("", Constants.DEFAULT_START_LEVEL); |
openengsb-attic/labs-paxexam-karaf | container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/ExamFeaturesFileFactory.java | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
| import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.ops4j.pax.exam.Info;
import org.osgi.framework.Version; | package org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
/**
* Factory to create a features.xml file meeting the currently used pax-exam version.
*/
public final class ExamFeaturesFileFactory {
private ExamFeaturesFileFactory() {
// Not required for a final class
}
public static ExamFeaturesFile createExamFeaturesFile() {
return createExamFeaturesFile("", Constants.DEFAULT_START_LEVEL);
}
public static ExamFeaturesFile createExamFeaturesFile(String featuresXml) {
return createExamFeaturesFile(featuresXml, Constants.DEFAULT_START_LEVEL);
}
public static ExamFeaturesFile createExamFeaturesFile(String extension, int startLevel) {
Version examVersion = retrieveVersion();
if (examVersion.getMajor() < 2) {
throw new IllegalStateException("Exam versions < 2.0 are not supported");
}
if (examVersion.getMajor() == 2 && examVersion.getMinor() < 4) {
return new ExamFeaturesFile23(extension, startLevel);
}
return new ExamFeaturesFile24(extension, startLevel);
}
private static Version retrieveVersion() { | // Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/Constants.java
// public interface Constants {
//
// static final String FEATURES_CFG_LOCATION = "/etc/org.apache.karaf.features.cfg";
//
// static final int SYSTEM_BUNDLE = 0;
//
// static final int DEFAULT_START_LEVEL = 5;
//
// }
//
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/util/NormalisedMavenVersionAdapter.java
// public class NormalisedMavenVersionAdapter extends Version {
//
// private static final String VERSION_PATTERN = "[^0-9.]";
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro, String qualifier) {
// super(major, minor, micro, qualifier);
// }
//
// public NormalisedMavenVersionAdapter(int major, int minor, int micro) {
// super(major, minor, micro);
// }
//
// public NormalisedMavenVersionAdapter(String version) {
// super(version.replace("_", ".").replaceAll(VERSION_PATTERN, ""));
// }
// }
// Path: container/src/main/java/org/openengsb/labs/paxexam/karaf/container/internal/examAdaptions/ExamFeaturesFileFactory.java
import org.openengsb.labs.paxexam.karaf.container.internal.Constants;
import org.openengsb.labs.paxexam.karaf.container.internal.util.NormalisedMavenVersionAdapter;
import org.ops4j.pax.exam.Info;
import org.osgi.framework.Version;
package org.openengsb.labs.paxexam.karaf.container.internal.examAdaptions;
/**
* Factory to create a features.xml file meeting the currently used pax-exam version.
*/
public final class ExamFeaturesFileFactory {
private ExamFeaturesFileFactory() {
// Not required for a final class
}
public static ExamFeaturesFile createExamFeaturesFile() {
return createExamFeaturesFile("", Constants.DEFAULT_START_LEVEL);
}
public static ExamFeaturesFile createExamFeaturesFile(String featuresXml) {
return createExamFeaturesFile(featuresXml, Constants.DEFAULT_START_LEVEL);
}
public static ExamFeaturesFile createExamFeaturesFile(String extension, int startLevel) {
Version examVersion = retrieveVersion();
if (examVersion.getMajor() < 2) {
throw new IllegalStateException("Exam versions < 2.0 are not supported");
}
if (examVersion.getMajor() == 2 && examVersion.getMinor() < 4) {
return new ExamFeaturesFile23(extension, startLevel);
}
return new ExamFeaturesFile24(extension, startLevel);
}
private static Version retrieveVersion() { | return new NormalisedMavenVersionAdapter(Info.getPaxExamVersion()); |
openengsb-attic/labs-paxexam-karaf | regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectOpenEngSBTest.java | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
| import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectOpenEngSBTest {
@Configuration
public Option[] config() { | // Path: options/src/main/java/org/openengsb/labs/paxexam/karaf/options/KarafDistributionOption.java
// public static KarafDistributionBaseConfigurationOption karafDistributionConfiguration(String frameworkURL,
// String name, String karafVersion) {
// return new KarafDistributionConfigurationOption(frameworkURL, name, karafVersion);
// }
// Path: regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression/VersionAsInProjectOpenEngSBTest.java
import static junit.framework.Assert.assertTrue;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.CoreOptions.maven;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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 org.openengsb.labs.paxexam.karaf.regression;
/**
* This test should validate if the versionAsInProject tags work as expected.
*/
@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
public class VersionAsInProjectOpenEngSBTest {
@Configuration
public Option[] config() { | return new Option[]{ karafDistributionConfiguration().frameworkUrl( |
fauu/HelixEngine | core/src/com/github/fauu/helix/datum/Tile.java | // Path: core/src/com/github/fauu/helix/TilePermission.java
// public enum TilePermission {
//
// OBSTACLE("Obstacle", -1),
// PASSAGE("Area Passage", -1),
// RAMP("Ramp", -1),
// LEVEL0("Level 0", 0),
// LEVEL1("Level 1", 1),
// LEVEL2("Level 2", 2),
// LEVEL3("Level 3", 3),
// LEVEL4("Level 4", 4),
// LEVEL5("Level 5", 5),
// LEVEL6("Level 6", 6),
// LEVEL7("Level 7", 7);
//
// private String name;
//
// private int elevation;
//
// private static final Map<String, TilePermission> nameToValue
// = new HashMap<String, TilePermission>();
//
// static {
// for (TilePermission permission : TilePermission.values()) {
// nameToValue.put(permission.name, permission);
// }
// }
//
// private TilePermission(String name, int elevation) {
// this.name = name;
// this.elevation = elevation;
// }
//
// public String getName() {
// return name;
// }
//
// public int getElevation() {
// return elevation;
// }
//
// public static TilePermission fromString(String name) {
// if (nameToValue.containsKey(name)) {
// return nameToValue.get(name);
// }
//
// throw new NoSuchElementException(name + " not found");
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
| import com.github.fauu.helix.util.IntVector2;
import com.github.fauu.helix.TilePermission; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.datum;
public class Tile {
private TilePermission permissions;
private TileAreaPassage areaPassage;
public Tile() {
setPermissions(TilePermission.LEVEL0);
}
public TilePermission getPermissions() {
return permissions;
}
public void setPermissions(TilePermission permissions) {
this.permissions = permissions;
}
public TileAreaPassage getAreaPassage() {
return areaPassage;
}
public void setAreaPassage(TileAreaPassage passage) {
areaPassage = passage;
}
| // Path: core/src/com/github/fauu/helix/TilePermission.java
// public enum TilePermission {
//
// OBSTACLE("Obstacle", -1),
// PASSAGE("Area Passage", -1),
// RAMP("Ramp", -1),
// LEVEL0("Level 0", 0),
// LEVEL1("Level 1", 1),
// LEVEL2("Level 2", 2),
// LEVEL3("Level 3", 3),
// LEVEL4("Level 4", 4),
// LEVEL5("Level 5", 5),
// LEVEL6("Level 6", 6),
// LEVEL7("Level 7", 7);
//
// private String name;
//
// private int elevation;
//
// private static final Map<String, TilePermission> nameToValue
// = new HashMap<String, TilePermission>();
//
// static {
// for (TilePermission permission : TilePermission.values()) {
// nameToValue.put(permission.name, permission);
// }
// }
//
// private TilePermission(String name, int elevation) {
// this.name = name;
// this.elevation = elevation;
// }
//
// public String getName() {
// return name;
// }
//
// public int getElevation() {
// return elevation;
// }
//
// public static TilePermission fromString(String name) {
// if (nameToValue.containsKey(name)) {
// return nameToValue.get(name);
// }
//
// throw new NoSuchElementException(name + " not found");
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
// Path: core/src/com/github/fauu/helix/datum/Tile.java
import com.github.fauu.helix.util.IntVector2;
import com.github.fauu.helix.TilePermission;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.datum;
public class Tile {
private TilePermission permissions;
private TileAreaPassage areaPassage;
public Tile() {
setPermissions(TilePermission.LEVEL0);
}
public TilePermission getPermissions() {
return permissions;
}
public void setPermissions(TilePermission permissions) {
this.permissions = permissions;
}
public TileAreaPassage getAreaPassage() {
return areaPassage;
}
public void setAreaPassage(TileAreaPassage passage) {
areaPassage = passage;
}
| public static Tile get(Tile[][] tiles, IntVector2 coords) { |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java | // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
| import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire | // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire | private ComponentMapper<DimensionsComponent> dimensionsMapper; |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java | // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
| import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire
private ComponentMapper<DimensionsComponent> dimensionsMapper;
@Wire | // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire
private ComponentMapper<DimensionsComponent> dimensionsMapper;
@Wire | private HelixCamera camera; |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java | // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
| import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire
private ComponentMapper<DimensionsComponent> dimensionsMapper;
@Wire
private HelixCamera camera;
public void centerCameraOnArea() {
Entity area = world.getManager(TagManager.class).getEntity("area");
| // Path: core/src/com/github/fauu/helix/component/DimensionsComponent.java
// public class DimensionsComponent extends Component {
//
// private IntVector2 dimensions;
//
// public DimensionsComponent() {
// this.dimensions = new IntVector2();
// }
//
// public DimensionsComponent(IntVector2 dimensions) {
// this.dimensions = new IntVector2(dimensions);
// }
//
// public IntVector2 get() {
// return dimensions;
// }
//
// public void set(IntVector2 dimensions) {
// this.dimensions.set(dimensions);
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/manager/CameraIntermediary.java
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.artemis.managers.TagManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.component.DimensionsComponent;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.util.IntVector2;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.manager;
public class CameraIntermediary extends Manager {
@Wire
private ComponentMapper<DimensionsComponent> dimensionsMapper;
@Wire
private HelixCamera camera;
public void centerCameraOnArea() {
Entity area = world.getManager(TagManager.class).getEntity("area");
| IntVector2 dimensions = dimensionsMapper.get(area).get(); |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/ui/HEMenuBar.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
| import com.badlogic.gdx.Input;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.kotcrab.vis.ui.widget.Menu;
import com.kotcrab.vis.ui.widget.MenuBar;
import com.kotcrab.vis.ui.widget.MenuItem; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.ui;
public class HEMenuBar extends MenuBar {
public HEMenuBar(final Stage stage) {
super();
Menu fileMenu = new Menu("File");
MenuItem newAreaMenuItem = new MenuItem("New Area...",
new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) { | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/ui/HEMenuBar.java
import com.badlogic.gdx.Input;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.kotcrab.vis.ui.widget.Menu;
import com.kotcrab.vis.ui.widget.MenuBar;
import com.kotcrab.vis.ui.widget.MenuItem;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.ui;
public class HEMenuBar extends MenuBar {
public HEMenuBar(final Stage stage) {
super();
Menu fileMenu = new Menu("File");
MenuItem newAreaMenuItem = new MenuItem("New Area...",
new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) { | HelixEditor.getInstance().newAreaAction(); |
fauu/HelixEngine | core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java | // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
| import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire | // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
// Path: core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire | private ComponentMapper<DisplayableComponent> displayableMapper; |
fauu/HelixEngine | core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java | // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
| import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire
private ComponentMapper<DisplayableComponent> displayableMapper;
public AnimationProcessingSystem() {
super(Aspect.getAspectForAll(DisplayableComponent.class));
}
@Override
protected void process(Entity e) { | // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
// Path: core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire
private ComponentMapper<DisplayableComponent> displayableMapper;
public AnimationProcessingSystem() {
super(Aspect.getAspectForAll(DisplayableComponent.class));
}
@Override
protected void process(Entity e) { | Displayable displayable = displayableMapper.get(e).get(); |
fauu/HelixEngine | core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java | // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
| import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire
private ComponentMapper<DisplayableComponent> displayableMapper;
public AnimationProcessingSystem() {
super(Aspect.getAspectForAll(DisplayableComponent.class));
}
@Override
protected void process(Entity e) {
Displayable displayable = displayableMapper.get(e).get();
| // Path: core/src/com/github/fauu/helix/component/DisplayableComponent.java
// public class DisplayableComponent extends Component {
//
// private Displayable displayable;
//
// public DisplayableComponent() { }
//
// public DisplayableComponent(Displayable displayable) {
// this();
//
// set(displayable);
// }
//
// public Displayable get() {
// return displayable;
// }
//
// public void set(Displayable displayable) {
// this.displayable = displayable;
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/Displayable.java
// public abstract class Displayable { }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
// Path: core/src/com/github/fauu/helix/system/AnimationProcessingSystem.java
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.Gdx;
import com.github.fauu.helix.component.DisplayableComponent;
import com.github.fauu.helix.displayable.Displayable;
import com.github.fauu.helix.displayable.ModelDisplayable;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
// TODO: Cache animation controllers
public class AnimationProcessingSystem extends EntityProcessingSystem {
@Wire
private ComponentMapper<DisplayableComponent> displayableMapper;
public AnimationProcessingSystem() {
super(Aspect.getAspectForAll(DisplayableComponent.class));
}
@Override
protected void process(Entity e) {
Displayable displayable = displayableMapper.get(e).get();
| if (displayable instanceof ModelDisplayable) { |
fauu/HelixEngine | core/src/com/github/fauu/helix/datum/TileAreaPassage.java | // Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
| import com.github.fauu.helix.util.IntVector2; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.datum;
public class TileAreaPassage {
private String targetAreaName;
| // Path: core/src/com/github/fauu/helix/util/IntVector2.java
// public class IntVector2 {
//
// public int x;
//
// public int y;
//
// public IntVector2() { }
//
// public IntVector2(int x, int y) {
// set(x, y);
// }
//
// public IntVector2(IntVector2 source) {
// set(source);
// }
//
// public void set(int x, int y) {
// this.x = x;
// this.y = y;
// }
//
// public void set(IntVector2 source) {
// set(source.x, source.y);
// }
//
// public IntVector2 add(IntVector2 other) {
// set(x + other.x, y + other.y);
//
// return this;
// }
//
// public IntVector2 sub(IntVector2 other) {
// set(x - other.x, y - other.y);
//
// return this;
// }
//
// public IntVector2 cpy() {
// return new IntVector2(x, y);
// }
//
// public IntVector2 scl(int value) {
// x *= value;
// y *= value;
//
// return this;
// }
//
// public Vector2 toVector2() {
// return new Vector2(x, y);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, 0);
// }
//
// @Override
// public String toString() {
// return "[" + x + "," + y + "]";
// }
//
// }
// Path: core/src/com/github/fauu/helix/datum/TileAreaPassage.java
import com.github.fauu.helix.util.IntVector2;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.datum;
public class TileAreaPassage {
private String targetAreaName;
| private IntVector2 targetCoords; |
fauu/HelixEngine | core/src/com/github/fauu/helix/graphics/HelixCamera.java | // Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.util.IntVector3;
import com.badlogic.gdx.Gdx; | }
public HelixCamera(float fieldOfView,
Vector3 targetPosition,
float near,
float far) {
super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
this.targetPosition = new Vector3();
this.near = near;
this.far = far;
this.translate(0, -13, 17);
this.lookAt(0, 0, 0);
targetPositionDelta = new Vector3();
translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
}
public void translateTargetPosition(Vector3 translation) {
translateTargetPosition(translation.x, translation.y, translation.z);
}
public void translateTargetPosition(float x, float y, float z) {
super.translate(x, y, z);
targetPosition.add(x, y, z);
targetPositionDelta.set(x, y, z);
}
| // Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
import com.badlogic.gdx.graphics.PerspectiveCamera;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.util.IntVector3;
import com.badlogic.gdx.Gdx;
}
public HelixCamera(float fieldOfView,
Vector3 targetPosition,
float near,
float far) {
super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
this.targetPosition = new Vector3();
this.near = near;
this.far = far;
this.translate(0, -13, 17);
this.lookAt(0, 0, 0);
targetPositionDelta = new Vector3();
translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
}
public void translateTargetPosition(Vector3 translation) {
translateTargetPosition(translation.x, translation.y, translation.z);
}
public void translateTargetPosition(float x, float y, float z) {
super.translate(x, y, z);
targetPosition.add(x, y, z);
targetPositionDelta.set(x, y, z);
}
| public void updateTargetPosition(IntVector3 logicalPosition) { |
fauu/HelixEngine | core/src/com/github/fauu/helix/system/ScreenFadingSystem.java | // Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
| import com.artemis.annotations.Wire;
import com.artemis.systems.VoidEntitySystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.github.fauu.helix.graphics.HelixCamera; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
public class ScreenFadingSystem extends VoidEntitySystem {
private ShapeRenderer shapeRenderer;
private FadeType fadeType;
private float fadeDuration;
private float fadeLevel;
@Wire | // Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
// Path: core/src/com/github/fauu/helix/system/ScreenFadingSystem.java
import com.artemis.annotations.Wire;
import com.artemis.systems.VoidEntitySystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.github.fauu.helix.graphics.HelixCamera;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.system;
public class ScreenFadingSystem extends VoidEntitySystem {
private ShapeRenderer shapeRenderer;
private FadeType fadeType;
private float fadeDuration;
private float fadeLevel;
@Wire | private HelixCamera camera; |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/ui/dialog/NewAreaDialog.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
| import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.kotcrab.vis.ui.widget.VisTable;
import com.kotcrab.vis.ui.widget.VisLabel;
import com.kotcrab.vis.ui.widget.VisTextButton;
import com.kotcrab.vis.ui.widget.VisTextField;
import com.kotcrab.vis.ui.widget.VisWindow; | fieldsetContainer.add(widthField);
fieldsetContainer.add(new VisLabel("x"));
final VisTextField lengthField = new VisTextField("48");
lengthField.setMaxLength(3);
fieldsetContainer.add(lengthField);
fieldsetContainer.row();
// TODO: Get rid of magic numbers. Here, there and everywhere.
add(fieldsetContainer).padTop(3).spaceBottom(8);
row();
VisTable actionButtonsContainer = new VisTable(true);
VisTextButton cancelButton = new VisTextButton("Cancel");
cancelButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
fadeOut();
}
});
actionButtonsContainer.add(cancelButton);
VisTextButton createButton = new VisTextButton("Create");
createButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) { | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/ui/dialog/NewAreaDialog.java
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.kotcrab.vis.ui.widget.VisTable;
import com.kotcrab.vis.ui.widget.VisLabel;
import com.kotcrab.vis.ui.widget.VisTextButton;
import com.kotcrab.vis.ui.widget.VisTextField;
import com.kotcrab.vis.ui.widget.VisWindow;
fieldsetContainer.add(widthField);
fieldsetContainer.add(new VisLabel("x"));
final VisTextField lengthField = new VisTextField("48");
lengthField.setMaxLength(3);
fieldsetContainer.add(lengthField);
fieldsetContainer.row();
// TODO: Get rid of magic numbers. Here, there and everywhere.
add(fieldsetContainer).padTop(3).spaceBottom(8);
row();
VisTable actionButtonsContainer = new VisTable(true);
VisTextButton cancelButton = new VisTextButton("Cancel");
cancelButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
fadeOut();
}
});
actionButtonsContainer.add(cancelButton);
VisTextButton createButton = new VisTextButton("Create");
createButton.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) { | HelixEditor.getInstance().closeCurrentAreaAction(); |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/state/ToolbarState.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/ToolbarStateChangedEvent.java
// public class ToolbarStateChangedEvent {
//
// private ToolType message;
//
// public ToolbarStateChangedEvent(ToolType message) {
// this.message = message;
// }
//
// public ToolType getMessage() {
// return message;
// }
//
// }
| import com.github.fauu.helix.editor.ToolType;
import com.github.fauu.helix.editor.event.ToolbarStateChangedEvent;
import com.github.fauu.helix.editor.HelixEditor; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class ToolbarState {
private ToolType activeTool;
public void initialize(ToolType type) {
setActiveTool(type);
}
public ToolType getActiveTool() {
return activeTool;
}
public void setActiveTool(ToolType type) {
activeTool = type;
| // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/ToolbarStateChangedEvent.java
// public class ToolbarStateChangedEvent {
//
// private ToolType message;
//
// public ToolbarStateChangedEvent(ToolType message) {
// this.message = message;
// }
//
// public ToolType getMessage() {
// return message;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/state/ToolbarState.java
import com.github.fauu.helix.editor.ToolType;
import com.github.fauu.helix.editor.event.ToolbarStateChangedEvent;
import com.github.fauu.helix.editor.HelixEditor;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class ToolbarState {
private ToolType activeTool;
public void initialize(ToolType type) {
setActiveTool(type);
}
public ToolType getActiveTool() {
return activeTool;
}
public void setActiveTool(ToolType type) {
activeTool = type;
| HelixEditor.getInstance() |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/state/ToolbarState.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/ToolbarStateChangedEvent.java
// public class ToolbarStateChangedEvent {
//
// private ToolType message;
//
// public ToolbarStateChangedEvent(ToolType message) {
// this.message = message;
// }
//
// public ToolType getMessage() {
// return message;
// }
//
// }
| import com.github.fauu.helix.editor.ToolType;
import com.github.fauu.helix.editor.event.ToolbarStateChangedEvent;
import com.github.fauu.helix.editor.HelixEditor; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class ToolbarState {
private ToolType activeTool;
public void initialize(ToolType type) {
setActiveTool(type);
}
public ToolType getActiveTool() {
return activeTool;
}
public void setActiveTool(ToolType type) {
activeTool = type;
HelixEditor.getInstance()
.getWorldEventBus() | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/ToolbarStateChangedEvent.java
// public class ToolbarStateChangedEvent {
//
// private ToolType message;
//
// public ToolbarStateChangedEvent(ToolType message) {
// this.message = message;
// }
//
// public ToolType getMessage() {
// return message;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/state/ToolbarState.java
import com.github.fauu.helix.editor.ToolType;
import com.github.fauu.helix.editor.event.ToolbarStateChangedEvent;
import com.github.fauu.helix.editor.HelixEditor;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class ToolbarState {
private ToolType activeTool;
public void initialize(ToolType type) {
setActiveTool(type);
}
public ToolType getActiveTool() {
return activeTool;
}
public void setActiveTool(ToolType type) {
activeTool = type;
HelixEditor.getInstance()
.getWorldEventBus() | .post(new ToolbarStateChangedEvent(type)); |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/state/TilePassageAreaListState.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/TilePassageAreaListStateChangedEvent.java
// public class TilePassageAreaListStateChangedEvent {
//
// private TilePassageAreaListState message;
//
// public TilePassageAreaListStateChangedEvent(TilePassageAreaListState message) {
// this.message = message;
// }
//
// public TilePassageAreaListState getMessage() {
// return message;
// }
//
// }
| import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.event.TilePassageAreaListStateChangedEvent;
import com.badlogic.gdx.utils.Array; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class TilePassageAreaListState {
private Array<String> areaNames;
private String selectedAreaName;
public TilePassageAreaListState() {
areaNames = new Array<>();
}
public void initialize(Array<String> areaNames, String selectedAreaName) {
this.areaNames = areaNames;
this.selectedAreaName = selectedAreaName;
| // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/TilePassageAreaListStateChangedEvent.java
// public class TilePassageAreaListStateChangedEvent {
//
// private TilePassageAreaListState message;
//
// public TilePassageAreaListStateChangedEvent(TilePassageAreaListState message) {
// this.message = message;
// }
//
// public TilePassageAreaListState getMessage() {
// return message;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/state/TilePassageAreaListState.java
import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.event.TilePassageAreaListStateChangedEvent;
import com.badlogic.gdx.utils.Array;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class TilePassageAreaListState {
private Array<String> areaNames;
private String selectedAreaName;
public TilePassageAreaListState() {
areaNames = new Array<>();
}
public void initialize(Array<String> areaNames, String selectedAreaName) {
this.areaNames = areaNames;
this.selectedAreaName = selectedAreaName;
| HelixEditor.getInstance() |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/state/TilePassageAreaListState.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/TilePassageAreaListStateChangedEvent.java
// public class TilePassageAreaListStateChangedEvent {
//
// private TilePassageAreaListState message;
//
// public TilePassageAreaListStateChangedEvent(TilePassageAreaListState message) {
// this.message = message;
// }
//
// public TilePassageAreaListState getMessage() {
// return message;
// }
//
// }
| import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.event.TilePassageAreaListStateChangedEvent;
import com.badlogic.gdx.utils.Array; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class TilePassageAreaListState {
private Array<String> areaNames;
private String selectedAreaName;
public TilePassageAreaListState() {
areaNames = new Array<>();
}
public void initialize(Array<String> areaNames, String selectedAreaName) {
this.areaNames = areaNames;
this.selectedAreaName = selectedAreaName;
HelixEditor.getInstance()
.getUIEventBus() | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/event/TilePassageAreaListStateChangedEvent.java
// public class TilePassageAreaListStateChangedEvent {
//
// private TilePassageAreaListState message;
//
// public TilePassageAreaListStateChangedEvent(TilePassageAreaListState message) {
// this.message = message;
// }
//
// public TilePassageAreaListState getMessage() {
// return message;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/state/TilePassageAreaListState.java
import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.event.TilePassageAreaListStateChangedEvent;
import com.badlogic.gdx.utils.Array;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.state;
public class TilePassageAreaListState {
private Array<String> areaNames;
private String selectedAreaName;
public TilePassageAreaListState() {
areaNames = new Array<>();
}
public void initialize(Array<String> areaNames, String selectedAreaName) {
this.areaNames = areaNames;
this.selectedAreaName = selectedAreaName;
HelixEditor.getInstance()
.getUIEventBus() | .post(new TilePassageAreaListStateChangedEvent(this)); |
fauu/HelixEngine | core/src/com/github/fauu/helix/json/wrapper/AreaWrapper.java | // Path: core/src/com/github/fauu/helix/AreaType.java
// public enum AreaType {
//
// INDOOR,
// OUTDOOR
//
// }
| import java.util.ArrayList;
import com.github.fauu.helix.AreaType; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.json.wrapper;
public class AreaWrapper {
public int width;
public int length;
| // Path: core/src/com/github/fauu/helix/AreaType.java
// public enum AreaType {
//
// INDOOR,
// OUTDOOR
//
// }
// Path: core/src/com/github/fauu/helix/json/wrapper/AreaWrapper.java
import java.util.ArrayList;
import com.github.fauu.helix.AreaType;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.json.wrapper;
public class AreaWrapper {
public int width;
public int length;
| public AreaType type; |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/displayable/TilePermissionsGridDisplayable.java | // Path: core/src/com/github/fauu/helix/datum/Tile.java
// public class Tile {
//
// private TilePermission permissions;
//
// private TileAreaPassage areaPassage;
//
// public Tile() {
// setPermissions(TilePermission.LEVEL0);
// }
//
// public TilePermission getPermissions() {
// return permissions;
// }
//
// public void setPermissions(TilePermission permissions) {
// this.permissions = permissions;
// }
//
// public TileAreaPassage getAreaPassage() {
// return areaPassage;
// }
//
// public void setAreaPassage(TileAreaPassage passage) {
// areaPassage = passage;
// }
//
// public static Tile get(Tile[][] tiles, IntVector2 coords) {
// return tiles[coords.y][coords.x];
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
| import java.util.Map;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Pool;
import com.github.fauu.helix.datum.Tile;
import com.github.fauu.helix.displayable.ModelDisplayable;
import java.util.HashMap; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.displayable;
public class TilePermissionsGridDisplayable extends ModelDisplayable {
private static final float Z_OFFSET = -0.02f;
private TextureAtlas atlas;
private ModelInstance instance;
| // Path: core/src/com/github/fauu/helix/datum/Tile.java
// public class Tile {
//
// private TilePermission permissions;
//
// private TileAreaPassage areaPassage;
//
// public Tile() {
// setPermissions(TilePermission.LEVEL0);
// }
//
// public TilePermission getPermissions() {
// return permissions;
// }
//
// public void setPermissions(TilePermission permissions) {
// this.permissions = permissions;
// }
//
// public TileAreaPassage getAreaPassage() {
// return areaPassage;
// }
//
// public void setAreaPassage(TileAreaPassage passage) {
// areaPassage = passage;
// }
//
// public static Tile get(Tile[][] tiles, IntVector2 coords) {
// return tiles[coords.y][coords.x];
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/ModelDisplayable.java
// public abstract class ModelDisplayable extends Displayable
// implements RenderableProvider {
//
// protected ModelInstance instance;
//
// protected AnimationController animationController;
//
// public AnimationController getAnimationController() {
// return animationController;
// }
//
// public boolean animateIfAnimationExists(String id) {
// for (Animation animation : instance.animations) {
// if (animation.id.equalsIgnoreCase(id)) {
// animationController.setAnimation(id);
//
// return true;
// }
// }
//
// return false;
// }
//
// public void updateTranslation(Vector3 translation) {
// instance.transform.setToTranslation(translation);
// }
//
// public void updateOpacity(float opacity) {
// for (Material material : instance.materials) {
// BlendingAttribute ba
// = (BlendingAttribute) material.get(BlendingAttribute.Type);
//
// ba.opacity = opacity;
// }
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/displayable/TilePermissionsGridDisplayable.java
import java.util.Map;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.VertexAttributes;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.graphics.g3d.Material;
import com.badlogic.gdx.graphics.g3d.ModelInstance;
import com.badlogic.gdx.graphics.g3d.Renderable;
import com.badlogic.gdx.graphics.g3d.attributes.TextureAttribute;
import com.badlogic.gdx.graphics.g3d.utils.MeshBuilder;
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Pool;
import com.github.fauu.helix.datum.Tile;
import com.github.fauu.helix.displayable.ModelDisplayable;
import java.util.HashMap;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.displayable;
public class TilePermissionsGridDisplayable extends ModelDisplayable {
private static final float Z_OFFSET = -0.02f;
private TextureAtlas atlas;
private ModelInstance instance;
| public TilePermissionsGridDisplayable(Tile[][] tiles, TextureAtlas atlas) { |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/ui/HEToolbox.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
| import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.ButtonGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.ToolType;
import com.kotcrab.vis.ui.widget.VisTable;
import com.kotcrab.vis.ui.widget.VisTextButton; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.ui;
public class HEToolbox extends VisTable {
public HEToolbox() {
super(true);
ButtonGroup<Button> toolButtons = new ButtonGroup<>();
| // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
//
// Path: editor/src/com/github/fauu/helix/editor/ToolType.java
// public enum ToolType {
//
// TILE_PERMISSIONS;
//
// @Override
// public String toString() {
// switch (this) {
// case TILE_PERMISSIONS: return "Tile Permissions";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/ui/HEToolbox.java
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.ButtonGroup;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.ToolType;
import com.kotcrab.vis.ui.widget.VisTable;
import com.kotcrab.vis.ui.widget.VisTextButton;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor.ui;
public class HEToolbox extends VisTable {
public HEToolbox() {
super(true);
ButtonGroup<Button> toolButtons = new ButtonGroup<>();
| for (final ToolType type : ToolType.values()) { |
fauu/HelixEngine | core/src/com/github/fauu/helix/screen/Overworld.java | // Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
| import com.artemis.World;
import com.artemis.WorldConfiguration;
import com.artemis.managers.GroupManager;
import com.artemis.managers.TagManager;
import com.artemis.managers.UuidEntityManager;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.manager.*;
import com.github.fauu.helix.system.*; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.screen;
public class Overworld implements Screen {
private World world;
| // Path: core/src/com/github/fauu/helix/graphics/HelixCamera.java
// public class HelixCamera extends PerspectiveCamera {
//
// private static final Vector3 INITIAL_POSITION;
//
// private static final float POSITION_Y_TO_Z_RATIO;
//
// private static final Vector3 DEFAULT_TARGET_DISPLACEMENT;
//
// private Vector3 targetPosition;
//
// private Vector3 targetPositionDelta;
//
// static {
// INITIAL_POSITION = new Vector3(0, -13, 17);
// POSITION_Y_TO_Z_RATIO = INITIAL_POSITION.y / INITIAL_POSITION.z;
// DEFAULT_TARGET_DISPLACEMENT = new Vector3(.5f, .6f, 0);
// }
//
// public HelixCamera(float fieldOfView,
// Vector3 targetPosition,
// float near,
// float far) {
// super(fieldOfView, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//
// this.targetPosition = new Vector3();
// this.near = near;
// this.far = far;
// this.translate(0, -13, 17);
// this.lookAt(0, 0, 0);
//
// targetPositionDelta = new Vector3();
//
// translateTargetPosition(targetPosition.add(DEFAULT_TARGET_DISPLACEMENT));
// }
//
// public void translateTargetPosition(Vector3 translation) {
// translateTargetPosition(translation.x, translation.y, translation.z);
// }
//
// public void translateTargetPosition(float x, float y, float z) {
// super.translate(x, y, z);
//
// targetPosition.add(x, y, z);
// targetPositionDelta.set(x, y, z);
// }
//
// public void updateTargetPosition(IntVector3 logicalPosition) {
// Vector3 translation
// = logicalPosition.cpy().toVector3()
// .add(DEFAULT_TARGET_DISPLACEMENT)
// .sub(targetPosition);
//
// translateTargetPosition(translation);
// }
//
// public Vector3 getTargetPositionDelta() {
// return targetPositionDelta;
// }
//
// public void resetPositionDelta() {
// targetPositionDelta.setZero();
// }
//
// }
// Path: core/src/com/github/fauu/helix/screen/Overworld.java
import com.artemis.World;
import com.artemis.WorldConfiguration;
import com.artemis.managers.GroupManager;
import com.artemis.managers.TagManager;
import com.artemis.managers.UuidEntityManager;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.graphics.HelixCamera;
import com.github.fauu.helix.manager.*;
import com.github.fauu.helix.system.*;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.screen;
public class Overworld implements Screen {
private World world;
| private HelixCamera camera; |
fauu/HelixEngine | core/src/com/github/fauu/helix/graphics/AnimationSet.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
| import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import java.util.EnumMap; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.graphics;
public class AnimationSet {
private static final String DIRECTORY_NAME;
private static final String EXTENSION;
private static final String TEXTURE_EXTENSION;
| // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
// Path: core/src/com/github/fauu/helix/graphics/AnimationSet.java
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import java.util.EnumMap;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.graphics;
public class AnimationSet {
private static final String DIRECTORY_NAME;
private static final String EXTENSION;
private static final String TEXTURE_EXTENSION;
| private static final Direction[] DIRECTIONS; |
fauu/HelixEngine | core/src/com/github/fauu/helix/manager/PlayerManager.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/CharacterDisplayable.java
// public class CharacterDisplayable extends DecalDisplayable {
//
// @Wire
// private AssetManager assetManager;
//
// protected AnimationSet animations;
//
// public CharacterDisplayable(IntVector3 logicalPosition,
// String animationSetName,
// TextureRegion shadowTexture) {
// super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));
//
// animations = new AnimationSet(animationSetName);
//
// AnimatedDecal decal
// = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x,
// DEFAULT_DIMENSIONS.y,
// animations.getDefault(),
// true);
//
// decal.setKeepSize(true);
// decal.setPosition(position);
// decal.rotateX(DEFAULT_ROTATION);
//
// setMainDecal(decal);
//
// Decal shadow = new Decal();
//
// shadow.setPosition(position);
// shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
// shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x,
// DEFAULT_SHADOW_DIMENSIONS.y);
// shadow.setColor(1, 1, 1, .35f);
// shadow.setTextureRegion(shadowTexture);
// shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
//
// setShadowDecal(shadow);
// }
//
// @Override
// public void animate(AnimationType type, Direction direction, float duration) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.stop();
// animatedDecal.setAnimated(animations.get(type, direction, duration));
// animatedDecal.play();
// }
//
// @Override
// public void orientate(Direction direction) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.setAnimated(animations.get(AnimationType.IDLE, direction));
// animatedDecal.play();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.component.*;
import com.github.fauu.helix.displayable.CharacterDisplayable;
import com.github.fauu.helix.util.IntVector3; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.manager;
public class PlayerManager extends Manager {
@Wire
private AssetManager assetManager;
private Entity player;
@Override
protected void initialize() { | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/CharacterDisplayable.java
// public class CharacterDisplayable extends DecalDisplayable {
//
// @Wire
// private AssetManager assetManager;
//
// protected AnimationSet animations;
//
// public CharacterDisplayable(IntVector3 logicalPosition,
// String animationSetName,
// TextureRegion shadowTexture) {
// super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));
//
// animations = new AnimationSet(animationSetName);
//
// AnimatedDecal decal
// = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x,
// DEFAULT_DIMENSIONS.y,
// animations.getDefault(),
// true);
//
// decal.setKeepSize(true);
// decal.setPosition(position);
// decal.rotateX(DEFAULT_ROTATION);
//
// setMainDecal(decal);
//
// Decal shadow = new Decal();
//
// shadow.setPosition(position);
// shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
// shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x,
// DEFAULT_SHADOW_DIMENSIONS.y);
// shadow.setColor(1, 1, 1, .35f);
// shadow.setTextureRegion(shadowTexture);
// shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
//
// setShadowDecal(shadow);
// }
//
// @Override
// public void animate(AnimationType type, Direction direction, float duration) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.stop();
// animatedDecal.setAnimated(animations.get(type, direction, duration));
// animatedDecal.play();
// }
//
// @Override
// public void orientate(Direction direction) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.setAnimated(animations.get(AnimationType.IDLE, direction));
// animatedDecal.play();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/manager/PlayerManager.java
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.component.*;
import com.github.fauu.helix.displayable.CharacterDisplayable;
import com.github.fauu.helix.util.IntVector3;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.manager;
public class PlayerManager extends Manager {
@Wire
private AssetManager assetManager;
private Entity player;
@Override
protected void initialize() { | IntVector3 playerPosition = new IntVector3(16, 16, 0); |
fauu/HelixEngine | core/src/com/github/fauu/helix/manager/PlayerManager.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/CharacterDisplayable.java
// public class CharacterDisplayable extends DecalDisplayable {
//
// @Wire
// private AssetManager assetManager;
//
// protected AnimationSet animations;
//
// public CharacterDisplayable(IntVector3 logicalPosition,
// String animationSetName,
// TextureRegion shadowTexture) {
// super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));
//
// animations = new AnimationSet(animationSetName);
//
// AnimatedDecal decal
// = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x,
// DEFAULT_DIMENSIONS.y,
// animations.getDefault(),
// true);
//
// decal.setKeepSize(true);
// decal.setPosition(position);
// decal.rotateX(DEFAULT_ROTATION);
//
// setMainDecal(decal);
//
// Decal shadow = new Decal();
//
// shadow.setPosition(position);
// shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
// shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x,
// DEFAULT_SHADOW_DIMENSIONS.y);
// shadow.setColor(1, 1, 1, .35f);
// shadow.setTextureRegion(shadowTexture);
// shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
//
// setShadowDecal(shadow);
// }
//
// @Override
// public void animate(AnimationType type, Direction direction, float duration) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.stop();
// animatedDecal.setAnimated(animations.get(type, direction, duration));
// animatedDecal.play();
// }
//
// @Override
// public void orientate(Direction direction) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.setAnimated(animations.get(AnimationType.IDLE, direction));
// animatedDecal.play();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.component.*;
import com.github.fauu.helix.displayable.CharacterDisplayable;
import com.github.fauu.helix.util.IntVector3; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.manager;
public class PlayerManager extends Manager {
@Wire
private AssetManager assetManager;
private Entity player;
@Override
protected void initialize() {
IntVector3 playerPosition = new IntVector3(16, 16, 0); | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/displayable/CharacterDisplayable.java
// public class CharacterDisplayable extends DecalDisplayable {
//
// @Wire
// private AssetManager assetManager;
//
// protected AnimationSet animations;
//
// public CharacterDisplayable(IntVector3 logicalPosition,
// String animationSetName,
// TextureRegion shadowTexture) {
// super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));
//
// animations = new AnimationSet(animationSetName);
//
// AnimatedDecal decal
// = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x,
// DEFAULT_DIMENSIONS.y,
// animations.getDefault(),
// true);
//
// decal.setKeepSize(true);
// decal.setPosition(position);
// decal.rotateX(DEFAULT_ROTATION);
//
// setMainDecal(decal);
//
// Decal shadow = new Decal();
//
// shadow.setPosition(position);
// shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
// shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x,
// DEFAULT_SHADOW_DIMENSIONS.y);
// shadow.setColor(1, 1, 1, .35f);
// shadow.setTextureRegion(shadowTexture);
// shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
//
// setShadowDecal(shadow);
// }
//
// @Override
// public void animate(AnimationType type, Direction direction, float duration) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.stop();
// animatedDecal.setAnimated(animations.get(type, direction, duration));
// animatedDecal.play();
// }
//
// @Override
// public void orientate(Direction direction) {
// AnimatedDecal animatedDecal = ((AnimatedDecal) this.mainDecal);
//
// animatedDecal.setAnimated(animations.get(AnimationType.IDLE, direction));
// animatedDecal.play();
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/manager/PlayerManager.java
import com.artemis.Entity;
import com.artemis.Manager;
import com.artemis.annotations.Wire;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.component.*;
import com.github.fauu.helix.displayable.CharacterDisplayable;
import com.github.fauu.helix.util.IntVector3;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.manager;
public class PlayerManager extends Manager {
@Wire
private AssetManager assetManager;
private Entity player;
@Override
protected void initialize() {
IntVector3 playerPosition = new IntVector3(16, 16, 0); | Direction playerOrientation = Direction.SOUTH; |
fauu/HelixEngine | desktop/src/com/github/fauu/helix/desktop/DesktopLauncher.java | // Path: core/src/com/github/fauu/helix/HelixGame.java
// public class HelixGame extends Game {
//
// private static HelixGame instance;
//
// @Override
// public void create () {
// instance = this;
//
// setScreen(new Overworld());
// }
//
// public static HelixGame getInstance() {
// return instance;
// }
//
// }
| import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.github.fauu.helix.HelixGame;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.desktop;
public class DesktopLauncher {
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "helix";
config.width = 800;
config.height = 480;
| // Path: core/src/com/github/fauu/helix/HelixGame.java
// public class HelixGame extends Game {
//
// private static HelixGame instance;
//
// @Override
// public void create () {
// instance = this;
//
// setScreen(new Overworld());
// }
//
// public static HelixGame getInstance() {
// return instance;
// }
//
// }
// Path: desktop/src/com/github/fauu/helix/desktop/DesktopLauncher.java
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.github.fauu.helix.HelixGame;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.desktop;
public class DesktopLauncher {
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "helix";
config.width = 800;
config.height = 480;
| new LwjglApplication(new HelixGame(), config); |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/EditorDesktopLauncher.java | // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
| import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.github.fauu.helix.editor.HelixEditor; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor;
public class EditorDesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "helix";
config.width = 1280;
config.height = 800;
| // Path: editor/src/com/github/fauu/helix/editor/HelixEditor.java
// public class HelixEditor extends Game {
//
// private static HelixEditor instance;
//
// private EventBus uiEventBus;
//
// private EventBus worldEventBus;
//
// private UI ui;
//
// private TilePassageAreaListState tilePassageAreaListState;
//
// private TilePassageTargetPositionFieldState
// tilePassageTargetPositionFieldState;
//
// private TilePermissionListState tilePermissionListState;
//
// private ToolbarState toolbarState;
//
// private Overworld overworld;
//
// private TagManager tagManager;
//
// private AreaManager areaManager;
//
// @Override
// public void create() {
// instance = this;
//
// uiEventBus = new EventBus();
// worldEventBus = new EventBus();
//
// overworld = new Overworld();
// setScreen(overworld);
//
// tagManager = overworld.getWorld().getManager(TagManager.class);
// areaManager = overworld.getWorld().getManager(AreaManager.class);
//
// tilePassageTargetPositionFieldState
// = new TilePassageTargetPositionFieldState();
//
// tilePermissionListState = new TilePermissionListState();
// tilePermissionListState.initialize(TilePermission.LEVEL0);
//
// toolbarState = new ToolbarState();
// toolbarState.initialize(ToolType.TILE_PERMISSIONS);
//
// ui = new UI();
//
// tilePassageAreaListState = new TilePassageAreaListState();
// Array<String> areaNames = areaManager.getAllNames();
// tilePassageAreaListState.initialize(areaNames, areaNames.first());
//
// Gdx.input.setInputProcessor(
// new InputMultiplexer(ui.getStage(), new EditorInputEventProcessor()));
//
// loadAreaAction("area1");
// }
//
// public static HelixEditor getInstance() {
// return instance;
// }
//
// @Override
// public void render() {
// super.render();
// ui.render(Gdx.graphics.getDeltaTime());
// }
//
// @Override
// public void dispose() {
// super.dispose();
// ui.dispose();
// }
//
// public void newAreaAction() {
// ui.showNewAreaDialog();
// }
//
// public void createAreaAction(String name, int width, int length) {
// areaManager.create(name, width, length);
// }
//
// public void openAreaAction() {
// ui.showOpenAreaFileChooser();
// }
//
// public void loadAreaAction(String name) {
// if (areaManager.isAreaLoaded()) {
// closeCurrentAreaAction();
// }
//
// areaManager.load(name);
//
// worldEventBus.post(new AreaLoadedEvent());
//
// ui.setSidebarVisibility(true);
//
// if (toolbarState.getActiveTool() == ToolType.TILE_PERMISSIONS) {
// fadeAreaModelAction(true);
// }
// }
//
// public void saveAreaAction() {
// areaManager.save();
// }
//
// public void closeCurrentAreaAction() {
// areaManager.unloadCurrent();
//
// worldEventBus.post(new AreaUnloadedEvent());
//
// ui.setSidebarVisibility(false);
// }
//
//
// public void exitAction() {
// Gdx.app.exit();
// }
//
// public void fadeAreaModelAction(boolean on) {
// overworld.getDisplayableIntermediary().setAreaDisplayableOpacity(on ? 0.6f : 1);
// }
//
// public void centerCameraOnAreaAction() {
// overworld.getCameraIntermediary().centerCameraOnArea();
// }
//
// public void toolSelected(ToolType type) {
// if (type == ToolType.TILE_PERMISSIONS &&
// areaManager != null &&
// areaManager.isAreaLoaded()) {
// fadeAreaModelAction(true);
// }
// }
//
// public EventBus getUIEventBus() {
// return uiEventBus;
// }
//
// public EventBus getWorldEventBus() {
// return worldEventBus;
// }
//
// public TilePassageAreaListState getTilePassageAreaListState() {
// return tilePassageAreaListState;
// }
//
// public TilePassageTargetPositionFieldState
// getTilePassageTargetPositionFieldState() {
// return tilePassageTargetPositionFieldState;
// }
//
// public TilePermissionListState getTilePermissionListState() {
// return tilePermissionListState;
// }
//
// public ToolbarState getToolbarState() {
// return toolbarState;
// }
//
// }
// Path: editor/src/com/github/fauu/helix/editor/EditorDesktopLauncher.java
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.github.fauu.helix.editor.HelixEditor;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix.editor;
public class EditorDesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "helix";
config.width = 1280;
config.height = 800;
| new LwjglApplication(new HelixEditor(), config); |
fauu/HelixEngine | core/src/com/github/fauu/helix/HelixGame.java | // Path: core/src/com/github/fauu/helix/screen/Overworld.java
// public class Overworld implements Screen {
//
// private World world;
//
// private HelixCamera camera;
//
// private AssetManager assetManager;
//
// public Overworld() {
// assetManager = new AssetManager();
//
// camera = new HelixCamera(30, new Vector3(16, 16, 0), .1f, 35);
//
// WorldConfiguration worldConfiguration
// = new WorldConfiguration().register(assetManager)
// .register(camera);
//
// world = new World(worldConfiguration);
//
// world.setSystem(new PlayerMovementSystem());
// world.setSystem(new CameraClientsUpdateSystem());
// world.setSystem(new AnimationProcessingSystem());
// world.setSystem(new RenderingSystem());
// world.setSystem(new ScreenFadingSystem());
//
// world.setManager(new UuidEntityManager());
// world.setManager(new TextureManager());
// world.setManager(new GroupManager());
// world.setManager(new TagManager());
// world.setManager(new AreaManager());
// world.setManager(new PlayerManager());
// world.setManager(new LocalAmbienceManager());
// world.setManager(new WeatherMan());
// world.initialize();
//
// world.getManager(WeatherMan.class)
// .setToType(WeatherMan.WeatherType.SUNNY);
// world.getManager(AreaManager.class).load("area1");
// // Temporary
// world.getManager(LocalAmbienceManager.class)
// .setAmbience(world.getManager(WeatherMan.class).getWeather());
// }
//
// @Override
// public void render(float delta) {
// world.setDelta(delta);
// world.process();
// }
//
// @Override
// public void resize(int width, int height) { }
//
// @Override
// public void show() { }
//
// @Override
// public void hide() { }
//
// @Override
// public void pause() { }
//
// @Override
// public void resume() { }
//
// @Override
// public void dispose() {
// assetManager.dispose();
// }
//
// }
| import com.github.fauu.helix.screen.Overworld;
import com.badlogic.gdx.Game; | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix;
public class HelixGame extends Game {
private static HelixGame instance;
@Override
public void create () {
instance = this;
| // Path: core/src/com/github/fauu/helix/screen/Overworld.java
// public class Overworld implements Screen {
//
// private World world;
//
// private HelixCamera camera;
//
// private AssetManager assetManager;
//
// public Overworld() {
// assetManager = new AssetManager();
//
// camera = new HelixCamera(30, new Vector3(16, 16, 0), .1f, 35);
//
// WorldConfiguration worldConfiguration
// = new WorldConfiguration().register(assetManager)
// .register(camera);
//
// world = new World(worldConfiguration);
//
// world.setSystem(new PlayerMovementSystem());
// world.setSystem(new CameraClientsUpdateSystem());
// world.setSystem(new AnimationProcessingSystem());
// world.setSystem(new RenderingSystem());
// world.setSystem(new ScreenFadingSystem());
//
// world.setManager(new UuidEntityManager());
// world.setManager(new TextureManager());
// world.setManager(new GroupManager());
// world.setManager(new TagManager());
// world.setManager(new AreaManager());
// world.setManager(new PlayerManager());
// world.setManager(new LocalAmbienceManager());
// world.setManager(new WeatherMan());
// world.initialize();
//
// world.getManager(WeatherMan.class)
// .setToType(WeatherMan.WeatherType.SUNNY);
// world.getManager(AreaManager.class).load("area1");
// // Temporary
// world.getManager(LocalAmbienceManager.class)
// .setAmbience(world.getManager(WeatherMan.class).getWeather());
// }
//
// @Override
// public void render(float delta) {
// world.setDelta(delta);
// world.process();
// }
//
// @Override
// public void resize(int width, int height) { }
//
// @Override
// public void show() { }
//
// @Override
// public void hide() { }
//
// @Override
// public void pause() { }
//
// @Override
// public void resume() { }
//
// @Override
// public void dispose() {
// assetManager.dispose();
// }
//
// }
// Path: core/src/com/github/fauu/helix/HelixGame.java
import com.github.fauu.helix.screen.Overworld;
import com.badlogic.gdx.Game;
/*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Piotr Grabowski <[email protected]>
*/
package com.github.fauu.helix;
public class HelixGame extends Game {
private static HelixGame instance;
@Override
public void create () {
instance = this;
| setScreen(new Overworld()); |
fauu/HelixEngine | core/src/com/github/fauu/helix/displayable/DecalDisplayable.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3; | DEFAULT_ROTATION = 45;
DEFAULT_DISPLACEMENT = new Vector3(.52f, .5f, 1.01f);
DEFAULT_SHADOW_DIMENSIONS = new Vector2(1, .8f);
DEFAULT_SHADOW_DISPLACEMENT = new Vector3(.03f, -.33f, -.96f);
}
public DecalDisplayable(Vector3 position) {
decals = new Decal[2];
this.position = position;
}
public Decal[] getDecals() {
return decals;
}
public void setMainDecal(Decal decal) {
mainDecal = decal;
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition? | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/displayable/DecalDisplayable.java
import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3;
DEFAULT_ROTATION = 45;
DEFAULT_DISPLACEMENT = new Vector3(.52f, .5f, 1.01f);
DEFAULT_SHADOW_DIMENSIONS = new Vector2(1, .8f);
DEFAULT_SHADOW_DISPLACEMENT = new Vector3(.03f, -.33f, -.96f);
}
public DecalDisplayable(Vector3 position) {
decals = new Decal[2];
this.position = position;
}
public Decal[] getDecals() {
return decals;
}
public void setMainDecal(Decal decal) {
mainDecal = decal;
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition? | public abstract void animate(AnimationType type, |
fauu/HelixEngine | core/src/com/github/fauu/helix/displayable/DecalDisplayable.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3; | DEFAULT_DISPLACEMENT = new Vector3(.52f, .5f, 1.01f);
DEFAULT_SHADOW_DIMENSIONS = new Vector2(1, .8f);
DEFAULT_SHADOW_DISPLACEMENT = new Vector3(.03f, -.33f, -.96f);
}
public DecalDisplayable(Vector3 position) {
decals = new Decal[2];
this.position = position;
}
public Decal[] getDecals() {
return decals;
}
public void setMainDecal(Decal decal) {
mainDecal = decal;
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition?
public abstract void animate(AnimationType type, | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/displayable/DecalDisplayable.java
import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3;
DEFAULT_DISPLACEMENT = new Vector3(.52f, .5f, 1.01f);
DEFAULT_SHADOW_DIMENSIONS = new Vector2(1, .8f);
DEFAULT_SHADOW_DISPLACEMENT = new Vector3(.03f, -.33f, -.96f);
}
public DecalDisplayable(Vector3 position) {
decals = new Decal[2];
this.position = position;
}
public Decal[] getDecals() {
return decals;
}
public void setMainDecal(Decal decal) {
mainDecal = decal;
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition?
public abstract void animate(AnimationType type, | Direction direction, |
fauu/HelixEngine | core/src/com/github/fauu/helix/displayable/DecalDisplayable.java | // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
| import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3; |
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition?
public abstract void animate(AnimationType type,
Direction direction,
float duration);
public abstract void orientate(Direction direction);
public void move(Vector3 translation) {
mainDecal.translate(translation);
shadowDecal.translate(translation);
position.add(translation);
}
private void moveTo(Vector3 position) {
Vector3 translation = position.sub(this.position);
move(translation);
}
| // Path: core/src/com/github/fauu/helix/Direction.java
// public enum Direction {
//
// SOUTH(new IntVector2(0, -1)), SOUTHEAST(null),
// EAST(new IntVector2(1, 0)), NORTHEAST(null),
// NORTH(new IntVector2(0, 1)), NORTHWEST(null),
// WEST(new IntVector2(-1, 0)), SOUTHWEST(null);
//
// private IntVector2 vector;
//
// private Direction(IntVector2 vector) {
// this.vector = vector;
// }
//
// public IntVector2 getVector() {
// return vector;
// }
//
// @Override
// public String toString() {
// switch (this) {
// case SOUTH: return "South";
// case SOUTHEAST: return "Southeast";
// case EAST: return "East";
// case NORTHEAST: return "Northeast";
// case NORTH: return "North"; // by
// case NORTHWEST: return "Northwest";
// case WEST: return "West";
// case SOUTHWEST: return "Southwest";
// default: throw new IllegalArgumentException();
// }
// }
//
// }
//
// Path: core/src/com/github/fauu/helix/graphics/AnimationType.java
// public enum AnimationType {
//
// IDLE,
// STEP_LEFT_LEG,
// STEP_RIGHT_LEG
//
// }
//
// Path: core/src/com/github/fauu/helix/util/IntVector3.java
// public class IntVector3 {
//
// public int x;
//
// public int y;
//
// public int z;
//
// public IntVector3() { }
//
// public IntVector3(int x, int y, int z) {
// set(x, y, z);
// }
//
// public IntVector3(IntVector2 source) {
// set(source.x, source.y, 0);
// }
//
// public void set(int x, int y, int z) {
// this.x = x;
// this.y = y;
// this.z = z;
// }
//
// public void set(IntVector3 source) {
// set(source.x, source.y, source.z);
// }
//
// public IntVector3 add(IntVector2 other) {
// set(x + other.x, y + other.y, z);
//
// return this;
// }
//
// public IntVector3 add(IntVector3 other) {
// set(x + other.x, y + other.y, z + other.z);
//
// return this;
// }
//
// public IntVector3 cpy() {
// return new IntVector3(x, y, z);
// }
//
// public Vector3 toVector3() {
// return new Vector3(x, y, z);
// }
//
// public IntVector2 toIntVector2() {
// return new IntVector2(x, y);
// }
//
// }
// Path: core/src/com/github/fauu/helix/displayable/DecalDisplayable.java
import com.badlogic.gdx.graphics.g3d.decals.Decal;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.github.fauu.helix.Direction;
import com.github.fauu.helix.graphics.AnimationType;
import com.github.fauu.helix.util.IntVector3;
decals[0] = mainDecal;
}
public void setShadowDecal(Decal decal) {
shadowDecal = decal;
decals[1] = shadowDecal;
}
// TODO: Move this into AnimatedDecalDisplayable / make all decals animated / use composition?
public abstract void animate(AnimationType type,
Direction direction,
float duration);
public abstract void orientate(Direction direction);
public void move(Vector3 translation) {
mainDecal.translate(translation);
shadowDecal.translate(translation);
position.add(translation);
}
private void moveTo(Vector3 position) {
Vector3 translation = position.sub(this.position);
move(translation);
}
| public void updatePosition(IntVector3 entityPosition) { |
negusoft/GreenMatter | GreenMatter/src/main/java/com/negusoft/greenmatter/dialog/DialogUtils.java | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/NativeResources.java
// public class NativeResources {
//
// private static final String NATIVE_PACKAGE = "android";
//
// private static final String TYPE_ID = "id";
// private static final String TYPE_STRING = "string";
// private static final String TYPE_DRAWABLE = "drawable";
//
// /** Get a native identifier by name as in 'R.id.name'. */
// public static int getIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_ID, NATIVE_PACKAGE);
// }
//
// /** Get a native string id by name as in 'R.string.name'. */
// public static int getStringIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_STRING, NATIVE_PACKAGE);
// }
//
// /** Get a native drawable by name as in 'R.drawable.name'. */
// public static String getString(String name) {
// Resources res = Resources.getSystem();
// int id = res.getIdentifier(name, TYPE_STRING, NATIVE_PACKAGE);
// return id == 0 ? null : res.getString(id);
// }
//
// /** Get a native drawable id by name as in 'R.drawable.name'. */
// public static int getDrawableIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_DRAWABLE, NATIVE_PACKAGE);
// }
//
// /** Get a native drawable by name as in 'R.drawable.name'. */
// public static Drawable getDrawable(String name) {
// Resources res = Resources.getSystem();
// int id = res.getIdentifier(name, TYPE_DRAWABLE, NATIVE_PACKAGE);
// return id == 0 ? null : res.getDrawable(id);
// }
//
// }
| import android.app.ActionBar;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.negusoft.greenmatter.R;
import com.negusoft.greenmatter.util.NativeResources;
import org.w3c.dom.Text; | /*******************************************************************************
* Copyright 2015 NEGU Soft
*
* 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.negusoft.greenmatter.dialog;
/**
* Utility class to help give the dialogs a Material style.
*/
public class DialogUtils {
private static final String IDENTIFIER_NAME_DIVIDER = "titleDivider";
private static final String IDENTIFIER_NAME_BUTTON_PANEL = "buttonPanel";
public static void prepareDialog(Context context, Window window) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
return;
removeDivider(window);
arrangeButtons(context, window);
arrangeContentSpacing(context, window);
prepareList(context, window);
}
/** Change the button order and alignment. */
public static void removeDivider(Window window) { | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/NativeResources.java
// public class NativeResources {
//
// private static final String NATIVE_PACKAGE = "android";
//
// private static final String TYPE_ID = "id";
// private static final String TYPE_STRING = "string";
// private static final String TYPE_DRAWABLE = "drawable";
//
// /** Get a native identifier by name as in 'R.id.name'. */
// public static int getIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_ID, NATIVE_PACKAGE);
// }
//
// /** Get a native string id by name as in 'R.string.name'. */
// public static int getStringIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_STRING, NATIVE_PACKAGE);
// }
//
// /** Get a native drawable by name as in 'R.drawable.name'. */
// public static String getString(String name) {
// Resources res = Resources.getSystem();
// int id = res.getIdentifier(name, TYPE_STRING, NATIVE_PACKAGE);
// return id == 0 ? null : res.getString(id);
// }
//
// /** Get a native drawable id by name as in 'R.drawable.name'. */
// public static int getDrawableIdentifier(String name) {
// Resources res = Resources.getSystem();
// return res.getIdentifier(name, TYPE_DRAWABLE, NATIVE_PACKAGE);
// }
//
// /** Get a native drawable by name as in 'R.drawable.name'. */
// public static Drawable getDrawable(String name) {
// Resources res = Resources.getSystem();
// int id = res.getIdentifier(name, TYPE_DRAWABLE, NATIVE_PACKAGE);
// return id == 0 ? null : res.getDrawable(id);
// }
//
// }
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/dialog/DialogUtils.java
import android.app.ActionBar;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.negusoft.greenmatter.R;
import com.negusoft.greenmatter.util.NativeResources;
import org.w3c.dom.Text;
/*******************************************************************************
* Copyright 2015 NEGU Soft
*
* 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.negusoft.greenmatter.dialog;
/**
* Utility class to help give the dialogs a Material style.
*/
public class DialogUtils {
private static final String IDENTIFIER_NAME_DIVIDER = "titleDivider";
private static final String IDENTIFIER_NAME_BUTTON_PANEL = "buttonPanel";
public static void prepareDialog(Context context, Window window) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
return;
removeDivider(window);
arrangeButtons(context, window);
arrangeContentSpacing(context, window);
prepareList(context, window);
}
/** Change the button order and alignment. */
public static void removeDivider(Window window) { | int id = NativeResources.getIdentifier(IDENTIFIER_NAME_DIVIDER); |
negusoft/GreenMatter | GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/ScrubberHorizontalDrawable.java | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
| import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils; | /*******************************************************************************
* Copyright 2015 NEGU Soft
*
* 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.negusoft.greenmatter.drawable;
/**
* A vertically centered line that fills the current progress.
* The line width can be specified in DP or percentage of the height.
*/
public class ScrubberHorizontalDrawable extends Drawable {
private static final int GAP_WIDTH_DP = 12;
public enum Type { BACKGROUND, PROGRESS }
private final Paint mPaint;
private final ScrubberHorizontalConstantState mState;
/** Init with line width specified in DP. */
public ScrubberHorizontalDrawable(Resources res, int color, float lineWidthDp, Type type) {
DisplayMetrics metrics = res.getDisplayMetrics();
mState = new ScrubberHorizontalConstantState(metrics, color, lineWidthDp, type);
float lineWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, lineWidthDp, metrics);
mPaint = initPaint(color, lineWidth);
}
public ScrubberHorizontalDrawable(DisplayMetrics metrics, int color, float lineWidthDp, Type type) {
mState = new ScrubberHorizontalConstantState(metrics, color, lineWidthDp, type);
float borderWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, lineWidthDp, metrics);
mPaint = initPaint(color, borderWidth);
}
private Paint initPaint(int color, float strokeWidth) {
Paint result = new Paint();
result.setColor(color);
result.setStyle(Paint.Style.STROKE);
result.setStrokeWidth(strokeWidth);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
float level = getLevel() / 10000f;
Rect bounds = getBounds();
float centerY = bounds.exactCenterY();
float startX = bounds.left;
float progressX = startX + (bounds.width() * level);
if (mState.mType == Type.PROGRESS) {
canvas.drawLine(bounds.left, centerY, progressX, centerY, mPaint);
} else {
float stopX = startX + bounds.width();
float gapWidthHalf = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, GAP_WIDTH_DP, mState.mDisplayMetrics) / 2f;
canvas.drawLine(bounds.left, centerY, progressX - gapWidthHalf, centerY, mPaint);
canvas.drawLine(progressX + gapWidthHalf, centerY, stopX, centerY, mPaint);
}
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) { | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/ScrubberHorizontalDrawable.java
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;
/*******************************************************************************
* Copyright 2015 NEGU Soft
*
* 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.negusoft.greenmatter.drawable;
/**
* A vertically centered line that fills the current progress.
* The line width can be specified in DP or percentage of the height.
*/
public class ScrubberHorizontalDrawable extends Drawable {
private static final int GAP_WIDTH_DP = 12;
public enum Type { BACKGROUND, PROGRESS }
private final Paint mPaint;
private final ScrubberHorizontalConstantState mState;
/** Init with line width specified in DP. */
public ScrubberHorizontalDrawable(Resources res, int color, float lineWidthDp, Type type) {
DisplayMetrics metrics = res.getDisplayMetrics();
mState = new ScrubberHorizontalConstantState(metrics, color, lineWidthDp, type);
float lineWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, lineWidthDp, metrics);
mPaint = initPaint(color, lineWidth);
}
public ScrubberHorizontalDrawable(DisplayMetrics metrics, int color, float lineWidthDp, Type type) {
mState = new ScrubberHorizontalConstantState(metrics, color, lineWidthDp, type);
float borderWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, lineWidthDp, metrics);
mPaint = initPaint(color, borderWidth);
}
private Paint initPaint(int color, float strokeWidth) {
Paint result = new Paint();
result.setColor(color);
result.setStyle(Paint.Style.STROKE);
result.setStrokeWidth(strokeWidth);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
float level = getLevel() / 10000f;
Rect bounds = getBounds();
float centerY = bounds.exactCenterY();
float startX = bounds.left;
float progressX = startX + (bounds.width() * level);
if (mState.mType == Type.PROGRESS) {
canvas.drawLine(bounds.left, centerY, progressX, centerY, mPaint);
} else {
float stopX = startX + bounds.width();
float gapWidthHalf = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, GAP_WIDTH_DP, mState.mDisplayMetrics) / 2f;
canvas.drawLine(bounds.left, centerY, progressX - gapWidthHalf, centerY, mPaint);
canvas.drawLine(progressX + gapWidthHalf, centerY, stopX, centerY, mPaint);
}
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) { | int borderAlpha = ColorUtils.calculateAlpha(alpha, mState.mColor); |
negusoft/GreenMatter | GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/CircleDrawable.java | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
| import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils; | result.setColor(fillColor);
result.setStyle(Paint.Style.FILL);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
Rect r = getBounds();
float centerX = (r.left + r.right) / 2f;
float centerY = (r.top + r.bottom) / 2f;
float radius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mState.mRadiusDp, mState.mDisplayMetrics);
if (mBorderPaint != null) {
canvas.drawCircle(centerX, centerY, radius, mBorderPaint);
}
if (mFillPaint != null) {
if (mBorderPaint != null)
radius -= (mBorderPaint.getStrokeWidth() / 2);
canvas.drawCircle(centerX, centerY, radius, mFillPaint);
}
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) {
if (mBorderPaint != null) { | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/CircleDrawable.java
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;
result.setColor(fillColor);
result.setStyle(Paint.Style.FILL);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
Rect r = getBounds();
float centerX = (r.left + r.right) / 2f;
float centerY = (r.top + r.bottom) / 2f;
float radius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mState.mRadiusDp, mState.mDisplayMetrics);
if (mBorderPaint != null) {
canvas.drawCircle(centerX, centerY, radius, mBorderPaint);
}
if (mFillPaint != null) {
if (mBorderPaint != null)
radius -= (mBorderPaint.getStrokeWidth() / 2);
canvas.drawCircle(centerX, centerY, radius, mFillPaint);
}
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) {
if (mBorderPaint != null) { | int borderAlpha = ColorUtils.calculateAlpha(alpha, mState.mBorderColor); |
negusoft/GreenMatter | GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/ScrollbarThumbDrawable.java | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
| import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils; | mMargin = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MARGIN_DP, metrics);
}
private Paint initFillPaint(int color) {
Paint result = new Paint();
result.setColor(color);
result.setStyle(Paint.Style.FILL_AND_STROKE);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
canvas.drawRect(
bounds.left + mMargin,
bounds.top + mMargin,
bounds.right - mMargin,
bounds.bottom - mMargin,
mPaint
);
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) { | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/ScrollbarThumbDrawable.java
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;
mMargin = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MARGIN_DP, metrics);
}
private Paint initFillPaint(int color) {
Paint result = new Paint();
result.setColor(color);
result.setStyle(Paint.Style.FILL_AND_STROKE);
result.setAntiAlias(true);
return result;
}
@Override
public void draw(Canvas canvas) {
Rect bounds = getBounds();
canvas.drawRect(
bounds.left + mMargin,
bounds.top + mMargin,
bounds.right - mMargin,
bounds.bottom - mMargin,
mPaint
);
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) { | int resultAlpha = ColorUtils.calculateAlpha(alpha, mState.mColor); |
negusoft/GreenMatter | GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/RoundRectDrawable.java | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
| import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils; | // Bottom right corner (clockwise)
RectF bottomRightArc = new RectF(
right - cornerSize,
bottom - cornerSize,
right,
bottom
);
result.arcTo(bottomRightArc, 0, 90);
// Bottom left corner (clockwise)
RectF bottomLeftArc = new RectF(
left,
bottom - cornerSize,
left + cornerSize,
bottom
);
result.arcTo(bottomLeftArc, 90, 90);
result.close();
return result;
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) {
if (mBorderPaint != null) { | // Path: GreenMatter/src/main/java/com/negusoft/greenmatter/util/ColorUtils.java
// public class ColorUtils {
//
// /** Modify the colors translucency by alpha [0..1] with respect to the original color alpha. */
// public static int applyColorAlpha(int color, float alpha) {
// final int originalAlpha = Color.alpha(color);
// // Return the color, multiplying the original alpha by the disabled value
// return (color & 0x00ffffff) | (Math.round(originalAlpha * alpha) << 24);
// }
//
// /** Override the colors alpha and set it to the given value [0..255]. */
// public static int replaceColorAlpha(int color, int alpha) {
// return (color & 0x00ffffff) | (alpha << 24);
// }
//
// /** Calculate the resulting alpha from the original color and the relative alpha. */
// public static int calculateAlpha(int alpha, int originalColor) {
// int originalAlpha = Color.alpha(originalColor);
// return originalAlpha * alpha / 255;
// }
//
//
// }
// Path: GreenMatter/src/main/java/com/negusoft/greenmatter/drawable/RoundRectDrawable.java
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import com.negusoft.greenmatter.util.ColorUtils;
// Bottom right corner (clockwise)
RectF bottomRightArc = new RectF(
right - cornerSize,
bottom - cornerSize,
right,
bottom
);
result.arcTo(bottomRightArc, 0, 90);
// Bottom left corner (clockwise)
RectF bottomLeftArc = new RectF(
left,
bottom - cornerSize,
left + cornerSize,
bottom
);
result.arcTo(bottomLeftArc, 90, 90);
result.close();
return result;
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Override
public void setAlpha(int alpha) {
if (mBorderPaint != null) { | int borderAlpha = ColorUtils.calculateAlpha(alpha, mState.mBorderColor); |
binzume/mikumikudroid | src/jp/gauzau/MikuMikuDroid/MikuRendererGLES20.java | // Path: src/jp/gauzau/MikuMikuDroid/Miku.java
// public class RenderSet {
// public String shader;
// public String target;
// public RenderSet(String s, String t) {
// shader = s;
// target = t;
// }
// }
| import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import jp.gauzau.MikuMikuDroid.Miku.RenderSet;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.opengl.GLES20;
import android.opengl.GLU;
import android.os.Build;
import android.util.Log;
| GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
//GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
mRT.get("screenR").bindTexture();
GLES20.glDrawElements(GLES20.GL_TRIANGLES, 6, GLES20.GL_UNSIGNED_SHORT, mBgIndex);
} else {
mRT.get("screen").switchTargetFrameBuffer();
draw();
}
// GLES20.glFlush();
// checkGlError(TAG);
mCoreLogic.onDraw(pos);
// Log.d("",""+(System.currentTimeMillis() - start));
}
private void draw() {
GLES20.glClearColor(0, 0, 1.0f, 1.0f);
GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
initializeAllTexture(false);
// initializeAllSkinningTexture();
String bg = mCoreLogic.getBG();
////////////////////////////////////////////////////////////////////
//// draw models
if (mCoreLogic.getMiku() != null) {
for (Miku miku : mCoreLogic.getMiku()) {
if(miku.mModel.mIsTextureLoaded) {
| // Path: src/jp/gauzau/MikuMikuDroid/Miku.java
// public class RenderSet {
// public String shader;
// public String target;
// public RenderSet(String s, String t) {
// shader = s;
// target = t;
// }
// }
// Path: src/jp/gauzau/MikuMikuDroid/MikuRendererGLES20.java
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import jp.gauzau.MikuMikuDroid.Miku.RenderSet;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.opengl.GLES20;
import android.opengl.GLU;
import android.os.Build;
import android.util.Log;
GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
//GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST);
mRT.get("screenR").bindTexture();
GLES20.glDrawElements(GLES20.GL_TRIANGLES, 6, GLES20.GL_UNSIGNED_SHORT, mBgIndex);
} else {
mRT.get("screen").switchTargetFrameBuffer();
draw();
}
// GLES20.glFlush();
// checkGlError(TAG);
mCoreLogic.onDraw(pos);
// Log.d("",""+(System.currentTimeMillis() - start));
}
private void draw() {
GLES20.glClearColor(0, 0, 1.0f, 1.0f);
GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
initializeAllTexture(false);
// initializeAllSkinningTexture();
String bg = mCoreLogic.getBG();
////////////////////////////////////////////////////////////////////
//// draw models
if (mCoreLogic.getMiku() != null) {
for (Miku miku : mCoreLogic.getMiku()) {
if(miku.mModel.mIsTextureLoaded) {
| for(RenderSet rs: miku.mRenderSenario) {
|
DarkLBP/Krothium-Launcher | src/kml/game/GameStarter.java | // Path: src/kml/proxy/URLHandler.java
// public class URLHandler implements URLStreamHandlerFactory {
// private final HttpsHandler HTTPS_HANDLER = new HttpsHandler();
// private final HttpHandler HTTP_HANDLER = new HttpHandler();
//
// @Override
// public final URLStreamHandler createURLStreamHandler(String protocol) {
// if ("https".equalsIgnoreCase(protocol)) {
// return HTTPS_HANDLER;
// }
// if ("http".equalsIgnoreCase(protocol)) {
// return HTTP_HANDLER;
// }
// return null;
// }
//
// }
| import kml.proxy.URLHandler;
import java.lang.reflect.Method;
import java.net.URL; | package kml.game;
/**
* @author DarkLBP
* website https://krothium.com
*/
public class GameStarter {
public static void main(String[] args) {
System.out.println("GameStarter launcher with " + args.length + " arguments."); | // Path: src/kml/proxy/URLHandler.java
// public class URLHandler implements URLStreamHandlerFactory {
// private final HttpsHandler HTTPS_HANDLER = new HttpsHandler();
// private final HttpHandler HTTP_HANDLER = new HttpHandler();
//
// @Override
// public final URLStreamHandler createURLStreamHandler(String protocol) {
// if ("https".equalsIgnoreCase(protocol)) {
// return HTTPS_HANDLER;
// }
// if ("http".equalsIgnoreCase(protocol)) {
// return HTTP_HANDLER;
// }
// return null;
// }
//
// }
// Path: src/kml/game/GameStarter.java
import kml.proxy.URLHandler;
import java.lang.reflect.Method;
import java.net.URL;
package kml.game;
/**
* @author DarkLBP
* website https://krothium.com
*/
public class GameStarter {
public static void main(String[] args) {
System.out.println("GameStarter launcher with " + args.length + " arguments."); | URL.setURLStreamHandlerFactory(new URLHandler()); |
DarkLBP/Krothium-Launcher | src/kml/proxy/ConnectionHandler.java | // Path: src/kml/proxy/matchers/URLMatcher.java
// public interface URLMatcher {
// boolean match(String url);
//
// String handle(String url);
// }
| import kml.proxy.matchers.URLMatcher;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.security.Permission;
import java.util.List;
import java.util.Map; | package kml.proxy;
/**
* @author DarkLBP
* website https://krothium.com
*/
class ConnectionHandler extends HttpURLConnection {
private HttpURLConnection relay;
| // Path: src/kml/proxy/matchers/URLMatcher.java
// public interface URLMatcher {
// boolean match(String url);
//
// String handle(String url);
// }
// Path: src/kml/proxy/ConnectionHandler.java
import kml.proxy.matchers.URLMatcher;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import java.security.Permission;
import java.util.List;
import java.util.Map;
package kml.proxy;
/**
* @author DarkLBP
* website https://krothium.com
*/
class ConnectionHandler extends HttpURLConnection {
private HttpURLConnection relay;
| public ConnectionHandler(URL url, URLMatcher m) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.