[jboss-svn-commits] JBoss Common SVN: r4051 - in shrinkwrap/trunk: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/formatter and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Feb 22 18:40:38 EST 2010
Author: ALRubinger
Date: 2010-02-22 18:40:38 -0500 (Mon, 22 Feb 2010)
New Revision: 4051
Removed:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/FullFormatter.java
shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/formatter/FullFormatterTestCase.java
Modified:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/Formatters.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/VerboseFormatter.java
Log:
[SHRINKWRAP-134] Remove FullFormatter
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/Formatters.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/Formatters.java 2010-02-22 23:35:33 UTC (rev 4050)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/Formatters.java 2010-02-22 23:40:38 UTC (rev 4051)
@@ -42,14 +42,8 @@
* {@link Formatter} implementation to provide a simple, one-line
* description of an {@link Archive}, including its name.
*/
- SIMPLE(SimpleFormatter.INSTANCE),
+ SIMPLE(SimpleFormatter.INSTANCE);
- /**
- * {@link Formatter} implementation to provide a full description
- * of the contents of the archive, similar to jar -tf archive.
- */
- FULL(FullFormatter.INSTANCE);
-
//-------------------------------------------------------------------------------------||
// Internal Members -------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
Deleted: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/FullFormatter.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/FullFormatter.java 2010-02-22 23:35:33 UTC (rev 4050)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/FullFormatter.java 2010-02-22 23:40:38 UTC (rev 4051)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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 org.jboss.shrinkwrap.api.formatter;
-
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.Node;
-
-/**
- * {@link Formatter} implementation to provide the full path (including parents) of
- * all items within the {@link Archive}.
- */
-enum FullFormatter implements Formatter
-{
- INSTANCE;
-
- @Override
- public String format(final Archive<?> archive) throws IllegalArgumentException
- {
- // Precondition checks
- if (archive == null)
- {
- throw new IllegalArgumentException("archive must be specified");
- }
-
- // Start the output with the name of the archive
- StringBuilder sb = new StringBuilder(archive.getName()).append(FormattingConstants.COLON)
- .append(FormattingConstants.NEWLINE);
-
- // Format recursively, except the parent
- Node rootNode = archive.get("/");
- for (Node child : rootNode.getChildren())
- {
- format(sb, child);
- }
-
- // remove the last NEWLINE
- sb.deleteCharAt(sb.length() - 1);
-
- return sb.toString();
- }
-
- /**
- * Helper method to format recursively
- * @param sb
- * @param node
- */
- private void format(StringBuilder sb, Node node)
- {
- sb.append(node.getPath().get());
- if (node.getAsset() == null)
- {
- sb.append(FormattingConstants.SLASH);
- }
-
- sb.append(FormattingConstants.NEWLINE);
-
- for (Node child : node.getChildren())
- {
- format(sb, child);
- }
- }
-}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/VerboseFormatter.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/VerboseFormatter.java 2010-02-22 23:35:33 UTC (rev 4050)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/formatter/VerboseFormatter.java 2010-02-22 23:40:38 UTC (rev 4051)
@@ -31,6 +31,15 @@
INSTANCE;
//-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Root character "/"
+ */
+ private static final String ROOT = "/";
+
+ //-------------------------------------------------------------------------------------||
// Required Implementations -----------------------------------------------------------||
//-------------------------------------------------------------------------------------||
@@ -48,7 +57,7 @@
.append(FormattingConstants.NEWLINE);
// format recursively, except the parent
- Node rootNode = archive.get("/");
+ Node rootNode = archive.get(ROOT);
for (Node child : rootNode.getChildren())
{
format(sb, child);
Deleted: shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/formatter/FullFormatterTestCase.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/formatter/FullFormatterTestCase.java 2010-02-22 23:35:33 UTC (rev 4050)
+++ shrinkwrap/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/formatter/FullFormatterTestCase.java 2010-02-22 23:40:38 UTC (rev 4051)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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 org.jboss.shrinkwrap.impl.base.formatter;
-
-import org.jboss.shrinkwrap.api.formatter.Formatter;
-import org.jboss.shrinkwrap.api.formatter.Formatters;
-
-/**
- * Ensures that the {@link Formatters.Full} is functioning
- * as expected. Added to fix SHRINKWRAP-97.
- *
- * @author <a href="mailto:lightguard.jp at gmail.com">Jason Porter</a>
- * @version $Revision: $
- */
-public class FullFormatterTestCase extends FormatterTestBase
-{
-
- //-------------------------------------------------------------------------------------||
- // Class Members ----------------------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- private static final String EXPECTED_OUTPUT = NAME_ARCHIVE
- + ":\n/org/\n/org/jboss/\n/org/jboss/shrinkwrap/\n/org/jboss/shrinkwrap/impl/\n/org/jboss/shrinkwrap/impl/base/\n"
- + "/org/jboss/shrinkwrap/impl/base/formatter/\n/org/jboss/shrinkwrap/impl/base/formatter/FormatterTestBase.class\n"
- + "/org/jboss/shrinkwrap/impl/base/test/\n/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.class";
-
- //-------------------------------------------------------------------------------------||
- // Required Implementations -----------------------------------------------------------||
- //-------------------------------------------------------------------------------------||
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.shrinkwrap.impl.base.formatter.FormatterTestBase#getFormatter()
- */
- @Override
- Formatter getFormatter()
- {
- return Formatters.FULL;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.shrinkwrap.impl.base.formatter.FormatterTestBase#getExpectedOutput()
- */
- @Override
- String getExpectedOutput()
- {
- return EXPECTED_OUTPUT;
- }
-}
More information about the jboss-svn-commits
mailing list