Package junit.framework

Examples of junit.framework.AssertionFailedError


  
   protected void assertNoService(ObjectName name) throws Exception
   {
      ServiceContext ctx = getServiceContext(name);
      if (ctx != null && ctx.state != ServiceContext.NOTYETINSTALLED)
         throw new AssertionFailedError("Should not be a service context for " + ctx);
   }
View Full Code Here


   {
      ServiceContext ctx = getServiceContext(name);
      if (registered == false && ctx == null)
         return;
      if (ctx == null)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " but there is no context/state");
      if (expectedState != ctx.state)
         throw new AssertionFailedError("Incorrect state for " + name + " expected " + ServiceContext.getStateString(expectedState) + " got " + ctx.getStateString());
   }
View Full Code Here

   public void assertMBeanFailed(ObjectName name, boolean registered) throws Exception
   {
      MBeanServer server = getServer();
      if (server.isRegistered(name))
         throw new AssertionFailedError(name + " should not be registered after a failure");
   }
View Full Code Here

   
    public static File getTaggedFile(File directory) throws Exception {
        //File directory = Configuration.getFile("junit.format.directory");
        if (!(directory.exists() && directory.isDirectory() && directory
                .canRead())) {
            throw new AssertionFailedError(
                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
View Full Code Here

        File testDirectory = Configuration.getFile("junit.format.directory");
        this.directory = Utils.createCopyOfDirectory(testDirectory);
        setName("DirecotryTest on " + testDirectory.getAbsolutePath());
        if (!(directory.exists() && directory.isDirectory() && directory
                .canRead())) {
            throw new AssertionFailedError(
                    "config.properties->junit.formats.directory should be a readable directory. ");
        }
        File[] files = directory.listFiles(new AudioFileFilter());
        for (int i = 0; i < files.length; i++) {
            File current = files[i];
View Full Code Here

            message.append("expected translated statement:\n  ").append(
                expectedTranslatedStatement).append('\n');
            message.append("actual translated statement:\n  ").append(
                actualTranslatedStatement).append('\n');

            throw new AssertionFailedError(message.toString());
        }

        if (expectedContent instanceof Object[][]) {
            ensureTableContent(viewName, (Object[][]) expectedContent);
        }
View Full Code Here

   }

   public static void assertTrue(String text, boolean assertion)
   {
      if (assertion == false)
         throw new AssertionFailedError(text);
   }
View Full Code Here

     * method has been called.
     */

    private void confirmSetup() {
        if (!this.isInitialized) {
            throw new AssertionFailedError(
                    "You are overriding the setUp() method without calling super.setUp().  You must call the superclass setUp() method in your TestCase subclass to ensure proper initialization."); //$NON-NLS-1$
        }
    }
View Full Code Here

        digester.addCallParam("web-app/servlet/init-param/param-name", 0); //$NON-NLS-1$
        digester.addCallParam("web-app/servlet/init-param/param-value", 1); //$NON-NLS-1$
        try {
            InputStream input = this.context.getResourceAsStream(pathname);
            if (input == null)
                throw new AssertionFailedError("Invalid pathname: " + pathname); //$NON-NLS-1$
            digester.parse(input);
            input.close();
        } catch (Exception e) {
            throw new AssertionFailedError(
                    "Received an exception while loading web.xml - " //$NON-NLS-1$
                            + e.getClass() + " : " + e.getMessage()); //$NON-NLS-1$
        }

        // now the context parameters..
        digester = new Digester();
        digester.setValidating(false);
        digester.push(this.context);
        digester.addCallMethod("web-app/context-param", "setInitParameter", 2); //$NON-NLS-1$ //$NON-NLS-2$
        digester.addCallParam("web-app/context-param/param-name", 0); //$NON-NLS-1$
        digester.addCallParam("web-app/context-param/param-value", 1); //$NON-NLS-1$
        try {
            InputStream input = this.context.getResourceAsStream(pathname);
            if (input == null)
                throw new AssertionFailedError("Invalid pathname: " + pathname); //$NON-NLS-1$
            digester.parse(input);
            input.close();
        } catch (Exception e) {
            throw new AssertionFailedError(
                    "Received an exception while loading web.xml - " //$NON-NLS-1$
                            + e.getClass() + " : " + e.getMessage()); //$NON-NLS-1$
        }
    }
View Full Code Here

        confirmSetup();
        String fullForwardPath = this.request.getContextPath() + forwardPath;

        String actualForward = getActualForward();
        if (actualForward == null) {
            throw new AssertionFailedError(
                    "Was expecting '" //$NON-NLS-1$
                            + fullForwardPath
                            + "' but it appears the Action has tried to return an ActionForward that is not mapped correctly."); //$NON-NLS-1$
        }
        if (!(actualForward.equals(fullForwardPath)))
            throw new AssertionFailedError("was expecting '" + fullForwardPath //$NON-NLS-1$
                    + "' but received '" + actualForward + "'"); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here

TOP

Related Classes of junit.framework.AssertionFailedError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.