You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2016/11/13 09:34:10 UTC
svn commit: r1769479 [4/16] - in /openwebbeans/microwave/trunk: ./
meecrowave-arquillian/ meecrowave-arquillian/src/
meecrowave-arquillian/src/main/ meecrowave-arquillian/src/main/java/
meecrowave-arquillian/src/main/java/org/ meecrowave-arquillian/src...
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,202 @@
+/*
+ * 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.apache.meecrowave.runner;
+
+import org.apache.catalina.connector.Connector;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+import org.apache.meecrowave.Meecrowave;
+import org.apache.meecrowave.runner.cli.CliOption;
+import org.apache.xbean.recipe.ObjectRecipe;
+
+import javax.enterprise.inject.Vetoed;
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Stream;
+
+import static java.util.Optional.ofNullable;
+import static java.util.stream.Collectors.toList;
+
+@Vetoed
+public class Cli {
+ private Cli() {
+ // no-op
+ }
+
+ public static void main(final String[] args) {
+ final Options options = new Options();
+ options.addOption("help", false, "Show help");
+ options.addOption("context", true, "The context to use to deploy the webapp");
+ options.addOption("webapp", true, "Location of the webapp, if not set the classpath will be deployed");
+ final List<Field> fields = Stream.of(Meecrowave.Builder.class.getDeclaredFields())
+ .filter(f -> f.isAnnotationPresent(CliOption.class))
+ .collect(toList());
+ fields.forEach(f -> {
+ final CliOption opt = f.getAnnotation(CliOption.class);
+ options.addOption(null, opt.name(), f.getType() != boolean.class, opt.description());
+ });
+
+ final CommandLineParser parser = new PosixParser();
+ final CommandLine line;
+ try {
+ line = parser.parse(options, args, true);
+ } catch (final ParseException exp) {
+ help(options);
+ return;
+ }
+
+ if (line.hasOption("help")) {
+ help(options);
+ return;
+ }
+
+ try (final Meecrowave meecrowave = new Meecrowave(buildConfig(line, fields))) {
+ final String ctx = line.getOptionValue("context", "");
+ final String fixedCtx = !ctx.isEmpty() && !ctx.startsWith("/") ? '/' + ctx : ctx;
+ final String war = line.getOptionValue("webapp");
+ if (war == null) {
+ meecrowave.bake(fixedCtx);
+ } else {
+ meecrowave.deployWebapp(fixedCtx, new File(war));
+ }
+ meecrowave.getTomcat().getServer().await();
+ }
+ }
+
+ private static Meecrowave.Builder buildConfig(final CommandLine line, final List<Field> fields) {
+ final Meecrowave.Builder config = new Meecrowave.Builder();
+ fields.forEach(f -> {
+ final CliOption opt = f.getAnnotation(CliOption.class);
+ final String name = opt.name();
+ if (line.hasOption(name)) {
+ ofNullable(f.getType() == boolean.class ?
+ ofNullable(line.getOptionValue(name)).map(Boolean::parseBoolean).orElse(true) :
+ toValue(name, line.getOptionValues(name), f.getType()))
+ .ifPresent(v -> {
+ if (!f.isAccessible()) {
+ f.setAccessible(true);
+ }
+ try {
+ f.set(config, v);
+ } catch (final IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ }
+ });
+ }
+ });
+ return config;
+ }
+
+ private static Object toValue(final String name, final String[] optionValues, final Class<?> type) {
+ if (optionValues == null || optionValues.length == 0) {
+ return null;
+ }
+ if (String.class == type) {
+ return optionValues[0];
+ }
+ if (int.class == type) {
+ return Integer.parseInt(optionValues[0]);
+ }
+ if (File.class == type) {
+ return new File(optionValues[0]);
+ }
+ if (Properties.class == type) {
+ final Properties props = new Properties();
+ Stream.of(optionValues).map(v -> v.split("=")).forEach(v -> props.setProperty(v[0], v[1]));
+ return props;
+ }
+ if (Map.class == type) {
+ final Map<String, String> props = new HashMap<>();
+ Stream.of(optionValues).map(v -> v.split("=")).forEach(v -> props.put(v[0], v[1]));
+ return props;
+ }
+
+ final ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ switch (name) {
+ case "realm": // org.foo.Impl:attr1=val1;attr2=val2
+ try {
+ int end = optionValues[0].indexOf(':');
+ if (end < 0) {
+ return loader.loadClass(optionValues[0]).newInstance();
+ }
+ final ObjectRecipe recipe = new ObjectRecipe(optionValues[0].substring(0, end));
+ Stream.of(optionValues[0].substring(end + 1, optionValues[0].length()).split(";"))
+ .map(v -> v.split("="))
+ .forEach(v -> recipe.setProperty(v[0], v[1]));
+ return recipe.create(loader);
+ } catch (final Exception cnfe) {
+ throw new IllegalArgumentException(optionValues[0]);
+ }
+ case "security-constraint": // attr1=val1;attr2=val2
+ return Stream.of(optionValues)
+ .map(item -> {
+ try {
+ final ObjectRecipe recipe = new ObjectRecipe(Meecrowave.SecurityConstaintBuilder.class);
+ Stream.of(item.split(";"))
+ .map(v -> v.split("="))
+ .forEach(v -> recipe.setProperty(v[0], v[1]));
+ return recipe.create(loader);
+ } catch (final Exception cnfe) {
+ throw new IllegalArgumentException(optionValues[0]);
+ }
+ }).collect(toList());
+ case "login-config":
+ try {
+ final ObjectRecipe recipe = new ObjectRecipe(Meecrowave.LoginConfigBuilder.class);
+ Stream.of(optionValues[0].split(";"))
+ .map(v -> v.split("="))
+ .forEach(v -> recipe.setProperty(v[0], v[1]));
+ return recipe.create(loader);
+ } catch (final Exception cnfe) {
+ throw new IllegalArgumentException(optionValues[0]);
+ }
+ case "connector": // org.foo.Impl:attr1=val1;attr2=val2
+ return Stream.of(optionValues)
+ .map(v -> {
+ try {
+ int end = v.indexOf(':');
+ if (end < 0) {
+ return new Connector(v);
+ }
+ final Connector connector = new Connector(optionValues[0].substring(0, end));
+ Stream.of(v.substring(end + 1, v.length()).split(";"))
+ .map(i -> i.split("="))
+ .forEach(i -> connector.setProperty(i[0], i[1]));
+ return connector;
+ } catch (final Exception cnfe) {
+ throw new IllegalArgumentException(optionValues[0]);
+ }
+ }).collect(toList());
+ default:
+ throw new IllegalArgumentException("Unsupported " + name);
+ }
+ }
+
+ private static void help(final Options options) {
+ new HelpFormatter().printHelp("java -jar meecrowave.jar", options);
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/cli/CliOption.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/cli/CliOption.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/cli/CliOption.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/runner/cli/CliOption.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,32 @@
+/*
+ * 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.apache.meecrowave.runner.cli;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target(FIELD)
+@Retention(RUNTIME)
+public @interface CliOption {
+ String name();
+ String description();
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/CDIInstanceManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/CDIInstanceManager.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/CDIInstanceManager.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/CDIInstanceManager.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,89 @@
+/*
+ * 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.apache.meecrowave.tomcat;
+
+import org.apache.tomcat.InstanceManager;
+import org.apache.webbeans.servlet.WebBeansConfigurationListener;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.CDI;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.naming.NamingException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import static java.util.Optional.ofNullable;
+
+public class CDIInstanceManager implements InstanceManager {
+ private final Map<Object, Runnable> destroyables = new ConcurrentHashMap<>();
+
+ @Override
+ public Object newInstance(final Class<?> clazz) throws IllegalAccessException, InvocationTargetException,
+ NamingException, InstantiationException {
+ final Object newInstance = clazz.newInstance();
+ newInstance(newInstance);
+ return newInstance;
+ }
+
+ @Override
+ public Object newInstance(final String className) throws IllegalAccessException, InvocationTargetException,
+ NamingException, InstantiationException, ClassNotFoundException {
+ return newInstance(className, Thread.currentThread().getContextClassLoader());
+ }
+
+ @Override
+ public Object newInstance(final String fqcn, final ClassLoader classLoader) throws IllegalAccessException,
+ InvocationTargetException, NamingException, InstantiationException, ClassNotFoundException {
+ return newInstance(classLoader.loadClass(fqcn));
+ }
+
+ @Override
+ public void newInstance(final Object o) throws IllegalAccessException, InvocationTargetException, NamingException {
+ if (WebBeansConfigurationListener.class.isInstance(o) || o.getClass().getName().startsWith("org.apache.catalina.servlets.")) {
+ return;
+ }
+
+ final BeanManager bm = CDI.current().getBeanManager();
+ final AnnotatedType<?> annotatedType = bm.createAnnotatedType(o.getClass());
+ final InjectionTarget injectionTarget = bm.createInjectionTarget(annotatedType);
+ final CreationalContext<Object> creationalContext = bm.createCreationalContext(null);
+ injectionTarget.inject(o, creationalContext);
+ try {
+ injectionTarget.postConstruct(o);
+ } catch (final RuntimeException e) {
+ creationalContext.release();
+ throw e;
+ }
+ destroyables.put(o, () -> {
+ try {
+ injectionTarget.preDestroy(o);
+ } finally {
+ creationalContext.release();
+ }
+ });
+ }
+
+ @Override
+ public void destroyInstance(final Object o) throws IllegalAccessException, InvocationTargetException {
+ ofNullable(destroyables.remove(o)).ifPresent(Runnable::run);
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/OWBJarScanner.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/OWBJarScanner.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/OWBJarScanner.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/OWBJarScanner.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,87 @@
+/*
+ * 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.apache.meecrowave.tomcat;
+
+import org.apache.tomcat.Jar;
+import org.apache.tomcat.JarScanFilter;
+import org.apache.tomcat.JarScanType;
+import org.apache.tomcat.JarScanner;
+import org.apache.tomcat.JarScannerCallback;
+import org.apache.tomcat.util.buf.UriUtil;
+import org.apache.tomcat.util.scan.Constants;
+import org.apache.tomcat.util.scan.JarFactory;
+import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.corespi.scanner.xbean.CdiArchive;
+import org.apache.webbeans.web.scanner.WebScannerService;
+
+import javax.servlet.ServletContext;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+public class OWBJarScanner implements JarScanner {
+ private JarScanFilter filter; // not yet used
+
+ @Override
+ public void scan(final JarScanType jarScanType, final ServletContext servletContext, final JarScannerCallback callback) {
+ switch (jarScanType) {
+ case PLUGGABILITY:
+ CdiArchive.class.cast(WebScannerService.class.cast(WebBeansContext.getInstance().getScannerService()).getFinder().getArchive())
+ .classesByUrl().keySet().forEach(u -> {
+ try {
+ final URL url = new URL(u);
+ if ("jar".equals(url.getProtocol()) || url.getPath().endsWith(Constants.JAR_EXT)) {
+ try (final Jar jar = JarFactory.newInstance(url)) {
+ callback.scan(jar, u, true);
+ }
+ } else if ("file".equals(url.getProtocol())) {
+ final File f = new File(url.toURI());
+ if (f.isFile()) {
+ try (final Jar jar = JarFactory.newInstance(UriUtil.buildJarUrl(f))) {
+ callback.scan(jar, f.getAbsolutePath(), true);
+ }
+ } else if (f.isDirectory()) {
+ callback.scan(f, f.getAbsolutePath(), true);
+ }
+ }
+ } catch (final MalformedURLException e) {
+ // skip
+ } catch (final IOException | URISyntaxException ioe) {
+ throw new IllegalArgumentException(ioe);
+ }
+ });
+ return;
+
+ case TLD:
+ default:
+ }
+ }
+
+ @Override
+ public JarScanFilter getJarScanFilter() {
+ return filter;
+ }
+
+ @Override
+ public void setJarScanFilter(final JarScanFilter jarScanFilter) {
+ this.filter = jarScanFilter;
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/ProvidedLoader.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/ProvidedLoader.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/ProvidedLoader.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/ProvidedLoader.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,149 @@
+/*
+ * 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.apache.meecrowave.tomcat;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.Loader;
+import org.apache.catalina.util.LifecycleBase;
+
+import java.beans.PropertyChangeListener;
+
+// used to not recreate another classloader,
+// it has a small workaround cause tomcat set properties (clear*) on the classloader
+// and AppLoader doesnt support it leading to warnings we don't want
+public class ProvidedLoader extends LifecycleBase implements Loader {
+ private static final ClassLoader MOCK = new TomcatSettersClassLoader(ProvidedLoader.class.getClassLoader());
+
+ private final ClassLoader delegate;
+ private Context context;
+ private int mockReturns = -1;
+
+ public ProvidedLoader(final ClassLoader loader, final boolean wrap) {
+ // use another classloader cause tomcat set properties on the classloader
+ final ClassLoader impl = loader == null ? ClassLoader.getSystemClassLoader() : loader;
+ this.delegate = wrap ? new TomcatSettersClassLoader(impl) : impl;
+ }
+
+ @Override
+ public void backgroundProcess() {
+ // no-op
+ }
+
+ @Override
+ public ClassLoader getClassLoader() {
+ if (mockReturns > 0) {
+ mockReturns--;
+ return MOCK;
+ }
+ return delegate;
+ }
+
+ @Override
+ public Context getContext() {
+ return context;
+ }
+
+ @Override
+ public void setContext(final Context context) {
+ this.context = context;
+ }
+
+ @Override
+ public boolean modified() {
+ return false;
+ }
+
+ @Override
+ public boolean getDelegate() {
+ return false;
+ }
+
+ @Override
+ public void setDelegate(final boolean delegate) {
+ // ignore
+ }
+
+ @Override
+ public boolean getReloadable() {
+ return false;
+ }
+
+ @Override
+ public void setReloadable(final boolean reloadable) {
+ // no-op
+ }
+
+ @Override
+ public void addPropertyChangeListener(final PropertyChangeListener listener) {
+ // no-op
+ }
+
+ @Override
+ public void removePropertyChangeListener(final PropertyChangeListener listener) {
+ // no-op
+ }
+
+ @Override
+ protected void startInternal() throws LifecycleException {
+ mockReturns = 4; // check StandardContext.startInternal, while there is no warnings in the log and tests pass we are good
+ setState(LifecycleState.STARTING);
+ }
+
+ @Override
+ protected void initInternal() throws LifecycleException {
+ // no-op
+ }
+
+ @Override
+ protected void stopInternal() throws LifecycleException {
+ setState(LifecycleState.STOPPING);
+ }
+
+ @Override
+ protected void destroyInternal() throws LifecycleException {
+ // no-op
+ }
+
+ // avoid warnings cause AppLoader doesn't support these setters but tomcat expects it
+ public static class TomcatSettersClassLoader extends ClassLoader {
+ private TomcatSettersClassLoader(final ClassLoader classLoader) {
+ super(classLoader);
+ }
+
+
+ public void setClearReferencesHttpClientKeepAliveThread(final boolean ignored) {
+ // no-op
+ }
+
+ public void setClearReferencesRmiTargets(final boolean ignored) {
+ // no-op
+ }
+
+ public void setClearReferencesStopThreads(final boolean ignored) {
+ // no-op
+ }
+
+ public void setClearReferencesStopTimerThreads(final boolean ignored) {
+ // no-op
+ }
+ }
+}
+
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/tomcat/TomcatAutoInitializer.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,44 @@
+/*
+ * 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.apache.meecrowave.tomcat;
+
+import org.apache.catalina.servlets.DefaultServlet;
+import org.apache.meecrowave.Meecrowave;
+
+import javax.servlet.ServletContainerInitializer;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+import java.util.Set;
+
+public class TomcatAutoInitializer implements ServletContainerInitializer {
+ @Override
+ public void onStartup(final Set<Class<?>> c, final ServletContext ctx) throws ServletException {
+ final Meecrowave.Builder builder = Meecrowave.Builder.class.cast(ctx.getAttribute("meecrowave.configuration"));
+ if (!builder.isTomcatAutoSetup()) {
+ return;
+ }
+
+ final ServletRegistration.Dynamic def = ctx.addServlet("default", DefaultServlet.class);
+ def.setInitParameter("listings", "false");
+ def.setInitParameter("debug", "0");
+ def.setLoadOnStartup(1);
+ def.addMapping("/");
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/LICENSE
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/LICENSE?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/LICENSE (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/LICENSE Sun Nov 13 09:34:07 2016
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/NOTICE?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/NOTICE (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/NOTICE Sun Nov 13 09:34:07 2016
@@ -0,0 +1,5 @@
+Apache Microwave
+Copyright 2016 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/beans.xml
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/beans.xml?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/beans.xml (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/beans.xml Sun Nov 13 09:34:07 2016
@@ -0,0 +1,19 @@
+<!--
+ 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.
+-->
+<beans />
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/openwebbeans/openwebbeans.properties
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/openwebbeans/openwebbeans.properties?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/openwebbeans/openwebbeans.properties (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/openwebbeans/openwebbeans.properties Sun Nov 13 09:34:07 2016
@@ -0,0 +1,20 @@
+#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.
+configuration.ordinal=1000
+org.apache.xbean.finder.filter.Filter=org.apache.meecrowave.openwebbeans.KnowClassesFilter
+org.apache.webbeans.spi.ScannerService=org.apache.meecrowave.openwebbeans.OWBTomcatWebScannerService
+org.apache.webbeans.spi.SecurityService=org.apache.meecrowave.openwebbeans.MeecrowaveSecurityService
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension Sun Nov 13 09:34:07 2016
@@ -0,0 +1 @@
+org.apache.meecrowave.openwebbeans.MeecrowaveBeansExtension
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/org.apache.juli.logging.Log
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/org.apache.juli.logging.Log?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/org.apache.juli.logging.Log (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/META-INF/services/org.apache.juli.logging.Log Sun Nov 13 09:34:07 2016
@@ -0,0 +1 @@
+org.apache.meecrowave.logging.tomcat.LogFacade
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.component.properties
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.component.properties?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.component.properties (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.component.properties Sun Nov 13 09:34:07 2016
@@ -0,0 +1,17 @@
+#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.
+Log4jLogEventFactory = org.apache.meecrowave.logging.log4j2.MeecrowaveLogEventFactory
Added: openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.meecrowave-logging
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.meecrowave-logging?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.meecrowave-logging (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/main/resources/log4j2.meecrowave-logging Sun Nov 13 09:34:07 2016
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<Configuration status="INFO">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout pattern="[%d{HH:mm:ss.SSS}][%highlight{%-5level}][%15.15t][%30.30logger] %msg%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="INFO">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>
+
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/MeecrowaveTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/MeecrowaveTest.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/MeecrowaveTest.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/MeecrowaveTest.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,116 @@
+/*
+ * 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.apache.meecrowave;
+
+import org.apache.cxf.helpers.FileUtils;
+import org.apache.meecrowave.io.IO;
+import org.junit.Test;
+import org.superbiz.app.Endpoint;
+import org.superbiz.app.RsApp;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.net.URL;
+import java.util.stream.Stream;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+public class MeecrowaveTest {
+ @Test
+ public void simpleWebapp() {
+ final File root = new File("target/MeecrowaveTest/simpleWebapp/app");
+ FileUtils.mkDir(root);
+ Stream.of(Endpoint.class, RsApp.class).forEach(type -> {
+ final String target = type.getName().replace(".", "/");
+ File targetFile = new File(root, "WEB-INF/classes/" + target + ".class");
+ FileUtils.mkDir(targetFile.getParentFile());
+ try (final InputStream from = Thread.currentThread().getContextClassLoader().getResourceAsStream(target + ".class");
+ final OutputStream to = new FileOutputStream(targetFile)) {
+ IO.copy(from, to);
+ } catch (final IOException e) {
+ fail();
+ }
+ });
+ Stream.of("OtherEndpoint", "OtherFilter").forEach(name -> { // from classpath but not classloader to test in webapp deployment
+ final String target = "org/superbiz/app/" + name + ".class";
+ File targetFile = new File(root, "WEB-INF/classes/" + target);
+ FileUtils.mkDir(targetFile.getParentFile());
+ try (final InputStream from = Thread.currentThread().getContextClassLoader().getResourceAsStream("org/superbiz/app-res/" + name + ".class");
+ final OutputStream to = new FileOutputStream(targetFile)) {
+ IO.copy(from, to);
+ } catch (final IOException e) {
+ fail();
+ }
+ });
+ try (final Writer indexHtml = new FileWriter(new File(root, "index.html"))) {
+ indexHtml.write("hello");
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ try (final Meecrowave meecrowave = new Meecrowave(new Meecrowave.Builder().randomHttpPort()).start()) {
+ meecrowave.deployWebapp("", root);
+ assertEquals("hello", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/index.html")));
+ assertEquals("simple", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/api/test")));
+ assertEquals("simplepathinfo", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort()
+ + "/api/test?checkcustom=pathinfo#is=fine")));
+ assertEquals("simple", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/api/other")));
+ assertEquals("simplefiltertrue", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/filter")));
+ assertEquals("filtertrue", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/other")));
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void classpath() {
+ try (final Meecrowave meecrowave = new Meecrowave(new Meecrowave.Builder().randomHttpPort()).bake()) {
+ assertEquals("simple", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/api/test")));
+ assertEquals("simplefiltertrue", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/filter")));
+ assertEquals(
+ "sci:" + Endpoint.class.getName() + RsApp.class.getName(),
+ slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/sci")));
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void json() {
+ try (final Meecrowave meecrowave = new Meecrowave(new Meecrowave.Builder().randomHttpPort()).bake()) {
+ assertEquals("{\"name\":\"test\"}", slurp(new URL("http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/api/test/json")));
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ }
+
+ private String slurp(final URL url) {
+ try (final InputStream is = url.openStream()) {
+ return IO.toString(is);
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ return null;
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/PrincipalTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/PrincipalTest.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/PrincipalTest.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/PrincipalTest.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,87 @@
+/*
+ * 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.apache.meecrowave;
+
+import org.apache.catalina.realm.RealmBase;
+import org.apache.meecrowave.io.IO;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
+import java.security.Principal;
+
+import static javax.xml.bind.DatatypeConverter.printBase64Binary;
+import static org.junit.Assert.assertEquals;
+
+public class PrincipalTest {
+ @Test
+ public void run() throws IOException {
+ try (final Meecrowave container = new Meecrowave(new Meecrowave.Builder()
+ .randomHttpPort()
+ .realm(new RealmBase() {
+ @Override
+ protected String getName() {
+ return "test";
+ }
+
+ @Override
+ protected String getPassword(final String username) {
+ return "foo".equals(username) ? "pwd" : null;
+ }
+
+ @Override
+ protected Principal getPrincipal(final String username) {
+ return new MyPrincipal(username);
+ }
+ }).loginConfig(new Meecrowave.LoginConfigBuilder()
+ .basic()
+ .realmName("basic realm"))
+ .securityConstraints(new Meecrowave.SecurityConstaintBuilder()
+ .authConstraint(true)
+ .addAuthRole("**")
+ .addCollection("secured", "/*")))
+ .bake()) {
+ assertEquals(
+ "org.apache.meecrowave.PrincipalTest$MyPrincipal_foo org.apache.webbeans.custom.security.Principal_foo",
+ slurp(new URL("http://localhost:" + container.getConfiguration().getHttpPort() + "/api/test/principal")));
+ }
+ }
+
+ private String slurp(final URL url) throws IOException {
+ final URLConnection is = HttpURLConnection.class.cast(url.openConnection());
+ is.setRequestProperty("Authorization", "Basic " + printBase64Binary("foo:pwd".getBytes(StandardCharsets.UTF_8)));
+ return IO.toString(is.getInputStream());
+ }
+
+ private static class MyPrincipal implements Principal {
+ private final String name;
+
+ private MyPrincipal(final String username) {
+ this.name = username;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/SharedLibTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/SharedLibTest.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/SharedLibTest.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/SharedLibTest.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,46 @@
+/*
+ * 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.apache.meecrowave;
+
+import org.apache.meecrowave.io.IO;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import static org.junit.Assert.assertEquals;
+
+public class SharedLibTest {
+ @Test
+ public void run() throws IOException {
+ try (final Meecrowave container = new Meecrowave(new Meecrowave.Builder()
+ .randomHttpPort()
+ .sharedLibraries("target/shared-test"))
+ .bake()) {
+ assertEquals(
+ "org.apache.deltaspike.core.api.config.ConfigProperty",
+ slurp(new URL("http://localhost:" + container.getConfiguration().getHttpPort() + "/api/test/load/org.apache.deltaspike.core.api.config.ConfigProperty")));
+ }
+ }
+
+ private String slurp(final URL url) throws IOException {
+ return IO.toString(HttpURLConnection.class.cast(url.openConnection()).getInputStream());
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/runner/CliTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/runner/CliTest.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/runner/CliTest.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/apache/meecrowave/runner/CliTest.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,100 @@
+/*
+ * 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.apache.meecrowave.runner;
+
+import org.apache.meecrowave.io.IO;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.concurrent.TimeUnit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+public class CliTest {
+ @Test
+ public void bake() throws IOException {
+ int stop;
+ int http;
+ try (final ServerSocket s1 = new ServerSocket(0)) {
+ stop = s1.getLocalPort();
+ try (final ServerSocket s2 = new ServerSocket(0)) {
+ http = s2.getLocalPort();
+ }
+ }
+ final Thread runner = new Thread() {
+ {
+ setName("CLI thread");
+ }
+
+ @Override
+ public void run() {
+ Cli.main(new String[]{
+ "--context=app",
+ "--stop=" + stop,
+ "--http=" + http,
+ "--tmp-dir=target/CliTest/simple"
+ });
+ }
+ };
+ try {
+ runner.start();
+ for (int i = 0; i < 60; i++) {
+ try {
+ assertEquals("{\"name\":\"test\"}", slurp(new URL("http://localhost:" + http + "/app/api/test/json")));
+ return;
+ } catch (final AssertionError notYet) {
+ try {
+ Thread.sleep(1000);
+ } catch (final InterruptedException e) {
+ Thread.interrupted();
+ fail();
+ }
+ }
+ }
+ fail("Didnt achieved the request");
+ } finally {
+ try (final Socket client = new Socket("localhost", stop)) {
+ client.getOutputStream().write("SHUTDOWN".getBytes(StandardCharsets.UTF_8));
+ } catch (final IOException ioe) {
+ // ok, container is down now
+ } finally {
+ try {
+ runner.join(TimeUnit.MINUTES.toMillis(1));
+ } catch (final InterruptedException e) {
+ Thread.interrupted();
+ }
+ }
+ }
+ }
+
+ private String slurp(final URL url) {
+ try (final InputStream is = url.openStream()) {
+ return IO.toString(is);
+ } catch (final IOException e) {
+ fail(e.getMessage());
+ }
+ return null;
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Endpoint.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Endpoint.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Endpoint.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Endpoint.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,108 @@
+/*
+ * 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.superbiz.app;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import java.security.Principal;
+
+import static java.util.Optional.ofNullable;
+import static org.junit.Assert.assertNotNull;
+
+@Path("test")
+@ApplicationScoped
+public class Endpoint {
+ @Inject
+ private Injectable injectable;
+
+ @Inject
+ private Principal pcp;
+
+ @Inject
+ private HttpServletRequest request;
+
+ @Inject
+ private BeanManager bm;
+
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public String simple(@QueryParam("checkcustom") final String query) {
+ return Boolean.parseBoolean(injectable.injected()) ? "simple" + ofNullable(query).orElse("") : "fail";
+ }
+
+ @GET
+ @Path("json")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Simple json() {
+ return new Simple("test");
+ }
+
+ @GET
+ @Path("principal")
+ @Produces(MediaType.TEXT_PLAIN)
+ public String principal() {
+ return request.getUserPrincipal().getClass().getName() + "_" + request.getUserPrincipal().getName() + " " +
+ pcp.getClass().getName().replaceAll("\\$\\$OwbNormalScopeProxy[0-9]+", "") + "_" + pcp.getName();
+ }
+
+ @GET
+ @Path("load/{name}")
+ @Produces(MediaType.TEXT_PLAIN)
+ public String load(@PathParam("name") final String fqn) {
+ try {
+ final ClassLoader loader = Thread.currentThread().getContextClassLoader(); // if sharedlib is set should be MeecrowaveClassloader
+ if (fqn.contains("deltaspike")) {
+ final Class<?> ce = loader.loadClass("org.apache.deltaspike.core.impl.config.ConfigurationExtension");
+ final Object extensionBeanInstance = bm.getReference(bm.resolve(bm.getBeans(ce)), ce, bm.createCreationalContext(null));
+ assertNotNull(extensionBeanInstance);
+ }
+ return loader.loadClass(fqn).getName();
+ } catch (final ClassNotFoundException cnfe) {
+ return "oops";
+ }
+ }
+
+ public static class Simple {
+ private String name;
+
+ public Simple() {
+ // no-op
+ }
+
+ public Simple(final String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Init.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Init.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Init.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Init.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,60 @@
+/*
+ * 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.superbiz.app;
+
+import javax.servlet.DispatcherType;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContainerInitializer;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.HandlesTypes;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Application;
+import java.io.IOException;
+import java.util.EnumSet;
+import java.util.Set;
+
+import static java.util.stream.Collectors.joining;
+
+@HandlesTypes({Path.class, Application.class})
+public class Init implements ServletContainerInitializer {
+ @Override
+ public void onStartup(final Set<Class<?>> c, final ServletContext ctx) throws ServletException {
+ ctx.addFilter("sci", new Filter() {
+ @Override
+ public void init(final FilterConfig filterConfig) throws ServletException {
+ // no-op
+ }
+
+ @Override
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
+ response.getWriter().write("sci:" + c.stream().map(Class::getName).sorted().collect(joining()));
+ }
+
+ @Override
+ public void destroy() {
+ // no-op
+ }
+ }).addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/sci");
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Injectable.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Injectable.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Injectable.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/Injectable.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,28 @@
+/*
+ * 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.superbiz.app;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class Injectable {
+ public String injected() {
+ return "true";
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/RsApp.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/RsApp.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/RsApp.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/RsApp.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,28 @@
+/*
+ * 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.superbiz.app;
+
+import javax.enterprise.context.Dependent;
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+@Dependent
+@ApplicationPath("api")
+public class RsApp extends Application {
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/SomeFilter.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/SomeFilter.java?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/SomeFilter.java (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/java/org/superbiz/app/SomeFilter.java Sun Nov 13 09:34:07 2016
@@ -0,0 +1,50 @@
+/*
+ * 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.superbiz.app;
+
+import javax.inject.Inject;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import java.io.IOException;
+
+@WebFilter("/filter")
+public class SomeFilter implements Filter {
+ @Inject
+ private Injectable injectable;
+
+ @Override
+ public void init(final FilterConfig filterConfig) throws ServletException {
+ // no-op
+ }
+
+ @Override
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
+ response.getWriter().write("simplefilter" + injectable.injected());
+ }
+
+ @Override
+ public void destroy() {
+ // no-op
+ }
+}
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/META-INF/services/javax.servlet.ServletContainerInitializer
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/META-INF/services/javax.servlet.ServletContainerInitializer?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/META-INF/services/javax.servlet.ServletContainerInitializer (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/META-INF/services/javax.servlet.ServletContainerInitializer Sun Nov 13 09:34:07 2016
@@ -0,0 +1 @@
+org.superbiz.app.Init
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherEndpoint.class
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherEndpoint.class?rev=1769479&view=auto
==============================================================================
Binary file - no diff available.
Propchange: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherEndpoint.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherFilter.class
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherFilter.class?rev=1769479&view=auto
==============================================================================
Binary file - no diff available.
Propchange: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/org/superbiz/app-res/OtherFilter.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/sirona.properties
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/sirona.properties?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/sirona.properties (added)
+++ openwebbeans/microwave/trunk/meecrowave-core/src/test/resources/sirona.properties Sun Nov 13 09:34:07 2016
@@ -0,0 +1,31 @@
+#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.
+
+#
+# to use add to the launcher
+# -javaagent:/.../sirona-javaagent-0.5-incubating-SNAPSHOT-shaded.jar=dumpOnExit=/tmp/sirona.csv
+#
+
+org.apache.sirona.javaagent.listener.CounterListener.excludes = \
+ container:jvm,\
+ prefix:org.apache.logging.log4j,\
+ prefix:org.apache.catalina.core.ContainerBase,\
+ prefix:org.apache.tomcat.util.descriptor.web.WebXml,\
+ prefix:org.apache.cxf.common.util.Spring,\
+ prefix:org.apache.sirona
+
+org.apache.sirona.javaagent.path.tracking.activate=false
Added: openwebbeans/microwave/trunk/meecrowave-doc/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/meecrowave-doc/pom.xml?rev=1769479&view=auto
==============================================================================
--- openwebbeans/microwave/trunk/meecrowave-doc/pom.xml (added)
+++ openwebbeans/microwave/trunk/meecrowave-doc/pom.xml Sun Nov 13 09:34:07 2016
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>meecrowave</artifactId>
+ <groupId>org.apache.meecrowave</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>meecrowave-doc</artifactId>
+ <name>Meecrowave :: Doc</name>
+ <description>A module building the static website in ${project.build.directory}/${project.build.finalName}</description>
+
+ <properties>
+ <jbake.http>false</jbake.http>
+ <jbake.pdf>true</jbake.pdf>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.asciidoctor</groupId>
+ <artifactId>asciidoctorj-pdf</artifactId>
+ <version>1.5.0-alpha.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.asciidoctor</groupId>
+ <artifactId>asciidoctorj</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby</groupId>
+ <artifactId>jruby-complete</artifactId>
+ <version>1.7.24</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>ziplock</artifactId>
+ <version>7.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>javaee-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.tomee</groupId>
+ <artifactId>openejb-jee</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.meecrowave</groupId>
+ <artifactId>meecrowave-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.meecrowave</groupId>
+ <artifactId>meecrowave-maven-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.meecrowave</groupId>
+ <artifactId>meecrowave-gradle-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.meecrowave</groupId>
+ <artifactId>meecrowave-arquillian</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jbake</groupId>
+ <artifactId>jbake-core</artifactId>
+ <version>2.4.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy</artifactId>
+ <version>2.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-templates</artifactId>
+ <version>2.3.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>2.7</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.4.0</version>
+ <executions>
+ <execution>
+ <id>meecrowave-site</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <includeProjectDependencies>true</includeProjectDependencies>
+ <mainClass>org.apache.meecrowave.doc.JBake</mainClass>
+ <arguments>
+ <argument>${project.basedir}/src/main/jbake/</argument>
+ <argument>${project.build.directory}/${project.build.finalName}</argument>
+ <argument>${jbake.http}</argument>
+ <argument>${jbake.pdf}</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!--
+ Don't deliver it yet.
+ -->
+ <distributionManagement>
+ <repository>
+ <id>localhost</id>
+ <url>file://${project.basedir}/target/repo/</url>
+ </repository>
+ <snapshotRepository>
+ <id>localhost</id>
+ <url>file://${project.basedir}/target/snapshot-repo/</url>
+ </snapshotRepository>
+ </distributionManagement>
+</project>